In this directory you can find the starting scripts for a hands-on demonstration of how to instrument C++ code for coverage analysis using Coco's CoverageScanner tool.
The directory contains:
library.cpp/library.h- Sample library functions to be testedmain.cpp- Test suite with data-driven testscoverage.bat- Windows build script using Visual Studio compilercoverage.sh- Linux/macOS build script using gccsolutions- Final versions of the coverage.bat and coverage.sh scripts
Windows:
- Visual Studio C/C++ Compilers (VS 2019 or VS 2022 recommended)
- Coco installed and available in PATH
Linux/macOS:
- gcc or clang compilers
- Coco installed and available in PATH
On Windows:
coverage.batOn Linux/macOS:
./coverage.shThe hands-on videos will guide you in modifying the script so that it performs the following:
- Compile the code using CoverageScanner (
csclwrapper) - Execute the instrumented binary to collect coverage data
- Import the execution results into the
.csmesfile - Automatically open CoverageBrowser to view the results
The final result can be found in the solutions directory.