summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Cedilnik <andy.cedilnik@kitware.com>2003-12-08 16:23:46 (GMT)
committerAndy Cedilnik <andy.cedilnik@kitware.com>2003-12-08 16:23:46 (GMT)
commit403f220d25b99ccdf0ceef87ef5f669a047d31cd (patch)
tree1194f44be97cb7c412a8f807e3525d13584b3d40
parentb777b8656e2ea28a165c22a3c1f7a1a1dd1b11a7 (diff)
downloadCMake-403f220d25b99ccdf0ceef87ef5f669a047d31cd.zip
CMake-403f220d25b99ccdf0ceef87ef5f669a047d31cd.tar.gz
CMake-403f220d25b99ccdf0ceef87ef5f669a047d31cd.tar.bz2
ENH: Improve coverage on systems with multiple gcov commands
-rw-r--r--Modules/Dart.cmake2
-rw-r--r--Modules/DartConfiguration.tcl.in1
-rw-r--r--Source/cmCTest.cxx17
3 files changed, 16 insertions, 4 deletions
diff --git a/Modules/Dart.cmake b/Modules/Dart.cmake
index 70b5ef6..cfe6fdb 100644
--- a/Modules/Dart.cmake
+++ b/Modules/Dart.cmake
@@ -74,6 +74,7 @@ IF(BUILD_TESTING)
DOC "Path to Rational purify command, used for memory error detection."
)
FIND_PROGRAM(SCPCOMMAND scp DOC "Path to scp command, used by some Dart clients for submitting results to a Dart server (when not using ftp for submissions)")
+ FIND_PROGRAM(COVERAGE_COMMAND gcov DOC "Path to the coverage program that Dart client uses for performing coverage inspection")
# find a tcl shell command
INCLUDE(${CMAKE_ROOT}/Modules/FindTclsh.cmake)
@@ -121,6 +122,7 @@ IF(BUILD_TESTING)
CVS_UPDATE_OPTIONS
DART_TESTING_TIMEOUT
SCPCOMMAND
+ COVERAGE_COMMAND
DELIVER_CONTINUOUS_EMAIL
)
# BUILDNAME
diff --git a/Modules/DartConfiguration.tcl.in b/Modules/DartConfiguration.tcl.in
index bed63d1..aaed45a 100644
--- a/Modules/DartConfiguration.tcl.in
+++ b/Modules/DartConfiguration.tcl.in
@@ -40,6 +40,7 @@ ScpCommand: @SCPCOMMAND@
PurifyCommand: @PURIFYCOMMAND@
ValgrindCommand: @VALGRIND_COMMAND@
ValgrindCommandOptions: @VALGRIND_COMMAND_OPTIONS@
+CoverageCommand: @COVERAGE_COMMAND@
# Compression commands
GunzipCommand: @GUNZIPCOMMAND@
CompressionCommand: @COMPRESSIONCOMMAND@
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx
index 3992ca0..31fa566 100644
--- a/Source/cmCTest.cxx
+++ b/Source/cmCTest.cxx
@@ -1143,7 +1143,14 @@ int cmCTest::CoverageDirectory()
std::string sourceDirectory = m_DartConfiguration["SourceDirectory"];
if ( sourceDirectory.size() == 0 )
{
- std::cerr << "Cannot find SourceDirectory key in the DartConfiguration.tcl" << std::endl;
+ std::cerr << "Cannot find SourceDirectory key in the DartConfiguration.tcl" << std::endl;
+ return 1;
+ }
+
+ std::string coverageCommand = m_DartConfiguration["CoverageCommand"];
+ if ( coverageCommand.size() == 0 )
+ {
+ std::cerr << "Coverage command not defined in DartConfiguration.tcl" << std::endl;
return 1;
}
cdirs.push_back(sourceDirectory);
@@ -1237,10 +1244,10 @@ int cmCTest::CoverageDirectory()
std::string opath = m_ToplevelPath + "/Testing/Temporary/Coverage";
cmSystemTools::MakeDirectory(opath.c_str());
-
+
for ( cc = 0; cc < files.size(); cc ++ )
{
- std::string command = "gcov -l \"" + files[cc] + "\"";
+ std::string command = coverageCommand + " -l \"" + files[cc] + "\"";
std::string output;
int retVal = 0;
//std::cout << "Run gcov on " << files[cc] << std::flush;
@@ -1258,7 +1265,9 @@ int cmCTest::CoverageDirectory()
}
else
{
- //std::cout << " - fail" << std::endl;
+ std::cout << "Run gcov on " << files[cc] << std::flush;
+ std::cout << " [" << command << "]" << std::endl;
+ std::cout << " - fail" << std::endl;
}
}