Merge branch 'backport-instrumentation-disabled-test-fix'

This commit is contained in:
Brad King
2026-05-12 11:10:40 -04:00
5 changed files with 17 additions and 2 deletions
+1 -1
View File
@@ -1117,7 +1117,7 @@ void cmCTestRunTest::FinalizeTest(bool started)
this->CollectLLVMCoverage();
}
if (this->CTest->GetInstrumentation().HasQuery()) {
if (started && this->CTest->GetInstrumentation().HasQuery()) {
std::string data_file = this->CTest->GetInstrumentation().InstrumentTest(
this->TestProperties->Name, this->ActualCommand, this->Arguments,
this->TestProcess->GetExitValue(), this->TestProcess->GetStartTime(),
@@ -20,6 +20,7 @@ function(instrument test)
"MANUAL_HOOK"
"PRESERVE_DATA"
"NO_CONFIGURE"
"DISABLE_TEST"
"FAIL"
"BAD_QUERY"
)
@@ -112,6 +113,9 @@ function(instrument test)
if (ARGS_FAIL)
list(APPEND ARGS_CONFIGURE_ARG "-DFAIL=ON")
endif()
if (ARGS_DISABLE_TEST)
list(APPEND ARGS_CONFIGURE_ARG "-DDISABLE_TEST=ON")
endif()
set(RunCMake_TEST_SOURCE_DIR ${RunCMake_SOURCE_DIR}/project)
if(NOT RunCMake_GENERATOR_IS_MULTI_CONFIG)
set(maybe_CMAKE_BUILD_TYPE -DCMAKE_BUILD_TYPE=Debug)
@@ -221,6 +225,10 @@ instrument(no-query
BUILD INSTALL TEST
CHECK_SCRIPT check-data-dir.cmake
)
instrument(disabled-test
BUILD TEST DISABLE_TEST
CHECK_SCRIPT check-data-dir.cmake
)
instrument(dynamic-query
BUILD INSTALL TEST DYNAMIC_QUERY
CHECK_SCRIPT check-data-dir.cmake
@@ -160,7 +160,10 @@ if (ARGS_BUILD OR ARGS_BUILD_MAKE_PROGRAM)
endif()
endif()
if (ARGS_TEST)
list(APPEND EXPECTED_SNIPPETS ctest test)
list(APPEND EXPECTED_SNIPPETS ctest)
if (NOT ARGS_DISABLE_TEST)
list(APPEND EXPECTED_SNIPPETS test)
endif()
endif()
if (ARGS_INSTALL)
list(APPEND EXPECTED_SNIPPETS cmakeInstall)
@@ -0,0 +1 @@
No tests were found!!!
@@ -41,6 +41,9 @@ add_custom_target(customTarget ALL
DEPENDS output1 shell_redirect.out
)
add_test(NAME test COMMAND $<TARGET_FILE:main>)
if(DISABLE_TEST)
set_tests_properties(test PROPERTIES DISABLED TRUE)
endif()
install(TARGETS main)
set_target_properties(main PROPERTIES LABELS "label1;label2")
set_target_properties(lib PROPERTIES LABELS "label3")