[Cmake-commits] CMake branch, next, updated. v3.4.0-1473-g328b26f
Brad King
brad.king at kitware.com
Mon Nov 23 12:42:14 EST 2015
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".
The branch, next has been updated
via 328b26f818b568d42d5fb1bc1e7e6cdf2eeca178 (commit)
via 32268810d9f1cf40d20bfb287be30db582696043 (commit)
from 5d24c399b564cb73442e33471fdbcd2e1a390bc6 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=328b26f818b568d42d5fb1bc1e7e6cdf2eeca178
commit 328b26f818b568d42d5fb1bc1e7e6cdf2eeca178
Merge: 5d24c39 3226881
Author: Brad King <brad.king at kitware.com>
AuthorDate: Mon Nov 23 12:42:14 2015 -0500
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Mon Nov 23 12:42:14 2015 -0500
Merge topic 'expand_cobertura_search' into next
32268810 CTest: Expand directories for Cobertura search
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=32268810d9f1cf40d20bfb287be30db582696043
commit 32268810d9f1cf40d20bfb287be30db582696043
Author: Joseph Snyder <joe.snyder at kitware.com>
AuthorDate: Mon Nov 16 16:27:57 2015 -0500
Commit: Brad King <brad.king at kitware.com>
CommitDate: Mon Nov 23 12:41:36 2015 -0500
CTest: Expand directories for Cobertura search
Change the Cobertura handler to look for an environment variable
called "COBERTURADIR" which contains the directory where the
coverage.xml file is found. If that variable doesn't exist,
continue to use the default of the binary directory.
Update the test to use an appropriate value in the environment
variables.
diff --git a/Source/CTest/cmCTestCoverageHandler.cxx b/Source/CTest/cmCTestCoverageHandler.cxx
index 6027502..2c2cd48 100644
--- a/Source/CTest/cmCTestCoverageHandler.cxx
+++ b/Source/CTest/cmCTestCoverageHandler.cxx
@@ -820,11 +820,26 @@ int cmCTestCoverageHandler::HandleCoberturaCoverage(
{
cmParseCoberturaCoverage cov(*cont, this->CTest);
- // Assume the coverage.xml is in the source directory
- std::string coverageXMLFile = this->CTest->GetBinaryDir() + "/coverage.xml";
+ // Assume the coverage.xml is in the binary directory
+ // check for the COBERTURADIR environment variable,
+ // if it doesn't exist or is empty, assume the
+ // binary directory is used.
+ std::string coverageXMLFile;
+ const char* covDir = cmSystemTools::GetEnv("COBERTURADIR");
+ if(covDir && strlen(covDir) != 0)
+ {
+ coverageXMLFile = std::string(covDir);
+ }
+ else
+ {
+ coverageXMLFile = this->CTest->GetBinaryDir();
+ }
+ // build the find file string with the directory from above
+ coverageXMLFile += "/coverage.xml";
if(cmSystemTools::FileExists(coverageXMLFile.c_str()))
{
+ // If file exists, parse it
cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
"Parsing Cobertura XML file: " << coverageXMLFile
<< std::endl, this->Quiet);
@@ -833,7 +848,7 @@ int cmCTestCoverageHandler::HandleCoberturaCoverage(
else
{
cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
- "Cannot find Cobertura XML file: " << coverageXMLFile
+ " Cannot find Cobertura XML file: " << coverageXMLFile
<< std::endl, this->Quiet);
}
return static_cast<int>(cont->TotalCoverage.size());
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index f381758..dd766ae 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -2544,6 +2544,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
set_tests_properties(CTestCoberturaCoverage PROPERTIES
PASS_REGULAR_EXPRESSION
"Process file.*CoverageTest.java.*Total LOC:.*18.*Percentage Coverage: 72.22.*"
+ ENVIRONMENT COBERTURADIR=${CMake_BINARY_DIR}/Testing/CoberturaCoverage
ENVIRONMENT COVFILE=)
-----------------------------------------------------------------------
Summary of changes:
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list