Unit Test Coverage
The next step for JPSCore is to provide unit tests to make sure that every methode we write does what we expect it to do. Our pyhton scripts are only for testing our simulation model, but not the methods itself.
A Unit test should cover at least 80% of a class/cpp file (100% would be the best of course). We are using Boost.Test as our Framework. You can find a sample of a unit test written with boost in jpscore/Utest/TestClassPointBoost.cpp
The first unit tests to write are for
Point.cpp (currently 60%) JEllipse.cpp (currently 66%) Line.cpp (currently 20%) Wall.cpp (0%) Room.cpp (0%) Obstacle.cpp (0%)
Please write the tests (one file per cpp-file) from scratch with boost (except for Point, you can simply extend TestClassPointBoost).
to check the code coverage by yourself you need to install gcovr (a python script open source) and call cmake with
cmake -DCMAKE_BUILD_TYPE:STRING=Debug -DBUILD_CPPUNIT_TEST=ON ..
after that of coure make and then ctest make ctest
after the tests where running you call gcovr "`pwd`/build/CMakeFiles/core.dir" -r . if you are in the jpscore directory.
If you have further questions let me know ;)