diff options
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; } |