summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/RunCMake')
-rw-r--r--Tests/RunCMake/FPHSA/FindPseudoRange.cmake7
-rw-r--r--Tests/RunCMake/FPHSA/RunCMakeTest.cmake12
-rw-r--r--Tests/RunCMake/FPHSA/range_1-2-exclude-result.txt1
-rw-r--r--Tests/RunCMake/FPHSA/range_1-2-exclude-stderr.txt2
-rw-r--r--Tests/RunCMake/FPHSA/range_1-2-exclude.cmake1
-rw-r--r--Tests/RunCMake/FPHSA/range_1-2-include.cmake1
-rw-r--r--Tests/RunCMake/FPHSA/range_1-3.cmake1
-rw-r--r--Tests/RunCMake/FPHSA/range_3-4-result.txt1
-rw-r--r--Tests/RunCMake/FPHSA/range_3-4-stderr.txt2
-rw-r--r--Tests/RunCMake/FPHSA/range_3-4.cmake1
-rw-r--r--Tests/RunCMake/FPHSA/range_empty-1-result.txt1
-rw-r--r--Tests/RunCMake/FPHSA/range_empty-1-stderr.txt6
-rw-r--r--Tests/RunCMake/FPHSA/range_empty-1.cmake1
-rw-r--r--Tests/RunCMake/FPHSA/range_empty-2-result.txt1
-rw-r--r--Tests/RunCMake/FPHSA/range_empty-2-stderr.txt6
-rw-r--r--Tests/RunCMake/FPHSA/range_empty-2.cmake1
-rw-r--r--Tests/RunCMake/FPHSA/range_ignored-stderr.txt4
-rw-r--r--Tests/RunCMake/FPHSA/range_ignored.cmake1
-rw-r--r--Tests/RunCMake/FPHSA/range_no-range.cmake1
19 files changed, 51 insertions, 0 deletions
diff --git a/Tests/RunCMake/FPHSA/FindPseudoRange.cmake b/Tests/RunCMake/FPHSA/FindPseudoRange.cmake
new file mode 100644
index 0000000..ad0342c
--- /dev/null
+++ b/Tests/RunCMake/FPHSA/FindPseudoRange.cmake
@@ -0,0 +1,7 @@
+# pseudo find_module
+
+set(FOOBAR TRUE)
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(PseudoRange REQUIRED_VARS FOOBAR VERSION_VAR PseudoRange_VERSION
+ HANDLE_VERSION_RANGE)
diff --git a/Tests/RunCMake/FPHSA/RunCMakeTest.cmake b/Tests/RunCMake/FPHSA/RunCMakeTest.cmake
index 8e39090..e4b8700 100644
--- a/Tests/RunCMake/FPHSA/RunCMakeTest.cmake
+++ b/Tests/RunCMake/FPHSA/RunCMakeTest.cmake
@@ -55,3 +55,15 @@ run_cmake(required_and_optional_components)
run_cmake(all_optional_components)
list(APPEND RunCMake_TEST_OPTIONS "-DUseComponents_REQUIRE_VARS=TRUE")
run_cmake(required_components_with_vars)
+
+# check handling of version range
+set(RunCMake_TEST_OPTIONS "-DCMAKE_MODULE_PATH=${CMAKE_CURRENT_LIST_DIR}" "-DPseudo_VERSION=2.3.4.5")
+run_cmake(range_ignored)
+set(RunCMake_TEST_OPTIONS "-DCMAKE_MODULE_PATH=${CMAKE_CURRENT_LIST_DIR}" "-DPseudoRange_VERSION=2.0")
+run_cmake(range_no-range)
+run_cmake(range_empty-1)
+run_cmake(range_empty-2)
+run_cmake(range_1-3)
+run_cmake(range_1-2-include)
+run_cmake(range_1-2-exclude)
+run_cmake(range_3-4)
diff --git a/Tests/RunCMake/FPHSA/range_1-2-exclude-result.txt b/Tests/RunCMake/FPHSA/range_1-2-exclude-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/FPHSA/range_1-2-exclude-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/FPHSA/range_1-2-exclude-stderr.txt b/Tests/RunCMake/FPHSA/range_1-2-exclude-stderr.txt
new file mode 100644
index 0000000..8e34630
--- /dev/null
+++ b/Tests/RunCMake/FPHSA/range_1-2-exclude-stderr.txt
@@ -0,0 +1,2 @@
+ Could NOT find PseudoRange: Found unsuitable version "2\.0", required range
+ is "1.0...<2.0" \(found TRUE\)
diff --git a/Tests/RunCMake/FPHSA/range_1-2-exclude.cmake b/Tests/RunCMake/FPHSA/range_1-2-exclude.cmake
new file mode 100644
index 0000000..0cba368
--- /dev/null
+++ b/Tests/RunCMake/FPHSA/range_1-2-exclude.cmake
@@ -0,0 +1 @@
+find_package(PseudoRange 1.0...<2.0 REQUIRED)
diff --git a/Tests/RunCMake/FPHSA/range_1-2-include.cmake b/Tests/RunCMake/FPHSA/range_1-2-include.cmake
new file mode 100644
index 0000000..467267f
--- /dev/null
+++ b/Tests/RunCMake/FPHSA/range_1-2-include.cmake
@@ -0,0 +1 @@
+find_package(PseudoRange 1.0...2.0 REQUIRED)
diff --git a/Tests/RunCMake/FPHSA/range_1-3.cmake b/Tests/RunCMake/FPHSA/range_1-3.cmake
new file mode 100644
index 0000000..f1506c5
--- /dev/null
+++ b/Tests/RunCMake/FPHSA/range_1-3.cmake
@@ -0,0 +1 @@
+find_package(PseudoRange 1.0...3.0 REQUIRED)
diff --git a/Tests/RunCMake/FPHSA/range_3-4-result.txt b/Tests/RunCMake/FPHSA/range_3-4-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/FPHSA/range_3-4-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/FPHSA/range_3-4-stderr.txt b/Tests/RunCMake/FPHSA/range_3-4-stderr.txt
new file mode 100644
index 0000000..8ea19ce
--- /dev/null
+++ b/Tests/RunCMake/FPHSA/range_3-4-stderr.txt
@@ -0,0 +1,2 @@
+ Could NOT find PseudoRange: Found unsuitable version "2\.0", required range
+ is "3.0...4.0" \(found TRUE\)
diff --git a/Tests/RunCMake/FPHSA/range_3-4.cmake b/Tests/RunCMake/FPHSA/range_3-4.cmake
new file mode 100644
index 0000000..dd19314
--- /dev/null
+++ b/Tests/RunCMake/FPHSA/range_3-4.cmake
@@ -0,0 +1 @@
+find_package(PseudoRange 3.0...4.0 REQUIRED)
diff --git a/Tests/RunCMake/FPHSA/range_empty-1-result.txt b/Tests/RunCMake/FPHSA/range_empty-1-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/FPHSA/range_empty-1-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/FPHSA/range_empty-1-stderr.txt b/Tests/RunCMake/FPHSA/range_empty-1-stderr.txt
new file mode 100644
index 0000000..e1c741a
--- /dev/null
+++ b/Tests/RunCMake/FPHSA/range_empty-1-stderr.txt
@@ -0,0 +1,6 @@
+CMake Error at .+FindPackageHandleStandardArgs.cmake:[0-9]+ \(message\):
+ Could NOT find PseudoRange: Found unsuitable version "2\.0", required range
+ is empty \("3\.0\.\.\.2\.0"\) \(found TRUE\)
+Call Stack \(most recent call first\):
+ .+FindPackageHandleStandardArgs.cmake:[0-9]+ \(_FPHSA_FAILURE_MESSAGE\)
+ FindPseudoRange.cmake:[0-9]+ \(find_package_handle_standard_args\)
diff --git a/Tests/RunCMake/FPHSA/range_empty-1.cmake b/Tests/RunCMake/FPHSA/range_empty-1.cmake
new file mode 100644
index 0000000..c510d7d
--- /dev/null
+++ b/Tests/RunCMake/FPHSA/range_empty-1.cmake
@@ -0,0 +1 @@
+find_package(PseudoRange 3.0...2.0 REQUIRED)
diff --git a/Tests/RunCMake/FPHSA/range_empty-2-result.txt b/Tests/RunCMake/FPHSA/range_empty-2-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/FPHSA/range_empty-2-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/FPHSA/range_empty-2-stderr.txt b/Tests/RunCMake/FPHSA/range_empty-2-stderr.txt
new file mode 100644
index 0000000..ee0e79a
--- /dev/null
+++ b/Tests/RunCMake/FPHSA/range_empty-2-stderr.txt
@@ -0,0 +1,6 @@
+CMake Error at .+FindPackageHandleStandardArgs.cmake:[0-9]+ \(message\):
+ Could NOT find PseudoRange: Found unsuitable version "2\.0", required range
+ is empty \("2\.0\.\.\.<2.0"\) \(found TRUE\)
+Call Stack \(most recent call first\):
+ .+FindPackageHandleStandardArgs.cmake:[0-9]+ \(_FPHSA_FAILURE_MESSAGE\)
+ FindPseudoRange.cmake:[0-9]+ \(find_package_handle_standard_args\)
diff --git a/Tests/RunCMake/FPHSA/range_empty-2.cmake b/Tests/RunCMake/FPHSA/range_empty-2.cmake
new file mode 100644
index 0000000..3ce90e8
--- /dev/null
+++ b/Tests/RunCMake/FPHSA/range_empty-2.cmake
@@ -0,0 +1 @@
+find_package(PseudoRange 2.0...<2.0 REQUIRED)
diff --git a/Tests/RunCMake/FPHSA/range_ignored-stderr.txt b/Tests/RunCMake/FPHSA/range_ignored-stderr.txt
new file mode 100644
index 0000000..43f2336
--- /dev/null
+++ b/Tests/RunCMake/FPHSA/range_ignored-stderr.txt
@@ -0,0 +1,4 @@
+CMake Warning \(dev\) at .+FindPackageHandleStandardArgs.cmake:[0-9]+ \(message\):
+ `find_package\(\)` specify a version range but the module Pseudo does not
+ support this capability. Only the lower endpoint of the range will be
+ used.
diff --git a/Tests/RunCMake/FPHSA/range_ignored.cmake b/Tests/RunCMake/FPHSA/range_ignored.cmake
new file mode 100644
index 0000000..ff1ad15
--- /dev/null
+++ b/Tests/RunCMake/FPHSA/range_ignored.cmake
@@ -0,0 +1 @@
+find_package(Pseudo 1.0...2.0 REQUIRED)
diff --git a/Tests/RunCMake/FPHSA/range_no-range.cmake b/Tests/RunCMake/FPHSA/range_no-range.cmake
new file mode 100644
index 0000000..24896b1
--- /dev/null
+++ b/Tests/RunCMake/FPHSA/range_no-range.cmake
@@ -0,0 +1 @@
+find_package(PseudoRange 1.0 REQUIRED)