Teach CTestCoverageCollectGCOV to honor the
CTEST_EXTRA_COVERAGE_GLOB variable. When this variable is set,
this module will glob for matching source files that were not
covered and include them in the resulting tar file.
Consistently glob for .gcda files in the binary directory.
Previously the behavior of this function depended on the
current working directory that it was called from.
This commit introduces two new options to CTestCoverageCollectGCOV.
When GLOB is set we recursively search in the source & binary
directories for .gcda files. Otherwise the default behavior is to
parse TargetDirectories.txt for a list of locations to search.
When DELETE is set we remove any .gcda file found after it has
been used to generate the corresponding .gcov file. The .gcov
file is also removed after the result tarball has been created.
Together these two new features help support the use case of
computing coverage across subprojects.
When loading the list of target support directories, read the file
with UTF-8 encoding since that is what CMake writes into the file.
This allows us to support international characters in the path to
the build tree containing the target support directories.
Add a GCOV_OPTIONS option to allow specification of custom flags. In
ctest_coverage gcov support, if you set CTEST_COVERAGE_EXTRA_FLAGS, they
get put on the command line before the -o. In this case we remove the
-b and replace it with GCOV_OPTIONS. All other arguments remain the
same.
Provide a function to run gcov and create a tarball of results.
Since CDash tracks the md5sum of the files uploaded, use the
--mtime option with "cmake -E tar" so that tar files could be
created that would have the same md5sum with the same content.