summaryrefslogtreecommitdiffstats
path: root/Source/CTest/cmCTestHandlerCommand.cxx
diff options
context:
space:
mode:
authorCraig Scott <craig.scott@crascit.com>2018-03-04 06:27:09 (GMT)
committerCraig Scott <craig.scott@crascit.com>2018-03-08 09:07:14 (GMT)
commite60e4dfc88252aaec53f0d832508d41dff6165fd (patch)
tree5903e9e8f2eb57780d47a21d83f282f9cee11741 /Source/CTest/cmCTestHandlerCommand.cxx
parente654622aee22655c418a9c663fad79243ca0c819 (diff)
downloadCMake-e60e4dfc88252aaec53f0d832508d41dff6165fd.zip
CMake-e60e4dfc88252aaec53f0d832508d41dff6165fd.tar.gz
CMake-e60e4dfc88252aaec53f0d832508d41dff6165fd.tar.bz2
cmWorkingDirectory: Check success of current dir changes
Diffstat (limited to 'Source/CTest/cmCTestHandlerCommand.cxx')
-rw-r--r--Source/CTest/cmCTestHandlerCommand.cxx16
1 files changed, 16 insertions, 0 deletions
diff --git a/Source/CTest/cmCTestHandlerCommand.cxx b/Source/CTest/cmCTestHandlerCommand.cxx
index 5a7baf5..1fff2fa 100644
--- a/Source/CTest/cmCTestHandlerCommand.cxx
+++ b/Source/CTest/cmCTestHandlerCommand.cxx
@@ -9,6 +9,7 @@
#include "cmWorkingDirectory.h"
#include "cmake.h"
+#include <cstring>
#include <sstream>
#include <stdlib.h>
@@ -218,6 +219,21 @@ bool cmCTestHandlerCommand::InitialPass(std::vector<std::string> const& args,
}
cmWorkingDirectory workdir(
this->CTest->GetCTestConfiguration("BuildDirectory"));
+ if (workdir.Failed()) {
+ this->SetError("failed to change directory to " +
+ this->CTest->GetCTestConfiguration("BuildDirectory") +
+ " : " + std::strerror(workdir.GetLastResult()));
+ if (capureCMakeError) {
+ this->Makefile->AddDefinition(this->Values[ct_CAPTURE_CMAKE_ERROR],
+ "-1");
+ cmCTestLog(this->CTest, ERROR_MESSAGE, this->GetName()
+ << " " << this->GetError() << "\n");
+ // return success because failure is recorded in CAPTURE_CMAKE_ERROR
+ return true;
+ }
+ return false;
+ }
+
int res = handler->ProcessHandler();
if (this->Values[ct_RETURN_VALUE] && *this->Values[ct_RETURN_VALUE]) {
std::ostringstream str;