[cmake-developers] [CMake 0014061]: COVERAGE_EXTRA_FLAGS not respected when coverage is run from ctest script

Mantis Bug Tracker mantis at public.kitware.com
Thu Apr 4 10:54:36 EDT 2013


The following issue has been SUBMITTED. 
====================================================================== 
http://public.kitware.com/Bug/view.php?id=14061 
====================================================================== 
Reported By:                Andreas Langs
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   14061
Category:                   CTest
Reproducibility:            always
Severity:                   major
Priority:                   high
Status:                     new
====================================================================== 
Date Submitted:             2013-04-04 16:54 CEST
Last Modified:              2013-04-04 16:54 CEST
====================================================================== 
Summary:                    COVERAGE_EXTRA_FLAGS not respected when coverage is
run from ctest script
Description: 
I configure my project with <pre>-DCOVERAGE_EXTRA_FLAGS:STRING="-l -p"</pre>.
Now if I run the coverage with <pre>ctest -D ExperimentalCoverage -VV</pre> I
can see that the arguments "-l -p" are passed to the gcov executable.
If I invoke the coverage with the <pre>ctest_coverage()</pre> command in a ctest
script which I run with <pre>ctest -S script.cmake -VV</pre> I see that the
arguments are not passed to gcov, even the default argument -l is not passed.


Additional Information: 
Running both described variants with the --debug option I see that when running
without the script the function <pre>cmCTest::UpdateCTestConfiguration()</pre>
is called and all values from DartConfiguration.tcl are read.
Running with the script the function
<pre>cmCTest::UpdateCTestConfiguration()</pre> is left early and the values from
DartConfiguration.tcl are not read, in this case especially CoverageExtraFlags
which holds the gcov arguments.

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

To fix this bug I think and addition to
<pre>cmCTestCoverageCommand::InitializeHandler()</pre> needs to be made:
<pre>this->CTest->SetCTestConfigurationFromCMakeVariable(this->Makefile,
"CoverageExtraFlags", "CTEST_COVERAGE_EXTRA_FLAGS");</pre>
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2013-04-04 16:54 Andreas Langs  New Issue                                    
======================================================================




More information about the cmake-developers mailing list