diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2009-09-04 17:24:25 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2009-09-04 17:24:25 (GMT) |
commit | 7d190a65ca3fb717e4889de7604ac8ef3484c593 (patch) | |
tree | 6a372a8684754102c510bb5d59ae3f63d11c84f0 /Source/CTest/cmCTestRunScriptCommand.cxx | |
parent | 368a18b83c1a0885f477b4911d3f5224b4fd534e (diff) | |
download | CMake-7d190a65ca3fb717e4889de7604ac8ef3484c593.zip CMake-7d190a65ca3fb717e4889de7604ac8ef3484c593.tar.gz CMake-7d190a65ca3fb717e4889de7604ac8ef3484c593.tar.bz2 |
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/cmCTestRunScriptCommand.cxx')
-rw-r--r-- | Source/CTest/cmCTestRunScriptCommand.cxx | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/Source/CTest/cmCTestRunScriptCommand.cxx b/Source/CTest/cmCTestRunScriptCommand.cxx index e01994d..53ca8ef 100644 --- a/Source/CTest/cmCTestRunScriptCommand.cxx +++ b/Source/CTest/cmCTestRunScriptCommand.cxx @@ -34,10 +34,35 @@ bool cmCTestRunScriptCommand np = true; i++; } + int start = i; // run each script - for (; i < args.size(); ++i) + std::string returnVariable; + for (i = start; i < args.size(); ++i) { - cmCTestScriptHandler::RunScript(this->CTest, args[i].c_str(), !np); + if(args[i] == "RETURN_VALUE") + { + ++i; + if(i < args.size()) + { + returnVariable = args[i]; + } + } + } + for (i = start; i < args.size(); ++i) + { + if(args[i] == "RETURN_VALUE") + { + ++i; + } + else + { + int ret; + cmCTestScriptHandler::RunScript(this->CTest, args[i].c_str(), !np, + &ret); + cmOStringStream str; + str << ret; + this->Makefile->AddDefinition(returnVariable.c_str(), str.str().c_str()); + } } return true; } |