Commit 403f220d authored by Andy Cedilnik's avatar Andy Cedilnik
Browse files

ENH: Improve coverage on systems with multiple gcov commands

parent b777b865
......@@ -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
......
......@@ -40,6 +40,7 @@ ScpCommand: @SCPCOMMAND@
PurifyCommand: @PURIFYCOMMAND@
ValgrindCommand: @VALGRIND_COMMAND@
ValgrindCommandOptions: @VALGRIND_COMMAND_OPTIONS@
CoverageCommand: @COVERAGE_COMMAND@
# Compression commands
GunzipCommand: @GUNZIPCOMMAND@
CompressionCommand: @COMPRESSIONCOMMAND@
......
......@@ -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;
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment