summaryrefslogtreecommitdiff
path: root/Tests/RunCMake/GeneratorToolset
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/RunCMake/GeneratorToolset')
-rw-r--r--Tests/RunCMake/GeneratorToolset/BadToolset-result.txt1
-rw-r--r--Tests/RunCMake/GeneratorToolset/BadToolset-stderr.txt10
-rw-r--r--Tests/RunCMake/GeneratorToolset/BadToolset.cmake1
-rw-r--r--Tests/RunCMake/GeneratorToolset/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/GeneratorToolset/NoToolset-result.txt1
-rw-r--r--Tests/RunCMake/GeneratorToolset/NoToolset-stderr.txt4
-rw-r--r--Tests/RunCMake/GeneratorToolset/NoToolset.cmake7
-rw-r--r--Tests/RunCMake/GeneratorToolset/RunCMakeTest.cmake17
-rw-r--r--Tests/RunCMake/GeneratorToolset/TestToolset-result.txt1
-rw-r--r--Tests/RunCMake/GeneratorToolset/TestToolset-stderr.txt4
-rw-r--r--Tests/RunCMake/GeneratorToolset/TestToolset.cmake7
-rw-r--r--Tests/RunCMake/GeneratorToolset/TwoToolsets-result.txt1
-rw-r--r--Tests/RunCMake/GeneratorToolset/TwoToolsets-stderr.txt1
-rw-r--r--Tests/RunCMake/GeneratorToolset/TwoToolsets.cmake1
14 files changed, 59 insertions, 0 deletions
diff --git a/Tests/RunCMake/GeneratorToolset/BadToolset-result.txt b/Tests/RunCMake/GeneratorToolset/BadToolset-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/GeneratorToolset/BadToolset-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GeneratorToolset/BadToolset-stderr.txt b/Tests/RunCMake/GeneratorToolset/BadToolset-stderr.txt
new file mode 100644
index 000000000..bf1f19018
--- /dev/null
+++ b/Tests/RunCMake/GeneratorToolset/BadToolset-stderr.txt
@@ -0,0 +1,10 @@
+CMake Error:
+ Generator
+
+ .*
+
+ does not support toolset specification, but toolset
+
+ Bad Toolset
+
+ was specified.$
diff --git a/Tests/RunCMake/GeneratorToolset/BadToolset.cmake b/Tests/RunCMake/GeneratorToolset/BadToolset.cmake
new file mode 100644
index 000000000..2fc38e5c5
--- /dev/null
+++ b/Tests/RunCMake/GeneratorToolset/BadToolset.cmake
@@ -0,0 +1 @@
+message(FATAL_ERROR "This should not be reached!")
diff --git a/Tests/RunCMake/GeneratorToolset/CMakeLists.txt b/Tests/RunCMake/GeneratorToolset/CMakeLists.txt
new file mode 100644
index 000000000..e8db6b05b
--- /dev/null
+++ b/Tests/RunCMake/GeneratorToolset/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/GeneratorToolset/NoToolset-result.txt b/Tests/RunCMake/GeneratorToolset/NoToolset-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/GeneratorToolset/NoToolset-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GeneratorToolset/NoToolset-stderr.txt b/Tests/RunCMake/GeneratorToolset/NoToolset-stderr.txt
new file mode 100644
index 000000000..bc6f74193
--- /dev/null
+++ b/Tests/RunCMake/GeneratorToolset/NoToolset-stderr.txt
@@ -0,0 +1,4 @@
+CMake Error at NoToolset.cmake:2 \(message\):
+ CMAKE_GENERATOR_TOOLSET is empty as expected.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/GeneratorToolset/NoToolset.cmake b/Tests/RunCMake/GeneratorToolset/NoToolset.cmake
new file mode 100644
index 000000000..f1f1ecd26
--- /dev/null
+++ b/Tests/RunCMake/GeneratorToolset/NoToolset.cmake
@@ -0,0 +1,7 @@
+if("x${CMAKE_GENERATOR_TOOLSET}" STREQUAL "x")
+ message(FATAL_ERROR "CMAKE_GENERATOR_TOOLSET is empty as expected.")
+else()
+ message(FATAL_ERROR
+ "CMAKE_GENERATOR_TOOLSET is \"${CMAKE_GENERATOR_TOOLSET}\" "
+ "but should be empty!")
+endif()
diff --git a/Tests/RunCMake/GeneratorToolset/RunCMakeTest.cmake b/Tests/RunCMake/GeneratorToolset/RunCMakeTest.cmake
new file mode 100644
index 000000000..1ccc1adb2
--- /dev/null
+++ b/Tests/RunCMake/GeneratorToolset/RunCMakeTest.cmake
@@ -0,0 +1,17 @@
+include(RunCMake)
+
+set(RunCMake_GENERATOR_TOOLSET "")
+run_cmake(NoToolset)
+
+if("${RunCMake_GENERATOR}" MATCHES "Visual Studio 1[012]|Xcode" AND NOT XCODE_BELOW_3)
+ set(RunCMake_GENERATOR_TOOLSET "Test Toolset")
+ run_cmake(TestToolset)
+else()
+ set(RunCMake_GENERATOR_TOOLSET "Bad Toolset")
+ run_cmake(BadToolset)
+endif()
+
+set(RunCMake_GENERATOR_TOOLSET "")
+set(RunCMake_TEST_OPTIONS -T "Extra Toolset")
+run_cmake(TwoToolsets)
+unset(RunCMake_TEST_OPTIONS)
diff --git a/Tests/RunCMake/GeneratorToolset/TestToolset-result.txt b/Tests/RunCMake/GeneratorToolset/TestToolset-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/GeneratorToolset/TestToolset-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GeneratorToolset/TestToolset-stderr.txt b/Tests/RunCMake/GeneratorToolset/TestToolset-stderr.txt
new file mode 100644
index 000000000..d5726af5f
--- /dev/null
+++ b/Tests/RunCMake/GeneratorToolset/TestToolset-stderr.txt
@@ -0,0 +1,4 @@
+CMake Error at TestToolset.cmake:2 \(message\):
+ CMAKE_GENERATOR_TOOLSET is "Test Toolset" as expected.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/GeneratorToolset/TestToolset.cmake b/Tests/RunCMake/GeneratorToolset/TestToolset.cmake
new file mode 100644
index 000000000..6f83bef28
--- /dev/null
+++ b/Tests/RunCMake/GeneratorToolset/TestToolset.cmake
@@ -0,0 +1,7 @@
+if("x${CMAKE_GENERATOR_TOOLSET}" STREQUAL "xTest Toolset")
+ message(FATAL_ERROR "CMAKE_GENERATOR_TOOLSET is \"Test Toolset\" as expected.")
+else()
+ message(FATAL_ERROR
+ "CMAKE_GENERATOR_TOOLSET is \"${CMAKE_GENERATOR_TOOLSET}\" "
+ "but should be \"Test Toolset\"!")
+endif()
diff --git a/Tests/RunCMake/GeneratorToolset/TwoToolsets-result.txt b/Tests/RunCMake/GeneratorToolset/TwoToolsets-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/GeneratorToolset/TwoToolsets-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GeneratorToolset/TwoToolsets-stderr.txt b/Tests/RunCMake/GeneratorToolset/TwoToolsets-stderr.txt
new file mode 100644
index 000000000..9fa817ff5
--- /dev/null
+++ b/Tests/RunCMake/GeneratorToolset/TwoToolsets-stderr.txt
@@ -0,0 +1 @@
+CMake Error: Multiple -T options not allowed
diff --git a/Tests/RunCMake/GeneratorToolset/TwoToolsets.cmake b/Tests/RunCMake/GeneratorToolset/TwoToolsets.cmake
new file mode 100644
index 000000000..2fc38e5c5
--- /dev/null
+++ b/Tests/RunCMake/GeneratorToolset/TwoToolsets.cmake
@@ -0,0 +1 @@
+message(FATAL_ERROR "This should not be reached!")