Fuego uses the Boost Test Library for its unit tests.
The source code files for the tests of a Fuego library are located in a subdirectory named test
in the source code directory of the library. All tests are global functions registered with the BOOST_AUTO_TEST_CASE
macro.
There is an application named unittestmain
that compiles all unit tests of all Fuego libraries to a single executable located in unittestmain/fuego_unittest
in the build directory. This executable can be run standalone or in a debugger to execute the unittests. It will also be run (among other tests) when executing make check
or make distcheck
with the makefiles generated by autotools.
You can give runtime configuration parameters of the Boost Unit Test Framework as options to fuego_unittest
. For example, to execute only the single unit test SgArrayTest_Assign
, run:
fuego_unittest --run_test=SgArrayTest_Assign
It is mandatory to check that the unit tests succeed before committing new code to the main Fuego repository. Furthermore, it is recommended to regularly run the unit tests with the memory checker Valgrind using the command:
valgrind fuego_unittest