From 8184433428859b64a7e13568a242b40445dce111 Mon Sep 17 00:00:00 2001 From: Yves Frederix Date: Tue, 5 Sep 2017 20:58:36 +0200 Subject: FPHSA: add (failing) unit test for found version being equal to 0. --- Tests/RunCMake/FPHSA/RunCMakeTest.cmake | 6 ++++++ Tests/RunCMake/FPHSA/any_version_find_0-stdout.txt | 2 ++ Tests/RunCMake/FPHSA/any_version_find_0.cmake | 1 + 3 files changed, 9 insertions(+) create mode 100644 Tests/RunCMake/FPHSA/any_version_find_0-stdout.txt create mode 100644 Tests/RunCMake/FPHSA/any_version_find_0.cmake diff --git a/Tests/RunCMake/FPHSA/RunCMakeTest.cmake b/Tests/RunCMake/FPHSA/RunCMakeTest.cmake index e9b2a7a..e2fc733 100644 --- a/Tests/RunCMake/FPHSA/RunCMakeTest.cmake +++ b/Tests/RunCMake/FPHSA/RunCMakeTest.cmake @@ -4,6 +4,12 @@ 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 a more customary version number. 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_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) -- cgit v0.12