From b8f14c6c4de6942b528a6c96806641a9190e521a Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 16 Oct 2024 11:31:05 -0400 Subject: [PATCH 1/6] cmGlobalGenerator: Remove default Build method output mode Clarify call sites by passing the output mode explicitly. --- Source/CTest/cmCTestBuildAndTest.cxx | 2 +- Source/cmGlobalGenerator.cxx | 6 +++--- Source/cmGlobalGenerator.h | 17 ++++++++--------- 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/Source/CTest/cmCTestBuildAndTest.cxx b/Source/CTest/cmCTestBuildAndTest.cxx index 0fc3946afa..1ccdad216b 100644 --- a/Source/CTest/cmCTestBuildAndTest.cxx +++ b/Source/CTest/cmCTestBuildAndTest.cxx @@ -293,7 +293,7 @@ int cmCTestBuildAndTest::Run() int retVal = cm.GetGlobalGenerator()->Build( cmake::NO_BUILD_PARALLEL_LEVEL, this->SourceDir, this->BinaryDir, this->BuildProject, { tar }, out, this->BuildMakeProgram, config, - buildOptions, false, remainingTime); + buildOptions, false, remainingTime, cmSystemTools::OUTPUT_NONE); // if the build failed then return if (retVal) { this->Output = out.str(); diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 0ad1c78d8c..0ddef6edbd 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -2212,9 +2212,9 @@ int cmGlobalGenerator::TryCompile(int jobs, const std::string& srcdir, cmBuildOptions defaultBuildOptions(false, fast, PackageResolveMode::Disable); std::stringstream ostr; - auto ret = - this->Build(jobs, srcdir, bindir, projectName, newTarget, ostr, "", config, - defaultBuildOptions, true, this->TryCompileTimeout); + auto ret = this->Build(jobs, srcdir, bindir, projectName, newTarget, ostr, + "", config, defaultBuildOptions, true, + this->TryCompileTimeout, cmSystemTools::OUTPUT_NONE); output = ostr.str(); return ret; } diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h index a865adbe38..c13045b1a7 100644 --- a/Source/cmGlobalGenerator.h +++ b/Source/cmGlobalGenerator.h @@ -248,15 +248,14 @@ public: * empty then all is assumed. clean indicates if a "make clean" should be * done first. */ - int Build( - int jobs, const std::string& srcdir, const std::string& bindir, - const std::string& projectName, - std::vector const& targetNames, std::ostream& ostr, - const std::string& makeProgram, const std::string& config, - const cmBuildOptions& buildOptions, bool verbose, cmDuration timeout, - cmSystemTools::OutputOption outputflag = cmSystemTools::OUTPUT_NONE, - std::vector const& nativeOptions = - std::vector()); + int Build(int jobs, const std::string& srcdir, const std::string& bindir, + const std::string& projectName, + std::vector const& targetNames, std::ostream& ostr, + const std::string& makeProgram, const std::string& config, + const cmBuildOptions& buildOptions, bool verbose, + cmDuration timeout, cmSystemTools::OutputOption outputflag, + std::vector const& nativeOptions = + std::vector()); /** * Open a generated IDE project given the following information. From 14e17a83be3cf7693b341c6b8a3f6081e514311f Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 16 Oct 2024 11:48:40 -0400 Subject: [PATCH 2/6] cmGlobalGenerator: Clarify Build method output mode argument name --- Source/cmGlobalGenerator.cxx | 10 +++++----- Source/cmGlobalGenerator.h | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 0ddef6edbd..30a0e21d92 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -2243,7 +2243,7 @@ int cmGlobalGenerator::Build( const std::string& projectName, const std::vector& targets, std::ostream& ostr, const std::string& makeCommandCSTR, const std::string& config, const cmBuildOptions& buildOptions, bool verbose, - cmDuration timeout, cmSystemTools::OutputOption outputflag, + cmDuration timeout, cmSystemTools::OutputOption outputMode, std::vector const& nativeOptions) { bool hideconsole = cmSystemTools::GetRunCommandHideConsole(); @@ -2276,9 +2276,9 @@ int cmGlobalGenerator::Build( buildOptions, nativeOptions); // Workaround to convince some commands to produce output. - if (outputflag == cmSystemTools::OUTPUT_PASSTHROUGH && + if (outputMode == cmSystemTools::OUTPUT_PASSTHROUGH && makeCommand.back().RequiresOutputForward) { - outputflag = cmSystemTools::OUTPUT_FORWARD; + outputMode = cmSystemTools::OUTPUT_FORWARD; } // should we do a clean first? @@ -2298,7 +2298,7 @@ int cmGlobalGenerator::Build( } if (!cmSystemTools::RunSingleCommand(cleanCommand.front().PrimaryCommand, outputPtr, outputPtr, &retVal, - nullptr, outputflag, timeout)) { + nullptr, outputMode, timeout)) { cmSystemTools::SetRunCommandHideConsole(hideconsole); cmSystemTools::Error("Generator: execution of make clean failed."); ostr << *outputPtr << "\nGenerator: execution of make clean failed." @@ -2330,7 +2330,7 @@ int cmGlobalGenerator::Build( ostr << outputMakeCommandStr << std::endl; if (!cmSystemTools::RunSingleCommand(command->PrimaryCommand, outputPtr, outputPtr, &retVal, nullptr, - outputflag, timeout)) { + outputMode, timeout)) { cmSystemTools::SetRunCommandHideConsole(hideconsole); cmSystemTools::Error( cmStrCat("Generator: build tool execution failed, command was: ", diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h index c13045b1a7..2a1afa82ef 100644 --- a/Source/cmGlobalGenerator.h +++ b/Source/cmGlobalGenerator.h @@ -253,7 +253,7 @@ public: std::vector const& targetNames, std::ostream& ostr, const std::string& makeProgram, const std::string& config, const cmBuildOptions& buildOptions, bool verbose, - cmDuration timeout, cmSystemTools::OutputOption outputflag, + cmDuration timeout, cmSystemTools::OutputOption outputMode, std::vector const& nativeOptions = std::vector()); From 1f0994c43764b1cc65e92b50c34d6ef80a1358a5 Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 16 Oct 2024 11:46:43 -0400 Subject: [PATCH 3/6] cmGlobalGenerator: Clarify Build method buffering of child process output --- Source/cmGlobalGenerator.cxx | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 30a0e21d92..0dc8ad79f1 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -2268,8 +2268,9 @@ int cmGlobalGenerator::Build( int retVal = 0; cmSystemTools::SetRunCommandHideConsole(true); - std::string outputBuffer; - std::string* outputPtr = &outputBuffer; + + // Capture build command output when outputMode == OUTPUT_NONE. + std::string outputBuf; std::vector makeCommand = this->GenerateBuildCommand( makeCommandCSTR, projectName, bindir, targets, realConfig, jobs, verbose, @@ -2297,16 +2298,16 @@ int cmGlobalGenerator::Build( return 1; } if (!cmSystemTools::RunSingleCommand(cleanCommand.front().PrimaryCommand, - outputPtr, outputPtr, &retVal, + &outputBuf, &outputBuf, &retVal, nullptr, outputMode, timeout)) { cmSystemTools::SetRunCommandHideConsole(hideconsole); cmSystemTools::Error("Generator: execution of make clean failed."); - ostr << *outputPtr << "\nGenerator: execution of make clean failed." + ostr << outputBuf << "\nGenerator: execution of make clean failed." << std::endl; return 1; } - ostr << *outputPtr; + ostr << outputBuf; } // now build @@ -2328,22 +2329,22 @@ int cmGlobalGenerator::Build( } ostr << outputMakeCommandStr << std::endl; - if (!cmSystemTools::RunSingleCommand(command->PrimaryCommand, outputPtr, - outputPtr, &retVal, nullptr, + if (!cmSystemTools::RunSingleCommand(command->PrimaryCommand, &outputBuf, + &outputBuf, &retVal, nullptr, outputMode, timeout)) { cmSystemTools::SetRunCommandHideConsole(hideconsole); cmSystemTools::Error( cmStrCat("Generator: build tool execution failed, command was: ", makeCommandStr)); - ostr << *outputPtr + ostr << outputBuf << "\nGenerator: build tool execution failed, command was: " << outputMakeCommandStr << std::endl; return 1; } - ostr << *outputPtr << std::flush; + ostr << outputBuf << std::flush; if (needBuildOutput) { - buildOutput += *outputPtr; + buildOutput += outputBuf; } } ostr << std::endl; From 41fce4140d2d8ee345c247897ec0470cb3ce08e1 Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 16 Oct 2024 10:00:20 -0400 Subject: [PATCH 4/6] ctest: Drop --build-and-test cmake output buffering Issue: #25790 --- Source/CTest/cmCTestBuildAndTest.cxx | 107 ++++++++++++--------------- Source/CTest/cmCTestBuildAndTest.h | 11 +-- Source/cmCTest.cxx | 4 +- 3 files changed, 48 insertions(+), 74 deletions(-) diff --git a/Source/CTest/cmCTestBuildAndTest.cxx b/Source/CTest/cmCTestBuildAndTest.cxx index 1ccdad216b..94da4e587c 100644 --- a/Source/CTest/cmCTestBuildAndTest.cxx +++ b/Source/CTest/cmCTestBuildAndTest.cxx @@ -5,6 +5,7 @@ #include #include #include +#include #include #include @@ -34,13 +35,7 @@ cmCTestBuildAndTest::cmCTestBuildAndTest(cmCTest* ctest) { } -const char* cmCTestBuildAndTest::GetOutput() -{ - return this->Output.c_str(); -} - -int cmCTestBuildAndTest::RunCMake(std::ostringstream& out, - std::string& cmakeOutString, cmake* cm) +int cmCTestBuildAndTest::RunCMake(cmake* cm) { std::vector args; args.push_back(cmSystemTools::GetCMakeCommand()); @@ -72,24 +67,21 @@ int cmCTestBuildAndTest::RunCMake(std::ostringstream& out, for (std::string const& opt : this->BuildOptions) { args.push_back(opt); } + std::cout << "======== CMake output ======\n"; if (cm->Run(args) != 0) { - out << "Error: cmake execution failed\n"; - out << cmakeOutString << "\n"; - this->Output = out.str(); + std::cout << "======== End CMake output ======\n"; + std::cout << "Error: cmake execution failed\n"; return 1; } // do another config? if (this->BuildTwoConfig) { if (cm->Run(args) != 0) { - out << "Error: cmake execution failed\n"; - out << cmakeOutString << "\n"; - this->Output = out.str(); + std::cout << "======== End CMake output ======\n"; + std::cout << "Error: cmake execution failed\n"; return 1; } } - out << "======== CMake output ======\n"; - out << cmakeOutString; - out << "======== End CMake output ======\n"; + std::cout << "======== End CMake output ======\n"; return 0; } @@ -161,22 +153,22 @@ class cmCTestBuildAndTestCaptureRAII cmake& CM; public: - cmCTestBuildAndTestCaptureRAII(cmake& cm, std::string& s) + cmCTestBuildAndTestCaptureRAII(cmake& cm) : CM(cm) { cmSystemTools::SetMessageCallback( - [&s](const std::string& msg, const cmMessageMetadata& /* unused */) { - s += msg; - s += "\n"; + [](const std::string& msg, const cmMessageMetadata& /* unused */) { + std::cout << msg << std::endl; }); - cmSystemTools::SetStdoutCallback([&s](std::string const& m) { s += m; }); - cmSystemTools::SetStderrCallback([&s](std::string const& m) { s += m; }); + cmSystemTools::SetStdoutCallback( + [](std::string const& m) { std::cout << m << std::flush; }); + cmSystemTools::SetStderrCallback( + [](std::string const& m) { std::cout << m << std::flush; }); - this->CM.SetProgressCallback([&s](const std::string& msg, float prog) { + this->CM.SetProgressCallback([](const std::string& msg, float prog) { if (prog < 0) { - s += msg; - s += "\n"; + std::cout << msg << std::endl; } }); } @@ -199,19 +191,17 @@ int cmCTestBuildAndTest::Run() { // if the generator and make program are not specified then it is an error if (this->BuildGenerator.empty()) { - this->Output = "--build-and-test requires that the generator " - "be provided using the --build-generator " - "command line option.\n"; + std::cout << "--build-and-test requires that the generator " + "be provided using the --build-generator " + "command line option.\n"; return 1; } cmake cm(cmake::RoleProject, cmState::Project); cm.SetHomeDirectory(""); cm.SetHomeOutputDirectory(""); - std::string cmakeOutString; - cmCTestBuildAndTestCaptureRAII captureRAII(cm, cmakeOutString); + cmCTestBuildAndTestCaptureRAII captureRAII(cm); static_cast(captureRAII); - std::ostringstream out; if (this->CTest->GetConfigType().empty() && !this->ConfigSample.empty()) { // use the config sample to set the ConfigType @@ -224,8 +214,8 @@ int cmCTestBuildAndTest::Run() if (!fullPath.empty() && !resultingConfig.empty()) { this->CTest->SetConfigType(resultingConfig); } - out << "Using config sample with results: " << fullPath << " and " - << resultingConfig << std::endl; + std::cout << "Using config sample with results: " << fullPath << " and " + << resultingConfig << std::endl; } // we need to honor the timeout specified, the timeout include cmake, build @@ -233,16 +223,15 @@ int cmCTestBuildAndTest::Run() auto clock_start = std::chrono::steady_clock::now(); // make sure the binary dir is there - out << "Internal cmake changing into directory: " << this->BinaryDir - << std::endl; + std::cout << "Internal cmake changing into directory: " << this->BinaryDir + << std::endl; if (!cmSystemTools::FileIsDirectory(this->BinaryDir)) { cmSystemTools::MakeDirectory(this->BinaryDir); } cmWorkingDirectory workdir(this->BinaryDir); if (workdir.Failed()) { - auto msg = "Failed to change working directory to " + this->BinaryDir + - " : " + std::strerror(workdir.GetLastResult()) + "\n"; - this->Output = msg; + std::cout << "Failed to change working directory to " << this->BinaryDir + << " : " << std::strerror(workdir.GetLastResult()) << '\n'; return 1; } @@ -261,7 +250,7 @@ int cmCTestBuildAndTest::Run() cm.LoadCache(this->BinaryDir); } else { // do the cmake step, no timeout here since it is not a sub process - if (this->RunCMake(out, cmakeOutString, &cm)) { + if (this->RunCMake(&cm)) { return 1; } } @@ -276,7 +265,7 @@ int cmCTestBuildAndTest::Run() remainingTime = this->Timeout - (std::chrono::steady_clock::now() - clock_start); if (remainingTime <= std::chrono::seconds(0)) { - this->Output = "--build-and-test timeout exceeded. "; + std::cout << "--build-and-test timeout exceeded. "; return 1; } } @@ -292,15 +281,13 @@ int cmCTestBuildAndTest::Run() PackageResolveMode::Disable); int retVal = cm.GetGlobalGenerator()->Build( cmake::NO_BUILD_PARALLEL_LEVEL, this->SourceDir, this->BinaryDir, - this->BuildProject, { tar }, out, this->BuildMakeProgram, config, + this->BuildProject, { tar }, std::cout, this->BuildMakeProgram, config, buildOptions, false, remainingTime, cmSystemTools::OUTPUT_NONE); // if the build failed then return if (retVal) { - this->Output = out.str(); return 1; } } - this->Output = out.str(); // if no test was specified then we are done if (this->TestCommand.empty()) { @@ -323,14 +310,14 @@ int cmCTestBuildAndTest::Run() this->CTest, this->TestCommand, resultingConfig, extraPaths, failed); if (!cmSystemTools::FileExists(fullPath)) { - out << "Could not find path to executable, perhaps it was not built: " - << this->TestCommand << "\n"; - out << "tried to find it in these places:\n"; - out << fullPath << "\n"; + std::cout + << "Could not find path to executable, perhaps it was not built: " + << this->TestCommand << "\n" + << "tried to find it in these places:\n" + << fullPath << "\n"; for (std::string const& fail : failed) { - out << fail << "\n"; + std::cout << fail << "\n"; } - this->Output = out.str(); return 1; } @@ -339,23 +326,21 @@ int cmCTestBuildAndTest::Run() for (std::string const& testCommandArg : this->TestCommandArgs) { testCommand.push_back(testCommandArg); } - std::string outs; int retval = 0; // run the test from the this->BuildRunDir if set if (!this->BuildRunDir.empty()) { - out << "Run test in directory: " << this->BuildRunDir << "\n"; + std::cout << "Run test in directory: " << this->BuildRunDir << "\n"; if (!workdir.SetDirectory(this->BuildRunDir)) { - out << "Failed to change working directory : " - << std::strerror(workdir.GetLastResult()) << "\n"; - this->Output = out.str(); + std::cout << "Failed to change working directory : " + << std::strerror(workdir.GetLastResult()) << "\n"; return 1; } } - out << "Running test command: \"" << fullPath << "\""; + std::cout << "Running test command: \"" << fullPath << "\""; for (std::string const& testCommandArg : this->TestCommandArgs) { - out << " \"" << testCommandArg << "\""; + std::cout << " \"" << testCommandArg << "\""; } - out << "\n"; + std::cout << "\n"; // how much time is remaining cmDuration remainingTime = std::chrono::seconds(0); @@ -363,19 +348,19 @@ int cmCTestBuildAndTest::Run() remainingTime = this->Timeout - (std::chrono::steady_clock::now() - clock_start); if (remainingTime <= std::chrono::seconds(0)) { - this->Output = "--build-and-test timeout exceeded. "; + std::cout << "--build-and-test timeout exceeded. "; return 1; } } + std::string outs; bool runTestRes = this->RunTest(testCommand, &outs, &retval, remainingTime); if (!runTestRes || retval != 0) { - out << "Test command failed: " << testCommand[0] << "\n"; + std::cout << "Test command failed: " << testCommand[0] << "\n"; retval = 1; } - out << outs << "\n"; - this->Output = out.str(); + std::cout << outs << "\n"; return retval; } diff --git a/Source/CTest/cmCTestBuildAndTest.h b/Source/CTest/cmCTestBuildAndTest.h index d248a36631..ddb71bcc56 100644 --- a/Source/CTest/cmCTestBuildAndTest.h +++ b/Source/CTest/cmCTestBuildAndTest.h @@ -4,7 +4,6 @@ #include "cmConfigure.h" // IWYU pragma: keep -#include #include #include @@ -25,23 +24,15 @@ public: */ int Run(); - /* - * Get the output variable - */ - const char* GetOutput(); - cmCTestBuildAndTest(cmCTest* ctest); private: cmCTest* CTest; - int RunCMake(std::ostringstream& out, std::string& cmakeOutString, - cmake* cm); + int RunCMake(cmake* cm); bool RunTest(std::vector const& args, std::string* output, int* retVal, cmDuration timeout); - std::string Output; - std::string BuildGenerator; std::string BuildGeneratorPlatform; std::string BuildGeneratorToolset; diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index e8909b6b6f..0765ff71b9 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -3004,9 +3004,7 @@ int cmCTest::ExecuteTests() int cmCTest::RunCMakeAndTest() { - int retv = this->Impl->BuildAndTest.Run(); - std::cout << this->Impl->BuildAndTest.GetOutput(); - return retv; + return this->Impl->BuildAndTest.Run(); } void cmCTest::SetNotesFiles(const std::string& notes) From cb171bcc1247529c0e9693cb1e6fb017c196a5df Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 16 Oct 2024 12:01:32 -0400 Subject: [PATCH 5/6] ctest: Drop --build-and-test build output buffering Issue: #25790 --- Source/CTest/cmCTestBuildAndTest.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/CTest/cmCTestBuildAndTest.cxx b/Source/CTest/cmCTestBuildAndTest.cxx index 94da4e587c..618df007ab 100644 --- a/Source/CTest/cmCTestBuildAndTest.cxx +++ b/Source/CTest/cmCTestBuildAndTest.cxx @@ -282,7 +282,7 @@ int cmCTestBuildAndTest::Run() int retVal = cm.GetGlobalGenerator()->Build( cmake::NO_BUILD_PARALLEL_LEVEL, this->SourceDir, this->BinaryDir, this->BuildProject, { tar }, std::cout, this->BuildMakeProgram, config, - buildOptions, false, remainingTime, cmSystemTools::OUTPUT_NONE); + buildOptions, false, remainingTime, cmSystemTools::OUTPUT_PASSTHROUGH); // if the build failed then return if (retVal) { return 1; From 249c679fb4c0ca22ca97216d27dd6f31f01e15d2 Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 16 Oct 2024 13:24:31 -0400 Subject: [PATCH 6/6] ctest: Drop --build-and-test test output buffering Fixes: #25790 --- Source/CTest/cmCTestBuildAndTest.cxx | 40 +++++++--------------------- Source/CTest/cmCTestBuildAndTest.h | 4 +-- 2 files changed, 11 insertions(+), 33 deletions(-) diff --git a/Source/CTest/cmCTestBuildAndTest.cxx b/Source/CTest/cmCTestBuildAndTest.cxx index 618df007ab..667de3632b 100644 --- a/Source/CTest/cmCTestBuildAndTest.cxx +++ b/Source/CTest/cmCTestBuildAndTest.cxx @@ -9,8 +9,6 @@ #include #include -#include - #include #include "cmBuildOptions.h" @@ -86,14 +84,8 @@ int cmCTestBuildAndTest::RunCMake(cmake* cm) } bool cmCTestBuildAndTest::RunTest(std::vector const& argv, - std::string* output, int* retVal, - cmDuration timeout) + int* retVal, cmDuration timeout) { - std::vector tempOutput; - if (output) { - output->clear(); - } - cmUVProcessChainBuilder builder; builder.AddCommand(argv).SetMergedBuiltinStreams(); auto chain = builder.Start(); @@ -104,18 +96,14 @@ bool cmCTestBuildAndTest::RunTest(std::vector const& argv, uv_pipe_open(outputStream, chain.OutputStream()); auto outputHandle = cmUVStreamRead( outputStream, - [&output, &tempOutput](std::vector data) { - if (output) { - cm::append(tempOutput, data.data(), data.data() + data.size()); - } + [&processOutput](std::vector data) { + std::string decoded; + processOutput.DecodeText(data.data(), data.size(), decoded); + std::cout << decoded << std::flush; }, []() {}); bool complete = chain.Wait(static_cast(timeout.count() * 1000.0)); - processOutput.DecodeText(tempOutput, tempOutput); - if (output && tempOutput.begin() != tempOutput.end()) { - output->append(tempOutput.data(), tempOutput.size()); - } bool result = false; @@ -128,19 +116,11 @@ bool cmCTestBuildAndTest::RunTest(std::vector const& argv, result = true; break; case cmUVProcessChain::ExceptionCode::Spawn: { - if (output) { - std::string outerr = - cmStrCat("\n*** ERROR executing: ", exception.second); - *output += outerr; - } + std::cout << "\n*** ERROR executing: " << exception.second; } break; default: { *retVal = status.TermSignal; - if (output) { - std::string outerr = - cmStrCat("\n*** Exception executing: ", exception.second); - *output += outerr; - } + std::cout << "\n*** Exception executing: " << exception.second; } break; } } @@ -353,14 +333,12 @@ int cmCTestBuildAndTest::Run() } } - std::string outs; - bool runTestRes = this->RunTest(testCommand, &outs, &retval, remainingTime); + bool runTestRes = this->RunTest(testCommand, &retval, remainingTime); if (!runTestRes || retval != 0) { - std::cout << "Test command failed: " << testCommand[0] << "\n"; + std::cout << "\nTest command failed: " << testCommand[0] << "\n"; retval = 1; } - std::cout << outs << "\n"; return retval; } diff --git a/Source/CTest/cmCTestBuildAndTest.h b/Source/CTest/cmCTestBuildAndTest.h index ddb71bcc56..ae54f5b2a7 100644 --- a/Source/CTest/cmCTestBuildAndTest.h +++ b/Source/CTest/cmCTestBuildAndTest.h @@ -30,8 +30,8 @@ private: cmCTest* CTest; int RunCMake(cmake* cm); - bool RunTest(std::vector const& args, std::string* output, - int* retVal, cmDuration timeout); + bool RunTest(std::vector const& args, int* retVal, + cmDuration timeout); std::string BuildGenerator; std::string BuildGeneratorPlatform;