ctest: Restore support for -T Test without dashboard configuration

Since commit 774fcbe49c (CTest: Base command line mode on top of
scripting commands, 2024-10-05, v4.0.0-rc1~653^2) we drive dashboard
client steps through `cmCTestHandlerCommand::ExecuteHandlerCommand`
instead of calling `ProcessHandler` directly.  This requires the
`BuildDirectory` to be known to establish a work directory.

Fixes: #26743
Co-authored-by: Brad King <brad.king@kitware.com>
This commit is contained in:
Daniel Pfeifer 2025-03-06 12:03:39 +01:00 committed by Brad King
parent e47dc29967
commit 712cb8cb14
5 changed files with 11 additions and 2 deletions

View File

@ -711,6 +711,9 @@ int cmCTest::ProcessSteps()
this->Impl->Verbose = true;
this->Impl->ProduceXML = true;
// Minimal dashboard client script configuration.
this->SetCTestConfiguration("BuildDirectory", this->Impl->BinaryDir);
this->UpdateCTestConfiguration();
this->BlockTestErrorDiagnostics();

View File

@ -1,3 +1,3 @@
Cannot find file: [^
]*/Tests/RunCMake/CTestCommandLine/EmptyDirCoverage-ctest-build/DartConfiguration.tcl
CTEST_BINARY_DIRECTORY not set
Cannot find any coverage files\. Ignoring Coverage request\.$

View File

@ -0,0 +1,3 @@
Cannot find file: [^
]*/Tests/RunCMake/CTestCommandLine/EmptyDirTest-ctest-build/DartConfiguration.tcl
No tests were found!!!$

View File

@ -554,6 +554,10 @@ set(ENV{CMAKE_TLS_VERIFY} 0) # Test fallback to env variable.
run_FailDrop(TLSVerify-OFF-env)
unset(ENV{CMAKE_TLS_VERIFY})
run_cmake_command(EmptyDirTest-ctest
${CMAKE_CTEST_COMMAND} -C Debug -M Experimental -T Test
)
run_cmake_command(EmptyDirCoverage-ctest
${CMAKE_CTEST_COMMAND} -C Debug -M Experimental -T Coverage
)