diff options
author | Ken Martin <ken.martin@kitware.com> | 2006-04-04 17:04:28 (GMT) |
---|---|---|
committer | Ken Martin <ken.martin@kitware.com> | 2006-04-04 17:04:28 (GMT) |
commit | d81ebf0c23307162dfc5c4a3c978ad9360bee354 (patch) | |
tree | 615b1ec7ff9d411e5d9cffa5c90d3f40641fd446 /Source/cmCTest.cxx | |
parent | b45f4a5d450c4fd56fd564fe67be00c7aeb4b59a (diff) | |
download | CMake-d81ebf0c23307162dfc5c4a3c978ad9360bee354.zip CMake-d81ebf0c23307162dfc5c4a3c978ad9360bee354.tar.gz CMake-d81ebf0c23307162dfc5c4a3c978ad9360bee354.tar.bz2 |
ENH: added support for -SP scripts in new processes
Diffstat (limited to 'Source/cmCTest.cxx')
-rw-r--r-- | Source/cmCTest.cxx | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index f84430c..c5ad1f4 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -1302,6 +1302,13 @@ int cmCTest::Run(std::vector<std::string>const& args, std::string* output) const char* ctestExec = "ctest"; bool cmakeAndTest = false; bool performSomeTest = true; + bool SRArgumentSpecified = false; + + // copy the command line + for(size_t i=0; i < args.size(); ++i) + { + this->InitialCommandLineArguments.push_back(args[i]); + } for(size_t i=1; i < args.size(); ++i) { std::string arg = args[i]; @@ -1347,13 +1354,40 @@ int cmCTest::Run(std::vector<std::string>const& args, std::string* output) this->ShowOnly = true; } + if(this->CheckArgument(arg, "-SP", "--script-new-process") && i < args.size() - 1 ) + { + this->RunConfigurationScript = true; + i++; + cmCTestScriptHandler* ch + = static_cast<cmCTestScriptHandler*>(this->GetHandler("script")); + // -SR is an internal argument, -SP should be ignored when it is passed + if (!SRArgumentSpecified) + { + ch->AddConfigurationScript(args[i].c_str(),false); + } + } + + if(this->CheckArgument(arg, "-SR", "--script-run") && i < args.size() - 1 ) + { + SRArgumentSpecified = true; + this->RunConfigurationScript = true; + i++; + cmCTestScriptHandler* ch + = static_cast<cmCTestScriptHandler*>(this->GetHandler("script")); + ch->AddConfigurationScript(args[i].c_str(),true); + } + if(this->CheckArgument(arg, "-S", "--script") && i < args.size() - 1 ) { this->RunConfigurationScript = true; i++; cmCTestScriptHandler* ch = static_cast<cmCTestScriptHandler*>(this->GetHandler("script")); - ch->AddConfigurationScript(args[i].c_str()); + // -SR is an internal argument, -S should be ignored when it is passed + if (!SRArgumentSpecified) + { + ch->AddConfigurationScript(args[i].c_str(),true); + } } if(this->CheckArgument(arg, "-O", "--output-log") && i < args.size() - 1 ) |