Merge topic 'ctest-subprocess'
cb5f136c66
ctest: Prevent infinite loop in ctest_run_script(NEW_PROCESS)
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10286
This commit is contained in:
commit
bc093eefab
@ -97,7 +97,12 @@ int cmCTestScriptHandler::ExecuteScript(std::string const& total_script_arg)
|
||||
this->CTest->GetInitialCommandLineArguments();
|
||||
//*** need to make sure this does not have the current script ***
|
||||
for (size_t i = 1; i < initArgs.size(); ++i) {
|
||||
argv.push_back(initArgs[i]);
|
||||
// in a nested subprocess, skip the parent's `-SR <path>` arguments.
|
||||
if (initArgs[i] == "-SR") {
|
||||
i++; // <path>
|
||||
} else {
|
||||
argv.push_back(initArgs[i]);
|
||||
}
|
||||
}
|
||||
|
||||
// Now create process object
|
||||
|
@ -1975,9 +1975,12 @@ int cmCTest::Run(std::vector<std::string> const& args)
|
||||
};
|
||||
auto const dashSR =
|
||||
[&runScripts, &SRArgumentSpecified](std::string const& script) -> bool {
|
||||
SRArgumentSpecified = true;
|
||||
runScripts.emplace_back(cmSystemTools::ToNormalizedPathOnDisk(script),
|
||||
true);
|
||||
// -SR should be processed only once
|
||||
if (!SRArgumentSpecified) {
|
||||
SRArgumentSpecified = true;
|
||||
runScripts.emplace_back(cmSystemTools::ToNormalizedPathOnDisk(script),
|
||||
true);
|
||||
}
|
||||
return true;
|
||||
};
|
||||
auto const dash_S =
|
||||
|
Loading…
Reference in New Issue
Block a user