summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
Diffstat (limited to 'Tests')
-rw-r--r--Tests/FindPackageTest/CMakeLists.txt10
-rw-r--r--Tests/FindPackageTest/FindSomePackage.cmake6
-rw-r--r--Tests/FindPackageTest/FindUpperCasePackage.cmake6
-rw-r--r--Tests/RunCMake/CMakeLists.txt1
-rw-r--r--Tests/RunCMake/FPHSA/BadFoundVar-result.txt1
-rw-r--r--Tests/RunCMake/FPHSA/BadFoundVar-stderr.txt7
-rw-r--r--Tests/RunCMake/FPHSA/BadFoundVar.cmake3
-rw-r--r--Tests/RunCMake/FPHSA/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/FPHSA/FindBadFoundVar.cmake6
-rw-r--r--Tests/RunCMake/FPHSA/RunCMakeTest.cmake3
10 files changed, 46 insertions, 0 deletions
diff --git a/Tests/FindPackageTest/CMakeLists.txt b/Tests/FindPackageTest/CMakeLists.txt
index bca149b..a77713f 100644
--- a/Tests/FindPackageTest/CMakeLists.txt
+++ b/Tests/FindPackageTest/CMakeLists.txt
@@ -43,6 +43,16 @@ if(NOT LOTSOFCOMPONENTS_FOUND)
message(SEND_ERROR "LotsOfComponents not found !")
endif()
+find_package(SomePackage)
+if(NOT SomePackage_FOUND)
+ message(SEND_ERROR "SomePackage with FOUND_VAR SomePackage_FOUND not found !")
+endif()
+
+find_package(UpperCasePackage)
+if(NOT UPPERCASEPACKAGE_FOUND)
+ message(SEND_ERROR "UpperCasePackage with FOUND_VAR UPPERCASEPACKAGE_FOUND not found !")
+endif()
+
#-----------------------------------------------------------------------------
# Test system package registry if possible.
set(CMakeTestSystemPackage "")
diff --git a/Tests/FindPackageTest/FindSomePackage.cmake b/Tests/FindPackageTest/FindSomePackage.cmake
new file mode 100644
index 0000000..83d1d0e
--- /dev/null
+++ b/Tests/FindPackageTest/FindSomePackage.cmake
@@ -0,0 +1,6 @@
+set(SOP_FOO TRUE)
+
+include(FindPackageHandleStandardArgs)
+
+find_package_handle_standard_args(SomePackage REQUIRED_VARS SOP_FOO
+ FOUND_VAR SomePackage_FOUND )
diff --git a/Tests/FindPackageTest/FindUpperCasePackage.cmake b/Tests/FindPackageTest/FindUpperCasePackage.cmake
new file mode 100644
index 0000000..66c2fea
--- /dev/null
+++ b/Tests/FindPackageTest/FindUpperCasePackage.cmake
@@ -0,0 +1,6 @@
+set(UCP_FOO TRUE)
+
+include(FindPackageHandleStandardArgs)
+
+find_package_handle_standard_args(UpperCasePackage REQUIRED_VARS UCP_FOO
+ FOUND_VAR UPPERCASEPACKAGE_FOUND )
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index c55bb3a..dba772d 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -56,6 +56,7 @@ if(UNIX AND "${CMAKE_TEST_GENERATOR}" MATCHES "Unix Makefiles")
add_RunCMake_test(CompilerChange)
endif()
add_RunCMake_test(ExternalData)
+add_RunCMake_test(FPHSA)
add_RunCMake_test(GeneratorExpression)
add_RunCMake_test(GeneratorToolset)
add_RunCMake_test(TargetPropertyGeneratorExpressions)
diff --git a/Tests/RunCMake/FPHSA/BadFoundVar-result.txt b/Tests/RunCMake/FPHSA/BadFoundVar-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/FPHSA/BadFoundVar-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/FPHSA/BadFoundVar-stderr.txt b/Tests/RunCMake/FPHSA/BadFoundVar-stderr.txt
new file mode 100644
index 0000000..4c739d8
--- /dev/null
+++ b/Tests/RunCMake/FPHSA/BadFoundVar-stderr.txt
@@ -0,0 +1,7 @@
+CMake Error at .*/Modules/FindPackageHandleStandardArgs.cmake:[0-9]+ \(message\):
+ The argument for FOUND_VAR is "badfoundvar_FOUND", but only
+ "BadFoundVar_FOUND" and "BADFOUNDVAR_FOUND" are valid names.
+Call Stack \(most recent call first\):
+ FindBadFoundVar.cmake:5 \(find_package_handle_standard_args\)
+ BadFoundVar.cmake:3 \(find_package\)
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/FPHSA/BadFoundVar.cmake b/Tests/RunCMake/FPHSA/BadFoundVar.cmake
new file mode 100644
index 0000000..07d4322
--- /dev/null
+++ b/Tests/RunCMake/FPHSA/BadFoundVar.cmake
@@ -0,0 +1,3 @@
+set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}")
+
+find_package(BadFoundVar REQUIRED)
diff --git a/Tests/RunCMake/FPHSA/CMakeLists.txt b/Tests/RunCMake/FPHSA/CMakeLists.txt
new file mode 100644
index 0000000..e8db6b0
--- /dev/null
+++ b/Tests/RunCMake/FPHSA/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 2.8)
+project(${RunCMake_TEST} NONE)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/FPHSA/FindBadFoundVar.cmake b/Tests/RunCMake/FPHSA/FindBadFoundVar.cmake
new file mode 100644
index 0000000..152df5c
--- /dev/null
+++ b/Tests/RunCMake/FPHSA/FindBadFoundVar.cmake
@@ -0,0 +1,6 @@
+set(BFV_FOO TRUE)
+
+include(FindPackageHandleStandardArgs)
+
+find_package_handle_standard_args(BadFoundVar REQUIRED_VARS BFV_FOO
+ FOUND_VAR badfoundvar_FOUND )
diff --git a/Tests/RunCMake/FPHSA/RunCMakeTest.cmake b/Tests/RunCMake/FPHSA/RunCMakeTest.cmake
new file mode 100644
index 0000000..0d48fa9
--- /dev/null
+++ b/Tests/RunCMake/FPHSA/RunCMakeTest.cmake
@@ -0,0 +1,3 @@
+include(RunCMake)
+
+run_cmake(BadFoundVar)