mirror of
https://github.com/Kitware/CMake.git
synced 2026-08-09 01:01:12 +00:00
Merge topic 'instrumentation-disabled-test-fix' into release-4.3
180746bc7c instrumentation: Don't instrument disabled tests
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12033
This commit is contained in:
@@ -1025,7 +1025,7 @@ void cmCTestRunTest::WriteLogOutputTop(size_t completed, size_t total)
|
||||
|
||||
void cmCTestRunTest::FinalizeTest(bool started)
|
||||
{
|
||||
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"
|
||||
)
|
||||
@@ -94,6 +95,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)
|
||||
@@ -208,6 +212,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")
|
||||
|
||||
Reference in New Issue
Block a user