diff options
author | Brad King <brad.king@kitware.com> | 2017-09-08 13:48:10 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2017-09-08 13:48:15 (GMT) |
commit | d4f58a9cd8e3709a0cb176814226da324b17e0fe (patch) | |
tree | 8939ef4126064d26cada5c50328a62afa722353d /Tests/RunCMake | |
parent | 2581ab4395aa7dd2ecec98bf69b03e23c09af73a (diff) | |
parent | 91935d9e54ac1ce6d49c5672b1247b9fe3391568 (diff) | |
download | CMake-d4f58a9cd8e3709a0cb176814226da324b17e0fe.zip CMake-d4f58a9cd8e3709a0cb176814226da324b17e0fe.tar.gz CMake-d4f58a9cd8e3709a0cb176814226da324b17e0fe.tar.bz2 |
Merge topic 'fphsa-version-cleanup'
91935d9e FPHSA: lower-case for cmake_parse_arguments + move config-mode related code
aec27c15 FPHSA: use more localized _FOUND_VERSION instead of VERSION.
0019bfeb FPHSA: Add (failing) unit test in case a cache variable VERSION is present
81844334 FPHSA: add (failing) unit test for found version being equal to 0.
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Rolf Eike Beer <eike@sf-mail.de>
Merge-request: !1224
Diffstat (limited to 'Tests/RunCMake')
6 files changed, 23 insertions, 0 deletions
diff --git a/Tests/RunCMake/FPHSA/FindPseudoNoVersionVar.cmake b/Tests/RunCMake/FPHSA/FindPseudoNoVersionVar.cmake new file mode 100644 index 0000000..d961c64 --- /dev/null +++ b/Tests/RunCMake/FPHSA/FindPseudoNoVersionVar.cmake @@ -0,0 +1,6 @@ +# pseudo find_module without specifying VERSION_VAR + +set(FOOBAR TRUE) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(PseudoNoVersionVar REQUIRED_VARS FOOBAR) diff --git a/Tests/RunCMake/FPHSA/RunCMakeTest.cmake b/Tests/RunCMake/FPHSA/RunCMakeTest.cmake index e9b2a7a..1b71a31 100644 --- a/Tests/RunCMake/FPHSA/RunCMakeTest.cmake +++ b/Tests/RunCMake/FPHSA/RunCMakeTest.cmake @@ -4,6 +4,17 @@ run_cmake(BadFoundVar) # The pseudo module will "find" a package with the given version. Check if the # version selection code in FPHSA works correctly. + +# Find a package with version 0. +set(RunCMake_TEST_OPTIONS "-DCMAKE_MODULE_PATH=${CMAKE_CURRENT_LIST_DIR}" "-DPseudo_VERSION=0") +run_cmake(any_version_find_0) + +# Find a package with more customary version number, without requestion a specific version and in +# the presence of a cache variable VERSION. +set(RunCMake_TEST_OPTIONS "-DCMAKE_MODULE_PATH=${CMAKE_CURRENT_LIST_DIR}" "-DPseudoNoVersionVar_VERSION=1.2.3.4.5_SHOULD_BE_IGNORED" "-DVERSION=BAD_VERSION") +run_cmake(any_version_VERSION_cache_variable) + +# Find a package with a more customary version number, without requestion a specific version. set(RunCMake_TEST_OPTIONS "-DCMAKE_MODULE_PATH=${CMAKE_CURRENT_LIST_DIR}" "-DPseudo_VERSION=1.2.3.4.5") run_cmake(any_version) diff --git a/Tests/RunCMake/FPHSA/any_version_VERSION_cache_variable-stdout.txt b/Tests/RunCMake/FPHSA/any_version_VERSION_cache_variable-stdout.txt new file mode 100644 index 0000000..f9acece --- /dev/null +++ b/Tests/RunCMake/FPHSA/any_version_VERSION_cache_variable-stdout.txt @@ -0,0 +1,2 @@ +Found PseudoNoVersionVar: TRUE * ++ diff --git a/Tests/RunCMake/FPHSA/any_version_VERSION_cache_variable.cmake b/Tests/RunCMake/FPHSA/any_version_VERSION_cache_variable.cmake new file mode 100644 index 0000000..9f27897 --- /dev/null +++ b/Tests/RunCMake/FPHSA/any_version_VERSION_cache_variable.cmake @@ -0,0 +1 @@ +find_package(PseudoNoVersionVar REQUIRED) diff --git a/Tests/RunCMake/FPHSA/any_version_find_0-stdout.txt b/Tests/RunCMake/FPHSA/any_version_find_0-stdout.txt new file mode 100644 index 0000000..861a339 --- /dev/null +++ b/Tests/RunCMake/FPHSA/any_version_find_0-stdout.txt @@ -0,0 +1,2 @@ +Found Pseudo: [^ +]*\(found version "0\"\) diff --git a/Tests/RunCMake/FPHSA/any_version_find_0.cmake b/Tests/RunCMake/FPHSA/any_version_find_0.cmake new file mode 100644 index 0000000..b34a540 --- /dev/null +++ b/Tests/RunCMake/FPHSA/any_version_find_0.cmake @@ -0,0 +1 @@ +find_package(Pseudo REQUIRED) |