summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/GoogleTest/RunCMakeTest.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/RunCMake/GoogleTest/RunCMakeTest.cmake')
-rw-r--r--Tests/RunCMake/GoogleTest/RunCMakeTest.cmake27
1 files changed, 27 insertions, 0 deletions
diff --git a/Tests/RunCMake/GoogleTest/RunCMakeTest.cmake b/Tests/RunCMake/GoogleTest/RunCMakeTest.cmake
index b494cef..56bbfc9 100644
--- a/Tests/RunCMake/GoogleTest/RunCMakeTest.cmake
+++ b/Tests/RunCMake/GoogleTest/RunCMakeTest.cmake
@@ -292,6 +292,32 @@ function(run_GoogleTest_discovery_flush_script DISCOVERY_MODE)
)
endfunction()
+function(run_GoogleTest_discovery_test_list_scoped DISCOVERY_MODE)
+ # Use a single build tree for a few tests without cleaning.
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/GoogleTest-discovery-test-list-scoped-build)
+ set(RunCMake_TEST_NO_CLEAN 1)
+ if(NOT RunCMake_GENERATOR_IS_MULTI_CONFIG)
+ set(RunCMake_TEST_OPTIONS -DCMAKE_BUILD_TYPE=Debug)
+ endif()
+ file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
+ file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
+
+ run_cmake_with_options(GoogleTestDiscoveryTestListScoped -DCMAKE_GTEST_DISCOVER_TESTS_DISCOVERY_MODE=${DISCOVERY_MODE})
+
+ run_cmake_command(GoogleTest-discovery-test-list-scoped-build
+ ${CMAKE_COMMAND}
+ --build .
+ --config Debug
+ --target test_list_scoped_test
+ )
+
+ run_cmake_command(GoogleTest-discovery-test-list-scoped-test
+ ${CMAKE_CTEST_COMMAND}
+ -C Debug
+ --no-label-summary
+ )
+endfunction()
+
foreach(DISCOVERY_MODE POST_BUILD PRE_TEST)
message("Testing ${DISCOVERY_MODE} discovery mode via CMAKE_GTEST_DISCOVER_TESTS_DISCOVERY_MODE global override...")
run_GoogleTest(${DISCOVERY_MODE})
@@ -303,6 +329,7 @@ foreach(DISCOVERY_MODE POST_BUILD PRE_TEST)
run_GoogleTest_discovery_arg_change(${DISCOVERY_MODE})
endif()
run_GoogleTest_discovery_test_list(${DISCOVERY_MODE})
+ run_GoogleTest_discovery_test_list_scoped(${DISCOVERY_MODE})
run_GoogleTest_discovery_flush_script(${DISCOVERY_MODE})
endforeach()