With respect to the Code Coverage Statistics tool, the GCC built-in support for Gcov, with compile-time plus parameter options for code insertion, allows code coverage to be implemented under the Linux platform. In the Windows platform, as early as a few years ago, I have not found a particularly useful and open-source coverage tools, so the company was its own implementation of a set, the use is not very convenient.
The same problem was recently encountered, but fortunately, the C + + code coverage tool for an open source Windows platform appeared in front of me: Opencppcoverage.
Opencppcoverage is an open source C + + code coverage tool under the Windows platform, easy to use, full of functionality and powerful. 2014 only launched, only hate did not find early.
Very simple to use, it does not need to be inserted at compile time, only need to have PDB file, run-time plug-in, through the opencppcoverage boot process.
Official website: https://opencppcoverage.codeplex.com/
Functions are also relatively complete, the main features are:
- No need to recompile the program, just use Opencppcoverage to run the program.
- The performance overhead is relatively small.
- Filter by module, code path.
- Automatically generate HTML coverage results reports.
- Multiple coverage result merges are supported.
- Integrated Jenkins
Don't use it too easy, do it:
Opencppcoverage.exe --sources mysourcepath--yourprogram.exe arg1 arg2
Working with Documents: https://opencppcoverage.codeplex.com/documentation
Jenkins Integration: Https://opencppcoverage.codeplex.com/wikipage?title=Jenkins
Coverage Detail Results
Jenkins Integration
C + + Open source Code Coverage Tool Opencppcoverage Introduction (Windows)