-
Notifications
You must be signed in to change notification settings - Fork 10
Unit Testing
Since Fyara, a set of unit tests have been added using Catch2 framework.
Those tests are not extensive yet, but we may progressively increase our code coverage with them.
To compile tests along filters, you should add BUILD_TESTS to your custom cmake options, and submodules should be initialised and updated (done by default by cmake, with the GIT_SUBMODULE option).
For now, there are 2 test suites defined:
-
tests_toolkit, which is compiled as long as you ask for tests compilation
- this suite tests general toolkits, not associated with any filter
-
tests_darwin_yara, which is compiled if you ask for tests compilation, AND fyara compilation
- this suite test the yara toolkit, associated with the fyara filter
As a rule of thumb, future test suites should be named "tests_<name_of_the_filter>.
Those tests can simply be called to run, and should return 0 on success, a non-zero value on error, please refer to Catch2 reference for information on possible output and parameters.
Unit tests are currently not required when proposing new features (however, functional testing is still mandatory), but priority will be given to PRs with efforts made on UTests.