This script provide the necessary command to use mutable testing on a C/C++ project.
Edit the config file and setup the paths to your project and required commands to build and run the unit tests.
You also need to provide a coverage file so the script mutate only the covered lines. You can get this file by compiling your project with the gcc coverage options:
gcc -O0 -fprofile-arcs -ftest-coverage
#run
lcov -o out.info -c -d .
Then just run the script.
./mutable-test-runner.py
This script does not parse the language, it only search pattern and replace them. This is preferable to use code coverage profiles to eliminate comments which might generate false negative.
It also consider spaces arround operators like a == b
not a==b
.
Before starting, the script call git reset --hard
to reset the sources
even if you made a previous run stopped by CTRL+C. Take care not loosing
data.
This script is provide under CeCILL-C which is a LGPL like and compatible license.