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.
Copyright (C) 2026 Qt Group.
SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
This code repository contains code samples and other materials designed to help you learn and practice C/C++ code coverage analysis with Coco's CoverageScanner tool. The materials provided are intended for educational purposes to help test the skills you've gained from completing the course.
If you, your employer, or the legal entity you act on behalf of hold commercial license(s) with a Qt Group entity, this software package constitutes Pre-Release Code under the Qt License/Frame Agreement governing those licenses, and that agreement's terms and conditions govern your access and use of this software package.
This software package may provide links or access to third party libraries or code (collectively "Third-Party Software") to implement various functions. Use or distribution of Third-Party Software is discretionary and in all respects subject to applicable license terms of applicable third-party right holders.