ctest: Remove outdated optimization of tests running ctest itself

In commit 2c2291bbe0 (ENH: add new feature to ctest so that it can
cmake, build and run a test executable, 2004-01-07, v2.4.0~3483) ctest
was taught to recognize tests that run ctest itself and run them
internally instead of spawning a new process.  This optimization was
removed by commit b9daa192af (ENH: Refactored CTest test execution code
into an object, 2009-08-19, v2.8.0~276) `cmCTestRunTest` replaced
`cmCTestTestHandler::ProcessOneTest`, which was eventually removed by
commit 5a5cc52230 (Fixed conversion warning on 64 bit machines,
2009-08-31, v2.8.0~241).  Since then the optimization was only left in
`--build-and-test` mode, likely by accident, where it makes little
difference.  Remove it to simplify the code.

Also drop the `--force-new-ctest-process` option, originally added by
commit 9255e40d81 (ENH: Add a way to force ctest to be a new process,
2004-05-10, v2.4.0~3101), since it no longer does anything.
This commit is contained in:
Brad King
2024-10-16 09:45:24 -04:00
parent b2b7c4cc28
commit c7d11a77e4
10 changed files with 23 additions and 146 deletions
+1 -10
View File
@@ -29,15 +29,6 @@ const char* cmCTestBuildAndTest::GetOutput()
return this->Output.c_str();
}
int cmCTestBuildAndTest::Run()
{
this->Output.clear();
cmSystemTools::ResetErrorOccurredFlag();
int retv = this->RunCMakeAndTest();
cmSystemTools::ResetErrorOccurredFlag();
return retv;
}
int cmCTestBuildAndTest::RunCMake(std::ostringstream& out,
std::string& cmakeOutString, cmake* cm)
{
@@ -131,7 +122,7 @@ public:
const cmCTestBuildAndTestCaptureRAII&) = delete;
};
int cmCTestBuildAndTest::RunCMakeAndTest()
int cmCTestBuildAndTest::Run()
{
// if the generator and make program are not specified then it is an error
if (this->BuildGenerator.empty()) {
-2
View File
@@ -35,8 +35,6 @@ public:
private:
cmCTest* CTest;
//! Run CMake and build a test and then run it as a single test.
int RunCMakeAndTest();
int RunCMake(std::ostringstream& out, std::string& cmakeOutString,
cmake* cm);