A test framework for nnfw_api that is built with gtest.
This test framework consists of 3 kinds of tests:
- Validation Tests (fixture format
ValidationTest???
)- Basic positive/negative tests with simple nnpackages
- Generated Model Tests (fixture format
GenModelTest
)- One-time inference test with variety of generated models
- Regression Tests (fixture format
RegressionTest
, test formatGitHub###
)- When you see bugs/crashes while using those API
- Must refer a github issue
- Misc Tests (fixture format
Test???
)- When you want to introduce any API use scenarios with any nnpackages
NOTE It is not recommended adding a test this way, since you can make a Circle model with some code using
CircleGen
class. See alsoGenModelTest
.
To test nnfw_api, we almost always need some nnpackages. Those are stored in a web server so there is no nnpackage files in the repo.
If there is no nnpackage that is sufficient for your need, you may need to create one. However it is not allowed to store nnpackage files in the repo.
If you want to add some, please leave an issue of asking for adding new nnpackages to the server. Then add config.sh
for each nnpackage in tests/scripts/nnfw_api_gtest_models
.
Once you have done the above steps, please register it in the test source code to make use of it. You may take a look at NNPackages
class for details.
You must install the test nnpackages before running the tests. They must be in the same directory with the test executable, under nnfw_api_gtest_models/
. Installation is done by command onert-test prepare-model
. It only runs correctly on CI, since the nnpackage file server is not public.