Browse Source

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 <[email protected]>
Daniel Pfeifer 9 months ago
parent
commit
712cb8cb14

+ 3 - 0
Source/cmCTest.cxx

@@ -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();
 

+ 0 - 1
Tests/RunCMake/CTestCommandLine/EmptyDirCoverage-ctest-result.txt

@@ -1 +0,0 @@
-32

+ 1 - 1
Tests/RunCMake/CTestCommandLine/EmptyDirCoverage-ctest-stderr.txt

@@ -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\.$

+ 3 - 0
Tests/RunCMake/CTestCommandLine/EmptyDirTest-ctest-stderr.txt

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

+ 4 - 0
Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake

@@ -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
   )