diff options
author | Brad King <brad.king@kitware.com> | 2021-10-26 19:13:53 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2021-10-29 15:52:58 (GMT) |
commit | 8e6d930e8c3fb951e3c4388cc6a9a96dedcb412b (patch) | |
tree | fdf30764ab7d82ca8d4cfac17521d9a0d04987ac /Tests | |
parent | 5d1f377737a9d1d14f4925072c46201d6b7b3c30 (diff) | |
download | CMake-8e6d930e8c3fb951e3c4388cc6a9a96dedcb412b.zip CMake-8e6d930e8c3fb951e3c4388cc6a9a96dedcb412b.tar.gz CMake-8e6d930e8c3fb951e3c4388cc6a9a96dedcb412b.tar.bz2 |
VS: Parse comma-separated fields from CMAKE_GENERATOR_INSTANCE
Diffstat (limited to 'Tests')
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) |