[Cmake-commits] CMake branch, next, updated. v3.3.0-2103-g9b72aec
James Johnston
johnstonj.public at codenest.com
Sat Aug 8 01:27:55 EDT 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 9b72aec7b3624b6bb8e409e52a29263591856f81 (commit)
via 203b20df98512094cc74061fd1b76e87bd2d3afb (commit)
via b28b07db47b181718643399bd2aedc3e6d1b29c4 (commit)
from fef2009bd53ee5089d51ff253d603097a9dfebab (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 -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9b72aec7b3624b6bb8e409e52a29263591856f81
commit 9b72aec7b3624b6bb8e409e52a29263591856f81
Merge: fef2009 203b20d
Author: James Johnston <johnstonj.public at codenest.com>
AuthorDate: Sat Aug 8 01:27:54 2015 -0400
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Sat Aug 8 01:27:54 2015 -0400
Merge topic 'fix-process-error-handling' into next
203b20df cmcmd: Improve error handling when executing a process.
b28b07db cmCTestCoverageHandle: Improve error handling.
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=203b20df98512094cc74061fd1b76e87bd2d3afb
commit 203b20df98512094cc74061fd1b76e87bd2d3afb
Author: James Johnston <johnstonj.public at codenest.com>
AuthorDate: Sat Aug 8 01:06:27 2015 -0400
Commit: James Johnston <johnstonj.public at codenest.com>
CommitDate: Sat Aug 8 01:06:27 2015 -0400
cmcmd: Improve error handling when executing a process.
diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx
index 71f47f3..7bee0ea 100644
--- a/Source/cmcmd.cxx
+++ b/Source/cmcmd.cxx
@@ -1468,18 +1468,24 @@ bool cmcmd::RunCommand(const char* comment,
std::string output;
int retCode =0;
// use rc command to create .res file
- cmSystemTools::RunSingleCommand(command,
- &output, &output,
- &retCode, 0, cmSystemTools::OUTPUT_NONE);
+ bool res = cmSystemTools::RunSingleCommand(command,
+ &output, &output,
+ &retCode, 0,
+ cmSystemTools::OUTPUT_NONE);
// always print the output of the command, unless
// it is the dumb rc command banner, but if the command
// returned an error code then print the output anyway as
// the banner may be mixed with some other important information.
if(output.find("Resource Compiler Version") == output.npos
- || retCode !=0)
+ || !res || retCode)
{
std::cout << output;
}
+ if (!res)
+ {
+ std::cout << comment << " failed to run." << std::endl;
+ return false;
+ }
// if retCodeOut is requested then always return true
// and set the retCodeOut to retCode
if(retCodeOut)
@@ -1593,7 +1599,10 @@ int cmcmd::VisualStudioLinkIncremental(std::vector<std::string>& args,
mtCommand.push_back(tempManifest);
// now run mt.exe to create the final manifest file
int mtRet =0;
- cmcmd::RunCommand("MT", mtCommand, verbose, &mtRet);
+ if(!cmcmd::RunCommand("MT", mtCommand, verbose, &mtRet))
+ {
+ return -1;
+ }
// if mt returns 0, then the manifest was not changed and
// we do not need to do another link step
if(mtRet == 0)
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b28b07db47b181718643399bd2aedc3e6d1b29c4
commit b28b07db47b181718643399bd2aedc3e6d1b29c4
Author: James Johnston <johnstonj.public at codenest.com>
AuthorDate: Sat Aug 8 00:28:38 2015 -0400
Commit: James Johnston <johnstonj.public at codenest.com>
CommitDate: Sat Aug 8 00:28:38 2015 -0400
cmCTestCoverageHandle: Improve error handling.
diff --git a/Source/CTest/cmCTestCoverageHandler.cxx b/Source/CTest/cmCTestCoverageHandler.cxx
index 6369e17..65599e0 100644
--- a/Source/CTest/cmCTestCoverageHandler.cxx
+++ b/Source/CTest/cmCTestCoverageHandler.cxx
@@ -1474,7 +1474,12 @@ int cmCTestCoverageHandler::HandleLCovCoverage(
<< std::endl, this->Quiet);
std::vector<std::string> files;
- this->FindLCovFiles(files);
+ if (!this->FindLCovFiles(files))
+ {
+ cmCTestLog(this->CTest, ERROR_MESSAGE,
+ "Error while finding LCov files.\n");
+ return 0;
+ }
std::vector<std::string>::iterator it;
if (files.empty())
@@ -1745,18 +1750,28 @@ void cmCTestCoverageHandler::FindGCovFiles(std::vector<std::string>& files)
}
//----------------------------------------------------------------------------
-void cmCTestCoverageHandler::FindLCovFiles(std::vector<std::string>& files)
+bool cmCTestCoverageHandler::FindLCovFiles(std::vector<std::string>& files)
{
cmsys::Glob gl;
gl.RecurseOff(); // No need of recurse if -prof_dir${BUILD_DIR} flag is
// used while compiling.
gl.RecurseThroughSymlinksOff();
std::string prevBinaryDir;
- cmSystemTools::ChangeDirectory(
- this->CTest->GetCTestConfiguration("BuildDirectory"));
+ std::string buildDir = this->CTest->GetCTestConfiguration("BuildDirectory");
+ if (cmSystemTools::ChangeDirectory(buildDir))
+ {
+ cmCTestLog(this->CTest, ERROR_MESSAGE,
+ "Error changing directory to " << buildDir << std::endl);
+ return false;
+ }
// Run profmerge to merge all *.dyn files into dpi files
- cmSystemTools::RunSingleCommand("profmerge");
+ if (!cmSystemTools::RunSingleCommand("profmerge"))
+ {
+ cmCTestLog(this->CTest, ERROR_MESSAGE,
+ "Error while running profmerge.\n");
+ return false;
+ }
prevBinaryDir = cmSystemTools::GetCurrentWorkingDirectory().c_str();
@@ -1766,10 +1781,16 @@ void cmCTestCoverageHandler::FindLCovFiles(std::vector<std::string>& files)
daGlob += "/*.dpi";
cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
" looking for dpi files in: " << daGlob << std::endl, this->Quiet);
- gl.FindFiles(daGlob);
+ if (!gl.FindFiles(daGlob))
+ {
+ cmCTestLog(this->CTest, ERROR_MESSAGE,
+ "Error while finding files matching " << daGlob << std::endl);
+ return false;
+ }
files.insert(files.end(), gl.GetFiles().begin(), gl.GetFiles().end());
cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
"Now searching in: " << daGlob << std::endl, this->Quiet);
+ return true;
}
//----------------------------------------------------------------------
diff --git a/Source/CTest/cmCTestCoverageHandler.h b/Source/CTest/cmCTestCoverageHandler.h
index 2ca123a..7102d1e 100644
--- a/Source/CTest/cmCTestCoverageHandler.h
+++ b/Source/CTest/cmCTestCoverageHandler.h
@@ -75,7 +75,7 @@ private:
//! Handle coverage using Intel's LCov
int HandleLCovCoverage(cmCTestCoverageHandlerContainer* cont);
- void FindLCovFiles(std::vector<std::string>& files);
+ bool FindLCovFiles(std::vector<std::string>& files);
//! Handle coverage using xdebug php coverage
int HandlePHPCoverage(cmCTestCoverageHandlerContainer* cont);
-----------------------------------------------------------------------
Summary of changes:
Source/CTest/cmCTestCoverageHandler.cxx | 33 +++++++++++++++++++++++++------
Source/CTest/cmCTestCoverageHandler.h | 2 +-
Source/cmcmd.cxx | 19 +++++++++++++-----
3 files changed, 42 insertions(+), 12 deletions(-)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list