CTestCoverageCollectGCOV¶
New in version 3.2.
This module provides the ctest_coverage_collect_gcov function.
This function runs gcov on all .gcda files found in the binary tree and packages the resulting .gcov files into a tar file. This tarball also contains the following:
data.json defines the source and build directories for use by CDash.
Labels.json indicates any
LABELSthat have been set on the source files.The uncovered directory holds any uncovered files found by
CTEST_EXTRA_COVERAGE_GLOB.
After generating this tar file, it can be sent to CDash for display with the
ctest_submit(CDASH_UPLOAD) command.
-
ctest_coverage_collect_gcov¶ ctest_coverage_collect_gcov(TARBALL <tarfile> [SOURCE <source_dir>][BUILD <build_dir>] [GCOV_COMMAND <gcov_command>] [GCOV_OPTIONS <options>...] )
Run gcov and package a tar file for CDash. The options are:
TARBALL <tarfile>Specify the location of the
.tarfile to be created for later upload to CDash. Relative paths will be interpreted with respect to the top-level build directory.TARBALL_COMPRESSION <option>New in version 3.18.
Specify a compression algorithm for the
TARBALLdata file. Using this option reduces the size of the data file before it is submitted to CDash.<option>must be one ofGZIP,BZIP2,XZ,ZSTD,FROM_EXT, or an expression that CMake evaluates asFALSE. The default value isBZIP2.If
FROM_EXTis specified, the resulting file will be compressed based on the file extension of the<tarfile>(i.e..tar.gzwill useGZIPcompression). File extensions that will produce compressed output include.tar.gz,.tgz,.tar.bzip2,.tbz,.tar.xz, and.txz.SOURCE <source_dir>Specify the top-level source directory for the build. Default is the value of
CTEST_SOURCE_DIRECTORY.BUILD <build_dir>Specify the top-level build directory for the build. Default is the value of
CTEST_BINARY_DIRECTORY.GCOV_COMMAND <gcov_command>Specify the full path to the
gcovcommand on the machine. Default is the value ofCTEST_COVERAGE_COMMAND.GCOV_OPTIONS <options>...Specify options to be passed to gcov. The
gcovcommand is run asgcov <options>... -o <gcov-dir> <file>.gcda. If not specified, the default option is just-b -x.GLOBNew in version 3.6.
Recursively search for .gcda files in build_dir rather than determining search locations by reading TargetDirectories.txt.
DELETENew in version 3.6.
Delete coverage files after they've been packaged into the .tar.
QUIETSuppress non-error messages that otherwise would have been printed out by this function.
New in version 3.3: Added support for the
CTEST_CUSTOM_COVERAGE_EXCLUDEvariable.