Example program integrating Mayhem and Parasoft Cpp.
CMakeLists.txt
Cmake build definition. This is leading, theMakefile
is generated from thisMakefile
although generated from CMake, checked into SCM for CppTest to work okay.Dockerfile
specifies the Docker container with the program Mayhem needs to generate test casesMayhemfile
specifies the parameters for the Mayhem job so Mayhem can generate test casesmayhemit.c
the program we're fuzzing
build-container-run-mayhem-and-wait-for-testsuites.sh
this builds the container and kicks off a job in Mayhem. Note that parameters are needed, invoke the script to found out which.
It append the test cases to the tests/autogenerated/test_mayhemit_mayhem.csv
file.
Run in order:
build-instrumented-mayhemit.sh
builds a mayhemit binary that output coverage information via the CppTest CMake integrationrun-mayhem-testcases-manually.sh
executes the files in thetestsuites
directorycoverage-report.sh
generates a coverage report from theMayhemIt.clog
file that is appended to as the test cases in the previous step run
- Install Parasoft CppTest (google) in
/home/ubuntu/cpptest
- Activate license
- Create new project, import code, create build files
- Use CppTest to generate unit tests (follow Parasoft guides)
- Go to
TestSuite_mayhemit_c.c
in CppTest, right click,Parasoft
>Add unit test using using Wizard
.
- Follow this guide to add data source which will appear in
tests/autogenerated/test_mayhemit_mayhem.csv