From 09c38e8de6dd862eb73dbd047253f70ae27aaa24 Mon Sep 17 00:00:00 2001 From: Craig Scott Date: Wed, 24 Jun 2020 21:56:26 +1000 Subject: Tests: Don't ask for things not required for GoogleTest The test cases only need C or C++, but not both. The CTest module is also not needed because we are not running a dashboard script. --- Tests/RunCMake/GoogleTest/GoogleTest.cmake | 3 +-- Tests/RunCMake/GoogleTest/GoogleTestDiscoveryMultiConfig.cmake | 3 +-- Tests/RunCMake/GoogleTest/GoogleTestDiscoveryTimeout.cmake | 3 +-- Tests/RunCMake/GoogleTest/GoogleTestXML.cmake | 3 +-- 4 files changed, 4 insertions(+), 8 deletions(-) diff --git a/Tests/RunCMake/GoogleTest/GoogleTest.cmake b/Tests/RunCMake/GoogleTest/GoogleTest.cmake index fca292a..6aa2658 100644 --- a/Tests/RunCMake/GoogleTest/GoogleTest.cmake +++ b/Tests/RunCMake/GoogleTest/GoogleTest.cmake @@ -1,5 +1,4 @@ -project(test_include_dirs) -include(CTest) +project(test_include_dirs LANGUAGES CXX) include(GoogleTest) enable_testing() diff --git a/Tests/RunCMake/GoogleTest/GoogleTestDiscoveryMultiConfig.cmake b/Tests/RunCMake/GoogleTest/GoogleTestDiscoveryMultiConfig.cmake index 1919dc1..df784fe 100644 --- a/Tests/RunCMake/GoogleTest/GoogleTestDiscoveryMultiConfig.cmake +++ b/Tests/RunCMake/GoogleTest/GoogleTestDiscoveryMultiConfig.cmake @@ -1,5 +1,4 @@ -project(test_include_dirs) -include(CTest) +project(test_include_dirs LANGUAGES CXX) include(GoogleTest) enable_testing() diff --git a/Tests/RunCMake/GoogleTest/GoogleTestDiscoveryTimeout.cmake b/Tests/RunCMake/GoogleTest/GoogleTestDiscoveryTimeout.cmake index 7398faf..20e9d65 100644 --- a/Tests/RunCMake/GoogleTest/GoogleTestDiscoveryTimeout.cmake +++ b/Tests/RunCMake/GoogleTest/GoogleTestDiscoveryTimeout.cmake @@ -1,5 +1,4 @@ -project(test_include_dirs) -include(CTest) +project(test_include_dirs LANGUAGES CXX) include(GoogleTest) enable_testing() diff --git a/Tests/RunCMake/GoogleTest/GoogleTestXML.cmake b/Tests/RunCMake/GoogleTest/GoogleTestXML.cmake index c86de63..29bd05e 100644 --- a/Tests/RunCMake/GoogleTest/GoogleTestXML.cmake +++ b/Tests/RunCMake/GoogleTest/GoogleTestXML.cmake @@ -1,5 +1,4 @@ -project(test_include_dirs) -include(CTest) +project(test_include_dirs LANGUAGES CXX) include(GoogleTest) enable_testing() -- cgit v0.12 From 642ea49115949c57cc5f96a377d950e700a8f8c1 Mon Sep 17 00:00:00 2001 From: Craig Scott Date: Wed, 24 Jun 2020 21:57:19 +1000 Subject: GoogleTest: Replace SEND_ERROR with FATAL_ERROR We want to fail and halt immediately upon any error, not continue past a fatal problem. --- Modules/GoogleTest.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/GoogleTest.cmake b/Modules/GoogleTest.cmake index f75d6ad..b210a77 100644 --- a/Modules/GoogleTest.cmake +++ b/Modules/GoogleTest.cmake @@ -527,7 +527,7 @@ function(gtest_discover_tests TARGET) endif() else() - message(SEND_ERROR "Unknown DISCOVERY_MODE: ${_DISCOVERY_MODE}") + message(FATAL_ERROR "Unknown DISCOVERY_MODE: ${_DISCOVERY_MODE}") endif() # Add discovered tests to directory TEST_INCLUDE_FILES -- cgit v0.12 From 1458b4c048c4c68318f479569b91aeb9993439b8 Mon Sep 17 00:00:00 2001 From: Craig Scott Date: Wed, 24 Jun 2020 23:19:06 +1000 Subject: Help: Add CMAKE_GTEST_DISCOVER_TESTS_DISCOVERY_MODE to release notes --- Help/release/3.18.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Help/release/3.18.rst b/Help/release/3.18.rst index c98b12a..ef4fa30 100644 --- a/Help/release/3.18.rst +++ b/Help/release/3.18.rst @@ -194,7 +194,9 @@ Modules * gained a new ``DISCOVERY_MODE`` option to control when the test discovery step is run. It offers a new ``PRE_TEST`` setting to - run the discovery at test time instead of build time. + run the discovery at test time instead of build time. A new + ``CMAKE_GTEST_DISCOVER_TESTS_DISCOVERY_MODE`` variable can be used + to change the default globally. * gained a new optional parameter ``XML_OUTPUT_DIR``. When set the JUnit XML test results are stored in that directory. -- cgit v0.12