diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2008-12-19 02:57:42 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2008-12-19 02:57:42 (GMT) |
commit | 5b1139caea7d732c19c584acad2a24669cdb7171 (patch) | |
tree | 1da31804a741216c3dbaa5ef61306b80973b46f5 /Source/CTest/cmCTestScriptHandler.cxx | |
parent | 46feb1302c50d9031d25fc865d34c17e5e88c66f (diff) | |
download | CMake-5b1139caea7d732c19c584acad2a24669cdb7171.zip CMake-5b1139caea7d732c19c584acad2a24669cdb7171.tar.gz CMake-5b1139caea7d732c19c584acad2a24669cdb7171.tar.bz2 |
BUG: fix for bug #8224 fix crash
Diffstat (limited to 'Source/CTest/cmCTestScriptHandler.cxx')
-rw-r--r-- | Source/CTest/cmCTestScriptHandler.cxx | 38 |
1 files changed, 36 insertions, 2 deletions
diff --git a/Source/CTest/cmCTestScriptHandler.cxx b/Source/CTest/cmCTestScriptHandler.cxx index db54c92..ef8e924 100644 --- a/Source/CTest/cmCTestScriptHandler.cxx +++ b/Source/CTest/cmCTestScriptHandler.cxx @@ -274,13 +274,47 @@ int cmCTestScriptHandler::ExecuteScript(const std::string& total_script_arg) int result = cmsysProcess_GetState(cp); int retVal = 0; + bool failed = false; if(result == cmsysProcess_State_Exited) { retVal = cmsysProcess_GetExitValue(cp); } - else + else if(result == cmsysProcess_State_Exception) + { + retVal = cmsysProcess_GetExitException(cp); + cmCTestLog(this->CTest, ERROR_MESSAGE, "\tThere was an exception: " + << cmsysProcess_GetExceptionString(cp) << " " << + retVal << std::endl); + failed = true; + } + else if(result == cmsysProcess_State_Expired) { - abort(); + cmCTestLog(this->CTest, ERROR_MESSAGE, "\tThere was a timeout" + << std::endl); + failed = true; + } + else if(result == cmsysProcess_State_Error) + { + cmCTestLog(this->CTest, ERROR_MESSAGE, "\tError executing ctest: " + << cmsysProcess_GetErrorString(cp) << std::endl); + failed = true; + } + if(failed) + { + cmOStringStream message; + message << "Error running command: ["; + message << result << "] "; + for(std::vector<const char*>::iterator i = argv.begin(); + i != argv.end(); ++i) + { + if(*i) + { + message << *i << " "; + } + } + cmCTestLog(this->CTest, ERROR_MESSAGE, + message.str() << argv[0] << std::endl); + return -1; } return retVal; } |