The specific scripts and files used during the development of the program can be found in the dev/ folder.
The dev/ folder contains a subfolder called cmake/, in which we store the CMake configuration files used for various tasks, including:
release.cmaketo compile in release mode for the end user (default)tests.cmaketo compile the tests in debug mode and check for memory leaksprofile.cmaketo profile the code in release modecoverage.cmaketo analyze code coverage across tests
To use any of these build configurations, simply copy their content in the CMakeLists.txt file located in the root folder, and build the project with CMake (as shown here and here). The CMakesLists.txt files located in the src/ and the tests/ directories should not be changed.
In addition, the dev/ folder contains custom helper scripts used to automatize the quality checks described above:
switch.shchanges theCMakeLists.txtconfiguration to usebuild.shcompiles the program according toCMakeLists.txtin the root folderrun_tests.shruns all the tests and checks for errorsrun_valgrind.shruns all the tests while analysing memory userun_lcov.shruns all the tests and analyzed coveragerun_gprof.shruns the main program and analyzes performance
(See comments in the scripts for more details on how to use them.)
(Use chmod +x ... if needed to allow these scripts to run.)
These scripts must be run from the root directory after the relevant executables have been built. Specifically, run_tests.sh and run_valgrind.sh require the test executables (e.g. configurations tests.cmake or coverage.cmake), while run_lcov.sh requires tests with coverage enabled (e.g. coverage.cmake) and run_gprof.sh requires the compiled program with profiling flags on (e.g. profile.cmake). So, make sure to have the right CMakeLists.txt file in the root folder before building.
Please note that these scripts are helper tools used on a Linux machine during development. As such, they are not made to be compatible across platforms and will require specific packages installed in order to run (e.g. Valgrind or LCOV).