cmCTestScriptHandler: De-duplicate WaitForLine call

This commit is contained in:
Brad King
2025-11-24 20:47:10 -05:00
parent 6f5bbf9ee7
commit 5f54ad41e7

View File

@@ -117,9 +117,10 @@ int cmCTestScriptHandler::ExecuteScript(std::string const& total_script_arg)
std::vector<char> out;
std::vector<char> err;
std::string line;
auto pipe = cmSystemTools::WaitForLine(&process.GetLoop(), outPipe, errPipe,
line, out, err);
while (pipe != cmSystemTools::WaitForLineResult::None) {
cmSystemTools::WaitForLineResult pipe;
while ((pipe = cmSystemTools::WaitForLine(&process.GetLoop(), outPipe,
errPipe, line, out, err)) !=
cmSystemTools::WaitForLineResult::None) {
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
"Output: " << line << "\n");
if (pipe == cmSystemTools::WaitForLineResult::STDERR) {
@@ -127,8 +128,6 @@ int cmCTestScriptHandler::ExecuteScript(std::string const& total_script_arg)
} else if (pipe == cmSystemTools::WaitForLineResult::STDOUT) {
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, line << "\n");
}
pipe = cmSystemTools::WaitForLine(&process.GetLoop(), outPipe, errPipe,
line, out, err);
}
// Properly handle output of the build command