1 Testing
Moritz Strohm edited this page 6 months ago

Tests are required to make sure a component works as expected. Therefore, all components (classes) that MoeNavigatorEngine provides should have a test case in the long run. Currently (before release 0.0.1), major classes have tests, with more test cases to come.

Testing in MoeNavigatorEngine

Testing is done using CTest. Unless the DISABLE_TESTS flag is set when running CMake, all test cases from the "tests" folder are built and are available in the "tests" directory below the build directory. When ctest is invoked from the build directory, it will run all tests and output a report, including the failed tests.

To check where a failing test fails, build MoeNavigatorEngine with the DEBUG target first:

cmake -DCMAKE_BUILD_TYPE=Debug -B build .
cd build
make

Then, go into the build/tests directory and open one of the executable files with a debugger like gdb and set breakpoints in those places where you think the test will fail. If that doesn't work on the first attempt, you can narrow the point in the source file more by setting addititonal break points and then re-running the test in gdb.