diff options
author | Sebastian Holtermann <sebholt@xwmw.org> | 2019-05-15 10:36:27 (GMT) |
---|---|---|
committer | Sebastian Holtermann <sebholt@xwmw.org> | 2019-05-15 13:28:37 (GMT) |
commit | 4edc0ef359578ddaa7db0163e3a6097e12530c9b (patch) | |
tree | df9b3e29e78bc5835037c2d63af61d15fb787217 /Tests/CMakeLists.txt | |
parent | 66efdbd21a46b63572f5de677ed126a68e524e7a (diff) | |
download | CMake-4edc0ef359578ddaa7db0163e3a6097e12530c9b.zip CMake-4edc0ef359578ddaa7db0163e3a6097e12530c9b.tar.gz CMake-4edc0ef359578ddaa7db0163e3a6097e12530c9b.tar.bz2 |
Test: Improve WarnUnusedCliUnused to run on all generators
In the WarnUnusedCliUnused test, the whole CMakeCache.txt was removed in the
clean stage to trigger the same CMake warning in re-builds. This technique
worked only in the Makefile generators and the test was limited to these.
Now only the variable of interest is removed from the cache by using a
`unset(UNUSED_CLI_VARIABLE CACHE)` statement in the CMakeLists.txt file.
This makes the WarnUnusedCliUnused test run on all generators
Diffstat (limited to 'Tests/CMakeLists.txt')
-rw-r--r-- | Tests/CMakeLists.txt | 29 |
1 files changed, 11 insertions, 18 deletions
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index d992986..852b00f 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -2525,24 +2525,17 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release FAIL_REGULAR_EXPRESSION "CMakeLists.txt:5 \\(set\\):") list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/WarnUnusedUnusedViaUnset") - if("${CMAKE_GENERATOR}" MATCHES "Makefile" AND NOT WIN32) - # Ninja does not support ADDITIONAL_MAKE_CLEAN_FILES and therefore fails - # this test. (See #13371) - # Apparently Visual Studio does not support it either. As the MakeClean - # test above is only run with the Makefiles generator, only run this - # test with the Makefiles generator also. - add_test(WarnUnusedCliUnused ${CMAKE_CTEST_COMMAND} - --build-and-test - "${CMake_SOURCE_DIR}/Tests/WarnUnusedCliUnused" - "${CMake_BINARY_DIR}/Tests/WarnUnusedCliUnused" - ${build_generator_args} - --build-project WarnUnusedCliUnused - --build-options ${build_options} - "-DUNUSED_CLI_VARIABLE=Unused") - set_tests_properties(WarnUnusedCliUnused PROPERTIES - PASS_REGULAR_EXPRESSION "CMake Warning:.*Manually-specified variables were not used by the project:.* UNUSED_CLI_VARIABLE") - list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/WarnUnusedCliUnused") - endif() + add_test(WarnUnusedCliUnused ${CMAKE_CTEST_COMMAND} + --build-and-test + "${CMake_SOURCE_DIR}/Tests/WarnUnusedCliUnused" + "${CMake_BINARY_DIR}/Tests/WarnUnusedCliUnused" + ${build_generator_args} + --build-project WarnUnusedCliUnused + --build-options ${build_options} + "-DUNUSED_CLI_VARIABLE=Unused") + set_tests_properties(WarnUnusedCliUnused PROPERTIES + PASS_REGULAR_EXPRESSION "CMake Warning:.*Manually-specified variables were not used by the project:.* UNUSED_CLI_VARIABLE") + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/WarnUnusedCliUnused") add_test(WarnUnusedCliUsed ${CMAKE_CTEST_COMMAND} --build-and-test |