summaryrefslogtreecommitdiff
path: root/Source/CTest/cmCTestScriptHandler.cxx
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2009-09-04 13:24:25 -0400
committerBill Hoffman <bill.hoffman@kitware.com>2009-09-04 13:24:25 -0400
commit7d190a65ca3fb717e4889de7604ac8ef3484c593 (patch)
tree6a372a8684754102c510bb5d59ae3f63d11c84f0 /Source/CTest/cmCTestScriptHandler.cxx
parent368a18b83c1a0885f477b4911d3f5224b4fd534e (diff)
downloadcmake-7d190a65ca3fb717e4889de7604ac8ef3484c593.tar.gz
Change run_ctest_script in ctest to not stop processing when there is an error in the script being run. Also, add a RETURN_VALUE option so that you can find out if the script failed
Diffstat (limited to 'Source/CTest/cmCTestScriptHandler.cxx')
-rw-r--r--Source/CTest/cmCTestScriptHandler.cxx12
1 files changed, 10 insertions, 2 deletions
diff --git a/Source/CTest/cmCTestScriptHandler.cxx b/Source/CTest/cmCTestScriptHandler.cxx
index 0890fd16a4..0c292e5f9a 100644
--- a/Source/CTest/cmCTestScriptHandler.cxx
+++ b/Source/CTest/cmCTestScriptHandler.cxx
@@ -445,6 +445,10 @@ int cmCTestScriptHandler::ReadInScript(const std::string& total_script_arg)
cmCTestLog(this->CTest, ERROR_MESSAGE, "Error in read script: "
<< script.c_str()
<< std::endl);
+ // Reset the error flag so that it can run more than
+ // one script with an error when you
+ // use ctest_run_script
+ cmSystemTools::ResetErrorOccuredFlag();
return 2;
}
@@ -1030,12 +1034,16 @@ void cmCTestScriptHandler::RestoreBackupDirectories()
}
bool cmCTestScriptHandler::RunScript(cmCTest* ctest, const char *sname,
- bool InProcess)
+ bool InProcess, int* returnValue)
{
cmCTestScriptHandler* sh = new cmCTestScriptHandler();
sh->SetCTestInstance(ctest);
sh->AddConfigurationScript(sname,InProcess);
- sh->ProcessHandler();
+ int res = sh->ProcessHandler();
+ if(returnValue)
+ {
+ *returnValue = res;
+ }
delete sh;
return true;
}