### Navigation

- index
- next |
- previous |
- CMake »
- 3.4.3 Documentation »
- cmake-modules(7) »

# CTestCoverageCollectGCOV

This module provides the function `ctest_coverage_collect_gcov`. The function will run gcov on the .gcda files in a binary tree and then package all of the .gcov files into a tar file with a data.json that contains the source and build directories for CDash to use in parsing the coverage data. In addtion the Labels.json files for targets that have coverage information are also put in the tar file for CDash to asign the correct labels. This file can be sent to a CDash server for display with the `ctest_submit(CDASH_UPLOAD)` command.

`cdash_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 `.tar` file to be created for later upload to CDash. Relative paths will be interpreted with respect to the top-level build directory.
  `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 `gcov` command on the machine. Default is the value of `CTEST_COVERAGE_COMMAND`.
  `GCOV_OPTIONS <options>...`
    Specify options to be passed to gcov. The `gcov` command is run as `gcov <options>... -o <gcov-dir> <file>.gcda`. If not specified, the default option is just `-b`.
  `QUIET`
    Suppress non-error messages that otherwise would have been printed out by this function.

### Navigation

- index
- next |
- previous |
- CMake »
- 3.4.3 Documentation »
- cmake-modules(7) »