summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2021-10-26 19:13:53 (GMT)
committerBrad King <brad.king@kitware.com>2021-10-29 15:52:58 (GMT)
commit8e6d930e8c3fb951e3c4388cc6a9a96dedcb412b (patch)
treefdf30764ab7d82ca8d4cfac17521d9a0d04987ac /Tests
parent5d1f377737a9d1d14f4925072c46201d6b7b3c30 (diff)
downloadCMake-8e6d930e8c3fb951e3c4388cc6a9a96dedcb412b.zip
CMake-8e6d930e8c3fb951e3c4388cc6a9a96dedcb412b.tar.gz
CMake-8e6d930e8c3fb951e3c4388cc6a9a96dedcb412b.tar.bz2
VS: Parse comma-separated fields from CMAKE_GENERATOR_INSTANCE
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/GeneratorInstance/BadFieldNoComma-result.txt1
-rw-r--r--Tests/RunCMake/GeneratorInstance/BadFieldNoComma-stderr.txt11
-rw-r--r--Tests/RunCMake/GeneratorInstance/BadFieldNoComma.cmake1
-rw-r--r--Tests/RunCMake/GeneratorInstance/BadFieldUnknown-result.txt1
-rw-r--r--Tests/RunCMake/GeneratorInstance/BadFieldUnknown-stderr.txt11
-rw-r--r--Tests/RunCMake/GeneratorInstance/BadFieldUnknown.cmake1
-rw-r--r--Tests/RunCMake/GeneratorInstance/RunCMakeTest.cmake5
7 files changed, 31 insertions, 0 deletions
diff --git a/Tests/RunCMake/GeneratorInstance/BadFieldNoComma-result.txt b/Tests/RunCMake/GeneratorInstance/BadFieldNoComma-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/GeneratorInstance/BadFieldNoComma-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GeneratorInstance/BadFieldNoComma-stderr.txt b/Tests/RunCMake/GeneratorInstance/BadFieldNoComma-stderr.txt
new file mode 100644
index 0000000..d6c73c8
--- /dev/null
+++ b/Tests/RunCMake/GeneratorInstance/BadFieldNoComma-stderr.txt
@@ -0,0 +1,11 @@
+^CMake Error at CMakeLists.txt:[0-9]+ \(project\):
+ Generator
+
+ Visual Studio [^
+]+
+
+ given instance specification
+
+ Test Instance,nocomma
+
+ that contains a field after the first ',' with no '='\.$
diff --git a/Tests/RunCMake/GeneratorInstance/BadFieldNoComma.cmake b/Tests/RunCMake/GeneratorInstance/BadFieldNoComma.cmake
new file mode 100644
index 0000000..2fc38e5
--- /dev/null
+++ b/Tests/RunCMake/GeneratorInstance/BadFieldNoComma.cmake
@@ -0,0 +1 @@
+message(FATAL_ERROR "This should not be reached!")
diff --git a/Tests/RunCMake/GeneratorInstance/BadFieldUnknown-result.txt b/Tests/RunCMake/GeneratorInstance/BadFieldUnknown-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/GeneratorInstance/BadFieldUnknown-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GeneratorInstance/BadFieldUnknown-stderr.txt b/Tests/RunCMake/GeneratorInstance/BadFieldUnknown-stderr.txt
new file mode 100644
index 0000000..ecfe229
--- /dev/null
+++ b/Tests/RunCMake/GeneratorInstance/BadFieldUnknown-stderr.txt
@@ -0,0 +1,11 @@
+^CMake Error at CMakeLists.txt:[0-9]+ \(project\):
+ Generator
+
+ Visual Studio [^
+]+
+
+ given instance specification
+
+ Test Instance,unknown=
+
+ that contains invalid field 'unknown='\.$
diff --git a/Tests/RunCMake/GeneratorInstance/BadFieldUnknown.cmake b/Tests/RunCMake/GeneratorInstance/BadFieldUnknown.cmake
new file mode 100644
index 0000000..2fc38e5
--- /dev/null
+++ b/Tests/RunCMake/GeneratorInstance/BadFieldUnknown.cmake
@@ -0,0 +1 @@
+message(FATAL_ERROR "This should not be reached!")
diff --git a/Tests/RunCMake/GeneratorInstance/RunCMakeTest.cmake b/Tests/RunCMake/GeneratorInstance/RunCMakeTest.cmake
index e7f9ccb..5eeac8e 100644
--- a/Tests/RunCMake/GeneratorInstance/RunCMakeTest.cmake
+++ b/Tests/RunCMake/GeneratorInstance/RunCMakeTest.cmake
@@ -9,6 +9,11 @@ if("${RunCMake_GENERATOR}" MATCHES "^Visual Studio 1[56789]")
set(RunCMake_TEST_OPTIONS -DCMAKE_TOOLCHAIN_FILE=${RunCMake_SOURCE_DIR}/MissingInstance-toolchain.cmake)
run_cmake(MissingInstanceToolchain)
unset(RunCMake_TEST_OPTIONS)
+
+ set(RunCMake_GENERATOR_INSTANCE "Test Instance,nocomma")
+ run_cmake(BadFieldNoComma)
+ set(RunCMake_GENERATOR_INSTANCE "Test Instance,unknown=")
+ run_cmake(BadFieldUnknown)
else()
set(RunCMake_GENERATOR_INSTANCE "")
run_cmake(NoInstance)