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