MantisBT - CMake
View Issue Details
0014061CMakeCTestpublic2013-04-04 10:542016-06-10 14:31
Andreas Langs 
Kitware Robot 
highmajoralways
closedmoved 
Linux
CMake 2.8.10.2 
 
0014061: COVERAGE_EXTRA_FLAGS not respected when coverage is run from ctest script
I configure my project with
-DCOVERAGE_EXTRA_FLAGS:STRING="-l -p"
.
Now if I run the coverage with
ctest -D ExperimentalCoverage -VV
I can see that the arguments "-l -p" are passed to the gcov executable.
If I invoke the coverage with the
ctest_coverage()
command in a ctest script which I run with
ctest -S script.cmake -VV
I see that the arguments are not passed to gcov, even the default argument -l is not passed.
Running both described variants with the --debug option I see that when running without the script the function
cmCTest::UpdateCTestConfiguration()
is called and all values from DartConfiguration.tcl are read.
Running with the script the function
cmCTest::UpdateCTestConfiguration()
is left early and the values from DartConfiguration.tcl are not read, in this case especially CoverageExtraFlags which holds the gcov arguments.

The variable
COVERAGE_EXTRA_FLAGS
was introduced with commit http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2f309cba455d0a946e935f66a53561ba64717faf [^]

To fix this bug I think and addition to
cmCTestCoverageCommand::InitializeHandler()
needs to be made:
this->CTest->SetCTestConfigurationFromCMakeVariable(this->Makefile, "CoverageExtraFlags", 
"CTEST_COVERAGE_EXTRA_FLAGS");
No tags attached.
Issue History
2013-04-04 10:54Andreas LangsNew Issue
2016-06-10 14:28Kitware RobotNote Added: 0042262
2016-06-10 14:28Kitware RobotStatusnew => resolved
2016-06-10 14:28Kitware RobotResolutionopen => moved
2016-06-10 14:28Kitware RobotAssigned To => Kitware Robot
2016-06-10 14:31Kitware RobotStatusresolved => closed

Notes
(0042262)
Kitware Robot   
2016-06-10 14:28   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.