2.1 KiB
		
	
	
	
	
	
	
	
			
		
		
	
	Coverage report
Coverage report is intended for developers using compilers GCC or Clang (including Apple Clang). It is generated by the build target coverage_report, which is only enabled when both tests and coverage options are set (e.g., with -o coverage=True -o tests=True in conan).
Prerequisites
To generate the coverage report you need:
- gcovr tool (can be installed e.g. with 
pip install gcovr) gcovfor GCC (installed with the compiler by default)llvm-covfor Clang (installed with the compiler by default, also on Apple)Debugbuild type
Creating the coverage report
The coverage report is created when the following steps are completed, in order:
clio_testsbinary built with the instrumentation data, enabled by thecoverageoption mentioned above.- Completed run of unit tests, which populates coverage capture data.
 - Completed run of 
gcovrtool, which internally invokes eithergcovorllvm-covto assemble both instrumentation data and coverage capture data into a coverage report. 
The above steps are automated into a single target coverage_report. The instrumented clio_tests binary can also be used for running regular unit tests.
In case of a spurious failure of unit tests, it is possible to re-run the coverage_report target without rebuilding the clio_tests binary (since it is simply a dependency of the coverage report target).
The default coverage report format is html-details, but developers can override it to any of the formats listed in cmake/CodeCoverage.cmake by setting CODE_COVERAGE_REPORT_FORMAT variable in cmake. For example, CI is setting this parameter to xml for the codecov integration.
After the coverage_report target is completed, the generated coverage report will be stored inside the build directory as either:
- A File named 
coverage_report.*, with a suitable extension for the report format. - A Directory named 
coverage_report, withindex.htmland other files inside, forhtml-detailsorhtml-nestedreport formats.