Description | The cmCTestCoverageHandler::FindUncoveredFiles() method prepends the top directory of the source tree to the glob expressions specified by CTEST_EXTRA_COVERAGE_GLOB in, for example, the CTestCustom.cmake file.
Now is it, however, also common that source files are configured during the configuration of the build system and the configured files are placed in the binary directory. These configured files are the ones which get compiled and linked into the binaries which are executed during testing. For example, consider a config.cxx.in file in the source tree, which is configured to config.cxx in the build tree. When defining extra coverage globs, the file would need to be searched for in the binary tree instead of the source tree.
The FindUncoveredFiles() method should therefore either for each glob expression prepend once the top directory of the source tree and once the top directory of the binary tree or leave absolute glob expression, i.e., ones starting with a leading slash (/) unmodified. If a file is found in both trees, the one in the binary directory should probably take precedence as there must have been a reason that this file was configured/copied to the binary tree. |