This is the management system of a championship standings table. It was formally specified using the B language. From that specification, the Atelier-B tool generated C code in an automatic fashion. After that, the CppUTest framework was used for unit-testing the functions implemented, and the code coverage plus its branch coverage were analyzed using the gcov tool. Finally, the lcov and genhtml tools were used for generating nice report tables from the output of gcov.
In order to run the tests, you'll need to have the following softwares installed on your pc:
- CppUTest;
- gcov;
- lcov;
- genhtml.
After cloning this repo, you have to edit the Makefile. Set the CPPUTEST_HOME
variable to the installation folder of CppUTest on your computer (this step is not needed if you installed it via apt-get or brew), and set the PROJECT_DIR
variable to the path of this repo on your machine.
Enter the test directory. Here are some commands:
make test
: runs the tests in the test directory;make gcov
: generates line coverage and branch coverage reports using the gcov tool;make lcov
: generates a more human-readable report, using the tool lcov, based on the output of gcov.
For more options, type make
in your terminal and check on what your autocomplete suggests to you. ;)