diff options
author | Brad King <brad.king@kitware.com> | 2022-09-09 14:06:37 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2022-09-09 14:06:45 (GMT) |
commit | 12de4ea2e8efc00c57c731b4a42066ef6d20e099 (patch) | |
tree | ac09264cf9dbafc6d12f64955243d202e3e804f8 /Tests | |
parent | e71605dfb44c69db6fccb7d36a58b6c9f7761ed5 (diff) | |
parent | 8f50f135aefa3f287a87c80cc8edb3deee8ee198 (diff) | |
download | CMake-12de4ea2e8efc00c57c731b4a42066ef6d20e099.zip CMake-12de4ea2e8efc00c57c731b4a42066ef6d20e099.tar.gz CMake-12de4ea2e8efc00c57c731b4a42066ef6d20e099.tar.bz2 |
Merge topic 'fphsa-error-message-empty-version-var'
8f50f135ae FPHSA: Improve error message when VERSION_VAR is empty or has been unset()
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !7527
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/RunCMake/FPHSA/RunCMakeTest.cmake | 5 | ||||
-rw-r--r-- | Tests/RunCMake/FPHSA/empty_version-result.txt | 1 | ||||
-rw-r--r-- | Tests/RunCMake/FPHSA/empty_version-stderr.txt | 9 | ||||
-rw-r--r-- | Tests/RunCMake/FPHSA/empty_version.cmake | 1 |
4 files changed, 15 insertions, 1 deletions
diff --git a/Tests/RunCMake/FPHSA/RunCMakeTest.cmake b/Tests/RunCMake/FPHSA/RunCMakeTest.cmake index 28b8570..e389e6b 100644 --- a/Tests/RunCMake/FPHSA/RunCMakeTest.cmake +++ b/Tests/RunCMake/FPHSA/RunCMakeTest.cmake @@ -38,9 +38,12 @@ run_cmake(exact_1.2.3.5) unset(RunCMake_DEFAULT_stderr) # check if searching for a version 0 works -list(APPEND RunCMake_TEST_OPTIONS "-DCMAKE_MODULE_PATH=${CMAKE_CURRENT_LIST_DIR}" "-DPseudo_VERSION=0") +set(RunCMake_TEST_OPTIONS "-DCMAKE_MODULE_PATH=${CMAKE_CURRENT_LIST_DIR}" "-DPseudo_VERSION=0") run_cmake(exact_0_matching) +set(RunCMake_TEST_OPTIONS "-DCMAKE_MODULE_PATH=${CMAKE_CURRENT_LIST_DIR}" "-DPseudo_VERSION=") +run_cmake(empty_version) + # check custom error message set(RunCMake_TEST_OPTIONS "-DCMAKE_MODULE_PATH=${CMAKE_CURRENT_LIST_DIR}" "-DCustomMessage_VERSION=1.2.3.4") run_cmake(custom_message_1) diff --git a/Tests/RunCMake/FPHSA/empty_version-result.txt b/Tests/RunCMake/FPHSA/empty_version-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/FPHSA/empty_version-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/FPHSA/empty_version-stderr.txt b/Tests/RunCMake/FPHSA/empty_version-stderr.txt new file mode 100644 index 0000000..3b60c7a --- /dev/null +++ b/Tests/RunCMake/FPHSA/empty_version-stderr.txt @@ -0,0 +1,9 @@ +^CMake Error at [^ +]*/Modules/FindPackageHandleStandardArgs.cmake:[0-9]+ \(message\): + Could NOT find Pseudo: \(Required is at least version "1"\) \(found TRUE\) +Call Stack \(most recent call first\): + [^ +]*/Modules/FindPackageHandleStandardArgs.cmake:[0-9]+ \(_FPHSA_FAILURE_MESSAGE\) + FindPseudo.cmake:[0-9]+ \(find_package_handle_standard_args\) + empty_version.cmake:[0-9]+ \(find_package\) + CMakeLists.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/FPHSA/empty_version.cmake b/Tests/RunCMake/FPHSA/empty_version.cmake new file mode 100644 index 0000000..7b7ff34 --- /dev/null +++ b/Tests/RunCMake/FPHSA/empty_version.cmake @@ -0,0 +1 @@ +find_package(Pseudo 1 REQUIRED) |