summaryrefslogtreecommitdiffstats
path: root/Tests/CMakeTests
diff options
context:
space:
mode:
authorDavid Cole <david.cole@kitware.com>2012-03-06 20:27:28 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2012-03-06 20:27:28 (GMT)
commit663832eb44b11e0e39f387aedf35ceeafe6360d8 (patch)
tree44101c5927557358ab7cbb686ca39ecea0abbef1 /Tests/CMakeTests
parent7fbd323f8056ce6deda71a88d07f8f2a3ca98e76 (diff)
parentb43cd1252c9e7d5dfe7ed9ef9bbd4671b38a535d (diff)
downloadCMake-663832eb44b11e0e39f387aedf35ceeafe6360d8.zip
CMake-663832eb44b11e0e39f387aedf35ceeafe6360d8.tar.gz
CMake-663832eb44b11e0e39f387aedf35ceeafe6360d8.tar.bz2
Merge topic 'test-getpropery'
b43cd12 add test for get_property() errors
Diffstat (limited to 'Tests/CMakeTests')
-rw-r--r--Tests/CMakeTests/CMakeLists.txt1
-rw-r--r--Tests/CMakeTests/GetProperty-Bad-Argument.cmake1
-rw-r--r--Tests/CMakeTests/GetProperty-Bad-Directory.cmake1
-rw-r--r--Tests/CMakeTests/GetProperty-Bad-Scope.cmake1
-rw-r--r--Tests/CMakeTests/GetProperty-Bad-Target.cmake1
-rw-r--r--Tests/CMakeTests/GetProperty-Bad-Test.cmake1
-rw-r--r--Tests/CMakeTests/GetProperty-Doc-Properties.cmake10
-rw-r--r--Tests/CMakeTests/GetProperty-Global-Name.cmake1
-rw-r--r--Tests/CMakeTests/GetProperty-Missing-Argument.cmake1
-rw-r--r--Tests/CMakeTests/GetProperty-No-Cache.cmake1
-rw-r--r--Tests/CMakeTests/GetProperty-No-Property.cmake1
-rw-r--r--Tests/CMakeTests/GetProperty-No-Source.cmake1
-rw-r--r--Tests/CMakeTests/GetProperty-No-Target.cmake1
-rw-r--r--Tests/CMakeTests/GetProperty-No-Test.cmake1
-rw-r--r--Tests/CMakeTests/GetProperty-Variable-Name.cmake1
-rw-r--r--Tests/CMakeTests/GetPropertyTest.cmake.in98
16 files changed, 122 insertions, 0 deletions
diff --git a/Tests/CMakeTests/CMakeLists.txt b/Tests/CMakeTests/CMakeLists.txt
index ea2c6f1..c42c490 100644
--- a/Tests/CMakeTests/CMakeLists.txt
+++ b/Tests/CMakeTests/CMakeLists.txt
@@ -22,6 +22,7 @@ AddCMakeTest(ConfigureFile "")
AddCMakeTest(SeparateArguments "")
AddCMakeTest(ImplicitLinkInfo "")
AddCMakeTest(ModuleNotices "")
+AddCMakeTest(GetProperty "")
AddCMakeTest(If "")
AddCMakeTest(String "")
AddCMakeTest(Math "")
diff --git a/Tests/CMakeTests/GetProperty-Bad-Argument.cmake b/Tests/CMakeTests/GetProperty-Bad-Argument.cmake
new file mode 100644
index 0000000..382dabb
--- /dev/null
+++ b/Tests/CMakeTests/GetProperty-Bad-Argument.cmake
@@ -0,0 +1 @@
+get_property(FOO GLOBAL PROPERTY FOO FOO)
diff --git a/Tests/CMakeTests/GetProperty-Bad-Directory.cmake b/Tests/CMakeTests/GetProperty-Bad-Directory.cmake
new file mode 100644
index 0000000..cdbfa80
--- /dev/null
+++ b/Tests/CMakeTests/GetProperty-Bad-Directory.cmake
@@ -0,0 +1 @@
+get_property(FOO DIRECTORY NonExistentSubDir PROPERTY FOO)
diff --git a/Tests/CMakeTests/GetProperty-Bad-Scope.cmake b/Tests/CMakeTests/GetProperty-Bad-Scope.cmake
new file mode 100644
index 0000000..ea8566b
--- /dev/null
+++ b/Tests/CMakeTests/GetProperty-Bad-Scope.cmake
@@ -0,0 +1 @@
+get_property(FOO FOO FOO)
diff --git a/Tests/CMakeTests/GetProperty-Bad-Target.cmake b/Tests/CMakeTests/GetProperty-Bad-Target.cmake
new file mode 100644
index 0000000..9992dab
--- /dev/null
+++ b/Tests/CMakeTests/GetProperty-Bad-Target.cmake
@@ -0,0 +1 @@
+get_property(FOO TARGET FOO PROPERTY FOO)
diff --git a/Tests/CMakeTests/GetProperty-Bad-Test.cmake b/Tests/CMakeTests/GetProperty-Bad-Test.cmake
new file mode 100644
index 0000000..44bf3eb
--- /dev/null
+++ b/Tests/CMakeTests/GetProperty-Bad-Test.cmake
@@ -0,0 +1 @@
+get_property(FOO TEST FOO PROPERTY FOO)
diff --git a/Tests/CMakeTests/GetProperty-Doc-Properties.cmake b/Tests/CMakeTests/GetProperty-Doc-Properties.cmake
new file mode 100644
index 0000000..6c2c362
--- /dev/null
+++ b/Tests/CMakeTests/GetProperty-Doc-Properties.cmake
@@ -0,0 +1,10 @@
+get_property(FOO_BRIEF GLOBAL PROPERTY FOO BRIEF_DOCS)
+get_property(FOO_FULL GLOBAL PROPERTY FOO FULL_DOCS)
+
+if (NOT FOO_BRIEF STREQUAL "NOTFOUND")
+ message(SEND_ERROR "property FOO has BRIEF_DOCS set to '${FOO_BRIEF}'")
+endif ()
+
+if (NOT FOO_FULL STREQUAL "NOTFOUND")
+ message(SEND_ERROR "property FOO has FULL_DOCS set to '${FOO_FULL}'")
+endif ()
diff --git a/Tests/CMakeTests/GetProperty-Global-Name.cmake b/Tests/CMakeTests/GetProperty-Global-Name.cmake
new file mode 100644
index 0000000..497700c
--- /dev/null
+++ b/Tests/CMakeTests/GetProperty-Global-Name.cmake
@@ -0,0 +1 @@
+get_property(FOO GLOBAL FOO PROPERTY FOO)
diff --git a/Tests/CMakeTests/GetProperty-Missing-Argument.cmake b/Tests/CMakeTests/GetProperty-Missing-Argument.cmake
new file mode 100644
index 0000000..f0d004d
--- /dev/null
+++ b/Tests/CMakeTests/GetProperty-Missing-Argument.cmake
@@ -0,0 +1 @@
+get_property()
diff --git a/Tests/CMakeTests/GetProperty-No-Cache.cmake b/Tests/CMakeTests/GetProperty-No-Cache.cmake
new file mode 100644
index 0000000..9719fe7
--- /dev/null
+++ b/Tests/CMakeTests/GetProperty-No-Cache.cmake
@@ -0,0 +1 @@
+get_property(FOO CACHE PROPERTY FOO)
diff --git a/Tests/CMakeTests/GetProperty-No-Property.cmake b/Tests/CMakeTests/GetProperty-No-Property.cmake
new file mode 100644
index 0000000..bee230d
--- /dev/null
+++ b/Tests/CMakeTests/GetProperty-No-Property.cmake
@@ -0,0 +1 @@
+get_property(FOO GLOBAL PROPERTY)
diff --git a/Tests/CMakeTests/GetProperty-No-Source.cmake b/Tests/CMakeTests/GetProperty-No-Source.cmake
new file mode 100644
index 0000000..89773c8
--- /dev/null
+++ b/Tests/CMakeTests/GetProperty-No-Source.cmake
@@ -0,0 +1 @@
+get_property(FOO SOURCE PROPERTY FOO)
diff --git a/Tests/CMakeTests/GetProperty-No-Target.cmake b/Tests/CMakeTests/GetProperty-No-Target.cmake
new file mode 100644
index 0000000..8f1fa23
--- /dev/null
+++ b/Tests/CMakeTests/GetProperty-No-Target.cmake
@@ -0,0 +1 @@
+get_property(FOO TARGET PROPERTY FOO)
diff --git a/Tests/CMakeTests/GetProperty-No-Test.cmake b/Tests/CMakeTests/GetProperty-No-Test.cmake
new file mode 100644
index 0000000..045bd56
--- /dev/null
+++ b/Tests/CMakeTests/GetProperty-No-Test.cmake
@@ -0,0 +1 @@
+get_property(FOO TEST PROPERTY FOO)
diff --git a/Tests/CMakeTests/GetProperty-Variable-Name.cmake b/Tests/CMakeTests/GetProperty-Variable-Name.cmake
new file mode 100644
index 0000000..9190f80
--- /dev/null
+++ b/Tests/CMakeTests/GetProperty-Variable-Name.cmake
@@ -0,0 +1 @@
+get_property(FOO VARIABLE FOO PROPERTY FOO)
diff --git a/Tests/CMakeTests/GetPropertyTest.cmake.in b/Tests/CMakeTests/GetPropertyTest.cmake.in
new file mode 100644
index 0000000..ab96e5b
--- /dev/null
+++ b/Tests/CMakeTests/GetPropertyTest.cmake.in
@@ -0,0 +1,98 @@
+include("@CMAKE_CURRENT_SOURCE_DIR@/CheckCMakeTest.cmake")
+
+set(Missing-Argument-RESULT 1)
+set(Missing-Argument-STDERR ".*CMake Error at (@CMAKE_CURRENT_SOURCE_DIR@/)?GetProperty-Missing-Argument.cmake:1 \\(get_property\\):.*get_property called with incorrect number of arguments.*")
+
+check_cmake_test(GetProperty
+ Missing-Argument
+)
+
+set(Bad-Scope-RESULT 1)
+set(Bad-Scope-STDERR ".*CMake Error at (@CMAKE_CURRENT_SOURCE_DIR@/)?GetProperty-Bad-Scope.cmake:1 \\(get_property\\):.*get_property given invalid scope FOO\\..*")
+
+check_cmake_test(GetProperty
+ Bad-Scope
+)
+
+set(Bad-Argument-RESULT 1)
+set(Bad-Argument-STDERR ".*CMake Error at (@CMAKE_CURRENT_SOURCE_DIR@/)?GetProperty-Bad-Argument.cmake:1 \\(get_property\\):.*get_property given invalid argument \"FOO\"\\..*")
+
+check_cmake_test(GetProperty
+ Bad-Argument
+)
+
+set(No-Property-RESULT 1)
+set(No-Property-STDERR ".*CMake Error at (@CMAKE_CURRENT_SOURCE_DIR@/)?GetProperty-No-Property.cmake:1 \\(get_property\\):.*get_property not given a PROPERTY <name> argument\\..*")
+
+check_cmake_test(GetProperty
+ No-Property
+)
+
+set(Doc-Properties-RESULT 0)
+
+check_cmake_test(GetProperty
+ Doc-Properties
+)
+
+set(Global-Name-RESULT 1)
+set(Global-Name-STDERR ".*CMake Error at (@CMAKE_CURRENT_SOURCE_DIR@/)?GetProperty-Global-Name.cmake:1 \\(get_property\\):.*get_property given name for GLOBAL scope\\..*")
+
+check_cmake_test(GetProperty
+ Global-Name
+)
+
+set(Bad-Directory-RESULT 1)
+set(Bad-Directory-STDERR ".*CMake Error at (@CMAKE_CURRENT_SOURCE_DIR@/)?GetProperty-Bad-Directory.cmake:1 \\(get_property\\):.*get_property DIRECTORY scope provided but requested directory was not.*found\\..*")
+
+check_cmake_test(GetProperty
+ Bad-Directory
+)
+
+set(No-Target-RESULT 1)
+set(No-Target-STDERR ".*CMake Error at (@CMAKE_CURRENT_SOURCE_DIR@/)?GetProperty-No-Target.cmake:1 \\(get_property\\):.*get_property not given name for TARGET scope\\..*")
+
+check_cmake_test(GetProperty
+ No-Target
+)
+
+set(Bad-Target-RESULT 1)
+set(Bad-Target-STDERR ".*CMake Error at (@CMAKE_CURRENT_SOURCE_DIR@/)?GetProperty-Bad-Target.cmake:1 \\(get_property\\):.*get_property could not find TARGET FOO\\..*")
+
+check_cmake_test(GetProperty
+ Bad-Target
+)
+
+set(No-Source-RESULT 1)
+set(No-Source-STDERR ".*CMake Error at (@CMAKE_CURRENT_SOURCE_DIR@/)?GetProperty-No-Source.cmake:1 \\(get_property\\):.*get_property not given name for SOURCE scope\\..*")
+
+check_cmake_test(GetProperty
+ No-Source
+)
+
+set(No-Test-RESULT 1)
+set(No-Test-STDERR ".*CMake Error at (@CMAKE_CURRENT_SOURCE_DIR@/)?GetProperty-No-Test.cmake:1 \\(get_property\\):.*get_property not given name for TEST scope\\..*")
+
+check_cmake_test(GetProperty
+ No-Test
+)
+
+set(Bad-Test-RESULT 1)
+set(Bad-Test-STDERR ".*CMake Error at (@CMAKE_CURRENT_SOURCE_DIR@/)?GetProperty-Bad-Test.cmake:1 \\(get_property\\):.*get_property given TEST name that does not exist: FOO.*")
+
+check_cmake_test(GetProperty
+ Bad-Test
+)
+
+set(Variable-Name-RESULT 1)
+set(Variable-Name-STDERR ".*CMake Error at (@CMAKE_CURRENT_SOURCE_DIR@/)?GetProperty-Variable-Name.cmake:1 \\(get_property\\):.*get_property given name for VARIABLE scope\\..*")
+
+check_cmake_test(GetProperty
+ Variable-Name
+)
+
+set(No-Cache-RESULT 1)
+set(No-Cache-STDERR ".*CMake Error at (@CMAKE_CURRENT_SOURCE_DIR@/)?GetProperty-No-Cache.cmake:1 \\(get_property\\):.*get_property not given name for CACHE scope\\..*")
+
+check_cmake_test(GetProperty
+ No-Cache
+)