mirror of
https://github.com/reactos/CMake.git
synced 2024-11-29 06:20:23 +00:00
EVIS: Add tests for syntax corner cases and CMP0053
Include tests for: - @ expansion during normal execution - various characters in variable names for comparison between the new and the old parser - corner cases in the parsers - correct messages when behavior is different
This commit is contained in:
parent
bc38565863
commit
411f77d14f
1
Tests/RunCMake/Syntax/CMP0053-At-NEW-stderr.txt
Normal file
1
Tests/RunCMake/Syntax/CMP0053-At-NEW-stderr.txt
Normal file
@ -0,0 +1 @@
|
||||
^-->\${right}<--$
|
9
Tests/RunCMake/Syntax/CMP0053-At-NEW.cmake
Normal file
9
Tests/RunCMake/Syntax/CMP0053-At-NEW.cmake
Normal file
@ -0,0 +1,9 @@
|
||||
cmake_policy(SET CMP0053 NEW)
|
||||
|
||||
set(right "wrong")
|
||||
set(var "\${right}")
|
||||
# Not expanded here with the new policy.
|
||||
set(ref "@var@")
|
||||
|
||||
string(CONFIGURE "${ref}" output)
|
||||
message("-->${output}<--")
|
1
Tests/RunCMake/Syntax/CMP0053-At-OLD-stderr.txt
Normal file
1
Tests/RunCMake/Syntax/CMP0053-At-OLD-stderr.txt
Normal file
@ -0,0 +1 @@
|
||||
^-->wrong<--$
|
9
Tests/RunCMake/Syntax/CMP0053-At-OLD.cmake
Normal file
9
Tests/RunCMake/Syntax/CMP0053-At-OLD.cmake
Normal file
@ -0,0 +1,9 @@
|
||||
cmake_policy(SET CMP0053 OLD)
|
||||
|
||||
set(right "wrong")
|
||||
set(var "\${right}")
|
||||
# Expanded here with the old policy.
|
||||
set(ref "@var@")
|
||||
|
||||
string(CONFIGURE "${ref}" output)
|
||||
message("-->${output}<--")
|
27
Tests/RunCMake/Syntax/CMP0053-At-WARN-newlines-stderr.txt
Normal file
27
Tests/RunCMake/Syntax/CMP0053-At-WARN-newlines-stderr.txt
Normal file
@ -0,0 +1,27 @@
|
||||
^CMake Warning \(dev\) at CMP0053-At-WARN-newlines.cmake:4 \(set\):
|
||||
Policy CMP0053 is not set: Simplify variable reference and escape sequence
|
||||
evaluation. Run "cmake --help-policy CMP0053" for policy details. Use the
|
||||
cmake_policy command to set the policy and suppress this warning.
|
||||
|
||||
For input:
|
||||
|
||||
'
|
||||
@var@
|
||||
'
|
||||
|
||||
the old evaluation rules produce:
|
||||
|
||||
'
|
||||
\${right}
|
||||
'
|
||||
|
||||
but the new evaluation rules produce:
|
||||
|
||||
'
|
||||
@var@
|
||||
'
|
||||
|
||||
Using the old result for compatibility since the policy is not set.
|
||||
Call Stack \(most recent call first\):
|
||||
CMakeLists.txt:3 \(include\)
|
||||
This warning is for project developers. Use -Wno-dev to suppress it.$
|
6
Tests/RunCMake/Syntax/CMP0053-At-WARN-newlines.cmake
Normal file
6
Tests/RunCMake/Syntax/CMP0053-At-WARN-newlines.cmake
Normal file
@ -0,0 +1,6 @@
|
||||
set(right "wrong")
|
||||
set(var "\${right}")
|
||||
# Expanded here with the old policy.
|
||||
set(ref "
|
||||
@var@
|
||||
")
|
21
Tests/RunCMake/Syntax/CMP0053-At-WARN-stderr.txt
Normal file
21
Tests/RunCMake/Syntax/CMP0053-At-WARN-stderr.txt
Normal file
@ -0,0 +1,21 @@
|
||||
^CMake Warning \(dev\) at CMP0053-At-WARN.cmake:4 \(set\):
|
||||
Policy CMP0053 is not set: Simplify variable reference and escape sequence
|
||||
evaluation. Run "cmake --help-policy CMP0053" for policy details. Use the
|
||||
cmake_policy command to set the policy and suppress this warning.
|
||||
|
||||
For input:
|
||||
|
||||
'@var@'
|
||||
|
||||
the old evaluation rules produce:
|
||||
|
||||
'\${right}'
|
||||
|
||||
but the new evaluation rules produce:
|
||||
|
||||
'@var@'
|
||||
|
||||
Using the old result for compatibility since the policy is not set.
|
||||
Call Stack \(most recent call first\):
|
||||
CMakeLists.txt:3 \(include\)
|
||||
This warning is for project developers. Use -Wno-dev to suppress it.$
|
4
Tests/RunCMake/Syntax/CMP0053-At-WARN.cmake
Normal file
4
Tests/RunCMake/Syntax/CMP0053-At-WARN.cmake
Normal file
@ -0,0 +1,4 @@
|
||||
set(right "wrong")
|
||||
set(var "\${right}")
|
||||
# Expanded here with the old policy.
|
||||
set(ref "@var@")
|
56
Tests/RunCMake/Syntax/CMP0053-NUL-stderr.txt
Normal file
56
Tests/RunCMake/Syntax/CMP0053-NUL-stderr.txt
Normal file
@ -0,0 +1,56 @@
|
||||
^CMake Warning \(dev\) at CMP0053-NUL.cmake:1 \(set\):
|
||||
Policy CMP0053 is not set: Simplify variable reference and escape sequence
|
||||
evaluation. Run "cmake --help-policy CMP0053" for policy details. Use the
|
||||
cmake_policy command to set the policy and suppress this warning.
|
||||
|
||||
For input:
|
||||
|
||||
'\\0'
|
||||
|
||||
the old evaluation rules produce:
|
||||
|
||||
''
|
||||
|
||||
but the new evaluation rules produce an error:
|
||||
|
||||
Syntax error in cmake code at
|
||||
.*/Tests/RunCMake/Syntax/CMP0053-NUL.cmake:1
|
||||
when parsing string
|
||||
\\0
|
||||
Invalid character escape '\\0'.
|
||||
|
||||
Using the old result for compatibility since the policy is not set.
|
||||
Call Stack \(most recent call first\):
|
||||
CMakeLists.txt:3 \(include\)
|
||||
This warning is for project developers. Use -Wno-dev to suppress it.
|
||||
|
||||
CMake Warning \(dev\) at CMP0053-NUL.cmake:2 \(set\):
|
||||
Policy CMP0053 is not set: Simplify variable reference and escape sequence
|
||||
evaluation. Run "cmake --help-policy CMP0053" for policy details. Use the
|
||||
cmake_policy command to set the policy and suppress this warning.
|
||||
|
||||
For input:
|
||||
|
||||
'\\0'
|
||||
|
||||
the old evaluation rules produce:
|
||||
|
||||
''
|
||||
|
||||
but the new evaluation rules produce an error:
|
||||
|
||||
Syntax error in cmake code at
|
||||
.*/Tests/RunCMake/Syntax/CMP0053-NUL.cmake:2
|
||||
when parsing string
|
||||
\\0
|
||||
Invalid character escape '\\0'.
|
||||
|
||||
Using the old result for compatibility since the policy is not set.
|
||||
Call Stack \(most recent call first\):
|
||||
CMakeLists.txt:3 \(include\)
|
||||
This warning is for project developers. Use -Wno-dev to suppress it.
|
||||
|
||||
--><--
|
||||
--><--
|
||||
--><--
|
||||
--><--$
|
6
Tests/RunCMake/Syntax/CMP0053-NUL.cmake
Normal file
6
Tests/RunCMake/Syntax/CMP0053-NUL.cmake
Normal file
@ -0,0 +1,6 @@
|
||||
set(qnul "\0")
|
||||
set(nul \0)
|
||||
message(-->${nul}<--)
|
||||
message(-->${qnul}<--)
|
||||
message("-->${nul}<--")
|
||||
message("-->${qnul}<--")
|
@ -0,0 +1 @@
|
||||
1
|
@ -0,0 +1,4 @@
|
||||
^CMake Error at CMP0053-NameWithCarriageReturn.cmake:2 \(message\):
|
||||
message called with incorrect number of arguments
|
||||
Call Stack \(most recent call first\):
|
||||
CMakeLists.txt:3 \(include\)$
|
@ -0,0 +1,2 @@
|
||||
cmake_policy(SET CMP0053 NEW)
|
||||
message(${var\rwith\rcarriagereturn})
|
@ -0,0 +1,2 @@
|
||||
cmake_policy(SET CMP0053 NEW)
|
||||
message("${var\rwith\rcarriagereturn}")
|
@ -0,0 +1 @@
|
||||
1
|
@ -0,0 +1,4 @@
|
||||
^CMake Error at CMP0053-NameWithEscapedSpaces.cmake:2 \(message\):
|
||||
message called with incorrect number of arguments
|
||||
Call Stack \(most recent call first\):
|
||||
CMakeLists.txt:3 \(include\)
|
@ -0,0 +1,2 @@
|
||||
cmake_policy(SET CMP0053 NEW)
|
||||
message(${var\ with\ escaped\ space})
|
@ -0,0 +1,2 @@
|
||||
cmake_policy(SET CMP0053 NEW)
|
||||
message("${var\ with\ escaped\ space}")
|
@ -0,0 +1 @@
|
||||
1
|
@ -0,0 +1,4 @@
|
||||
^CMake Error at CMP0053-NameWithEscapedTabs.cmake:2 \(message\):
|
||||
message called with incorrect number of arguments
|
||||
Call Stack \(most recent call first\):
|
||||
CMakeLists.txt:3 \(include\)
|
2
Tests/RunCMake/Syntax/CMP0053-NameWithEscapedTabs.cmake
Normal file
2
Tests/RunCMake/Syntax/CMP0053-NameWithEscapedTabs.cmake
Normal file
@ -0,0 +1,2 @@
|
||||
cmake_policy(SET CMP0053 NEW)
|
||||
message(${var\ with\ escaped\ tab})
|
@ -0,0 +1,2 @@
|
||||
cmake_policy(SET CMP0053 NEW)
|
||||
message("${var\ with\ escaped\ tab}")
|
1
Tests/RunCMake/Syntax/CMP0053-NameWithNewline-result.txt
Normal file
1
Tests/RunCMake/Syntax/CMP0053-NameWithNewline-result.txt
Normal file
@ -0,0 +1 @@
|
||||
1
|
4
Tests/RunCMake/Syntax/CMP0053-NameWithNewline-stderr.txt
Normal file
4
Tests/RunCMake/Syntax/CMP0053-NameWithNewline-stderr.txt
Normal file
@ -0,0 +1,4 @@
|
||||
^CMake Error at CMP0053-NameWithNewline.cmake:2 \(message\):
|
||||
message called with incorrect number of arguments
|
||||
Call Stack \(most recent call first\):
|
||||
CMakeLists.txt:3 \(include\)$
|
2
Tests/RunCMake/Syntax/CMP0053-NameWithNewline.cmake
Normal file
2
Tests/RunCMake/Syntax/CMP0053-NameWithNewline.cmake
Normal file
@ -0,0 +1,2 @@
|
||||
cmake_policy(SET CMP0053 NEW)
|
||||
message(${var\nwith\nnewline})
|
@ -0,0 +1,2 @@
|
||||
cmake_policy(SET CMP0053 NEW)
|
||||
message("${var\nwith\nnewline}")
|
1
Tests/RunCMake/Syntax/CMP0053-NameWithSpaces-result.txt
Normal file
1
Tests/RunCMake/Syntax/CMP0053-NameWithSpaces-result.txt
Normal file
@ -0,0 +1 @@
|
||||
1
|
12
Tests/RunCMake/Syntax/CMP0053-NameWithSpaces-stderr.txt
Normal file
12
Tests/RunCMake/Syntax/CMP0053-NameWithSpaces-stderr.txt
Normal file
@ -0,0 +1,12 @@
|
||||
^CMake Error at CMP0053-NameWithSpaces.cmake:2 \(message\):
|
||||
Syntax error in cmake code at
|
||||
|
||||
.*/Tests/RunCMake/Syntax/CMP0053-NameWithSpaces.cmake:2
|
||||
|
||||
when parsing string
|
||||
|
||||
\${var
|
||||
|
||||
There is an unterminated variable reference.
|
||||
Call Stack \(most recent call first\):
|
||||
CMakeLists.txt:3 \(include\)$
|
2
Tests/RunCMake/Syntax/CMP0053-NameWithSpaces.cmake
Normal file
2
Tests/RunCMake/Syntax/CMP0053-NameWithSpaces.cmake
Normal file
@ -0,0 +1,2 @@
|
||||
cmake_policy(SET CMP0053 NEW)
|
||||
message(${var with space})
|
@ -0,0 +1 @@
|
||||
1
|
@ -0,0 +1,12 @@
|
||||
^CMake Error at CMP0053-NameWithSpacesQuoted.cmake:2 \(message\):
|
||||
Syntax error in cmake code at
|
||||
|
||||
.*/Tests/RunCMake/Syntax/CMP0053-NameWithSpacesQuoted.cmake:2
|
||||
|
||||
when parsing string
|
||||
|
||||
\${var with space}
|
||||
|
||||
Invalid character \(' '\) in a variable name: 'var'
|
||||
Call Stack \(most recent call first\):
|
||||
CMakeLists.txt:3 \(include\)$
|
2
Tests/RunCMake/Syntax/CMP0053-NameWithSpacesQuoted.cmake
Normal file
2
Tests/RunCMake/Syntax/CMP0053-NameWithSpacesQuoted.cmake
Normal file
@ -0,0 +1,2 @@
|
||||
cmake_policy(SET CMP0053 NEW)
|
||||
message("${var with space}")
|
1
Tests/RunCMake/Syntax/CMP0053-NameWithTabs-result.txt
Normal file
1
Tests/RunCMake/Syntax/CMP0053-NameWithTabs-result.txt
Normal file
@ -0,0 +1 @@
|
||||
1
|
12
Tests/RunCMake/Syntax/CMP0053-NameWithTabs-stderr.txt
Normal file
12
Tests/RunCMake/Syntax/CMP0053-NameWithTabs-stderr.txt
Normal file
@ -0,0 +1,12 @@
|
||||
^CMake Error at CMP0053-NameWithTabs.cmake:2 \(message\):
|
||||
Syntax error in cmake code at
|
||||
|
||||
.*/Tests/RunCMake/Syntax/CMP0053-NameWithTabs.cmake:2
|
||||
|
||||
when parsing string
|
||||
|
||||
\${var
|
||||
|
||||
There is an unterminated variable reference.
|
||||
Call Stack \(most recent call first\):
|
||||
CMakeLists.txt:3 \(include\)$
|
2
Tests/RunCMake/Syntax/CMP0053-NameWithTabs.cmake
Normal file
2
Tests/RunCMake/Syntax/CMP0053-NameWithTabs.cmake
Normal file
@ -0,0 +1,2 @@
|
||||
cmake_policy(SET CMP0053 NEW)
|
||||
message(${var with tab})
|
@ -0,0 +1 @@
|
||||
1
|
12
Tests/RunCMake/Syntax/CMP0053-NameWithTabsQuoted-stderr.txt
Normal file
12
Tests/RunCMake/Syntax/CMP0053-NameWithTabsQuoted-stderr.txt
Normal file
@ -0,0 +1,12 @@
|
||||
^CMake Error at CMP0053-NameWithTabsQuoted.cmake:2 \(message\):
|
||||
Syntax error in cmake code at
|
||||
|
||||
.*/Tests/RunCMake/Syntax/CMP0053-NameWithTabsQuoted.cmake:2
|
||||
|
||||
when parsing string
|
||||
|
||||
\${var with tab}
|
||||
|
||||
Invalid character \(' '\) in a variable name: 'var'
|
||||
Call Stack \(most recent call first\):
|
||||
CMakeLists.txt:3 \(include\)$
|
2
Tests/RunCMake/Syntax/CMP0053-NameWithTabsQuoted.cmake
Normal file
2
Tests/RunCMake/Syntax/CMP0053-NameWithTabsQuoted.cmake
Normal file
@ -0,0 +1,2 @@
|
||||
cmake_policy(SET CMP0053 NEW)
|
||||
message("${var with tab}")
|
1
Tests/RunCMake/Syntax/CMP0053-ParenInENV-stderr.txt
Normal file
1
Tests/RunCMake/Syntax/CMP0053-ParenInENV-stderr.txt
Normal file
@ -0,0 +1 @@
|
||||
-->value<--
|
3
Tests/RunCMake/Syntax/CMP0053-ParenInENV.cmake
Normal file
3
Tests/RunCMake/Syntax/CMP0053-ParenInENV.cmake
Normal file
@ -0,0 +1,3 @@
|
||||
cmake_policy(SET CMP0053 NEW)
|
||||
set("ENV{e(x)}" value)
|
||||
message(-->$ENV{e\(x\)}<--)
|
@ -0,0 +1 @@
|
||||
-->value<--
|
3
Tests/RunCMake/Syntax/CMP0053-ParenInQuotedENV.cmake
Normal file
3
Tests/RunCMake/Syntax/CMP0053-ParenInQuotedENV.cmake
Normal file
@ -0,0 +1,3 @@
|
||||
cmake_policy(SET CMP0053 NEW)
|
||||
set("ENV{e(x)}" value)
|
||||
message("-->$ENV{e\(x\)}<--")
|
28
Tests/RunCMake/Syntax/CMP0053-WARN-stderr.txt
Normal file
28
Tests/RunCMake/Syntax/CMP0053-WARN-stderr.txt
Normal file
@ -0,0 +1,28 @@
|
||||
^CMake Warning \(dev\) at CMP0053-WARN.cmake:2 \(message\):
|
||||
Policy CMP0053 is not set: Simplify variable reference and escape sequence
|
||||
evaluation. Run "cmake --help-policy CMP0053" for policy details. Use the
|
||||
cmake_policy command to set the policy and suppress this warning.
|
||||
|
||||
For input:
|
||||
|
||||
'\\'
|
||||
|
||||
the old evaluation rules produce:
|
||||
|
||||
'\\'
|
||||
|
||||
but the new evaluation rules produce an error:
|
||||
|
||||
Syntax error in cmake code at
|
||||
.*/Tests/RunCMake/Syntax/CMP0053-WARN.cmake:2
|
||||
when parsing string
|
||||
\\
|
||||
Invalid character escape '\\' \(at end of input\).
|
||||
|
||||
Using the old result for compatibility since the policy is not set.
|
||||
Call Stack \(most recent call first\):
|
||||
CMP0053-WARN.cmake:5 \(escape\)
|
||||
CMakeLists.txt:3 \(include\)
|
||||
This warning is for project developers. Use -Wno-dev to suppress it.
|
||||
|
||||
\\$
|
5
Tests/RunCMake/Syntax/CMP0053-WARN.cmake
Normal file
5
Tests/RunCMake/Syntax/CMP0053-WARN.cmake
Normal file
@ -0,0 +1,5 @@
|
||||
macro (escape str)
|
||||
message("${str}")
|
||||
endmacro ()
|
||||
|
||||
escape("\\")
|
@ -1,3 +1,3 @@
|
||||
cmake_minimum_required(VERSION 2.8.9)
|
||||
cmake_minimum_required(VERSION 2.8.12)
|
||||
project(${RunCMake_TEST} NONE)
|
||||
include(${RunCMake_TEST}.cmake)
|
||||
|
1
Tests/RunCMake/Syntax/Escape2-result.txt
Normal file
1
Tests/RunCMake/Syntax/Escape2-result.txt
Normal file
@ -0,0 +1 @@
|
||||
1
|
13
Tests/RunCMake/Syntax/Escape2-stderr.txt
Normal file
13
Tests/RunCMake/Syntax/Escape2-stderr.txt
Normal file
@ -0,0 +1,13 @@
|
||||
CMake Error at Escape2.cmake:4 \(message\):
|
||||
Syntax error in cmake code at
|
||||
|
||||
.*/Tests/RunCMake/Syntax/Escape2.cmake:4
|
||||
|
||||
when parsing string
|
||||
|
||||
\\
|
||||
|
||||
Invalid character escape '\\' \(at end of input\).
|
||||
Call Stack \(most recent call first\):
|
||||
Escape2.cmake:7 \(escape\)
|
||||
CMakeLists.txt:3 \(include\)
|
7
Tests/RunCMake/Syntax/Escape2.cmake
Normal file
7
Tests/RunCMake/Syntax/Escape2.cmake
Normal file
@ -0,0 +1,7 @@
|
||||
cmake_policy(SET CMP0053 NEW)
|
||||
|
||||
macro (escape str)
|
||||
message("${str}")
|
||||
endmacro ()
|
||||
|
||||
escape("\\")
|
1
Tests/RunCMake/Syntax/EscapeChar-char-result.txt
Normal file
1
Tests/RunCMake/Syntax/EscapeChar-char-result.txt
Normal file
@ -0,0 +1 @@
|
||||
1
|
12
Tests/RunCMake/Syntax/EscapeChar-char-stderr.txt.in
Normal file
12
Tests/RunCMake/Syntax/EscapeChar-char-stderr.txt.in
Normal file
@ -0,0 +1,12 @@
|
||||
CMake Error at EscapeChar-@char@-@testnum@.cmake:3 \(message\):
|
||||
Syntax error in cmake code at
|
||||
|
||||
.*/Tests/RunCMake/Syntax/EscapeChar-@char@-@testnum@.cmake:3
|
||||
|
||||
when parsing string
|
||||
|
||||
-->\\@char@<--
|
||||
|
||||
Invalid character escape '\\@char@'.
|
||||
Call Stack \(most recent call first\):
|
||||
CMakeLists.txt:3 \(include\)
|
3
Tests/RunCMake/Syntax/EscapeChar-char.cmake.in
Normal file
3
Tests/RunCMake/Syntax/EscapeChar-char.cmake.in
Normal file
@ -0,0 +1,3 @@
|
||||
cmake_policy(SET CMP0053 NEW)
|
||||
|
||||
message("-->\@char@<--")
|
12
Tests/RunCMake/Syntax/EscapeCharsAllowed-stderr.txt
Normal file
12
Tests/RunCMake/Syntax/EscapeCharsAllowed-stderr.txt
Normal file
@ -0,0 +1,12 @@
|
||||
^-->semicolon<--
|
||||
-->dollar<--
|
||||
-->brace<--
|
||||
-->bracket<--
|
||||
-->newline<--
|
||||
-->octothorpe<--
|
||||
-->splat<--
|
||||
-->caret<--
|
||||
-->paren<--
|
||||
-->dquote<--
|
||||
-->top-levelsemicolon<--
|
||||
-->top-level;escaped;semicolon<--$
|
26
Tests/RunCMake/Syntax/EscapeCharsAllowed.cmake
Normal file
26
Tests/RunCMake/Syntax/EscapeCharsAllowed.cmake
Normal file
@ -0,0 +1,26 @@
|
||||
cmake_policy(SET CMP0053 NEW)
|
||||
|
||||
set("semicolon;in;name" semicolon)
|
||||
set("dollar$in$name" dollar)
|
||||
set("brace{in}name" brace)
|
||||
set("bracket[in]name" bracket)
|
||||
set("newline\nin\nname" newline)
|
||||
set("octothorpe\#in\#name" octothorpe)
|
||||
set("splat\@in\@name" splat)
|
||||
set("caret\^in\^name" caret)
|
||||
set("paren\(in\)name" paren)
|
||||
set("dquote\"in\"name" dquote)
|
||||
|
||||
message("-->${semicolon\;in\;name}<--")
|
||||
message("-->${dollar\$in\$name}<--")
|
||||
message("-->${brace\{in\}name}<--")
|
||||
message("-->${bracket\[in\]name}<--")
|
||||
message("-->${newline\nin\nname}<--")
|
||||
message("-->${octothorpe\#in\#name}<--")
|
||||
message("-->${splat\@in\@name}<--")
|
||||
message("-->${caret\^in\^name}<--")
|
||||
message("-->${paren\(in\)name}<--")
|
||||
message("-->${dquote\"in\"name}<--")
|
||||
|
||||
message(-->top-level;semicolon<--)
|
||||
message(-->top-level\;escaped\;semicolon<--)
|
42
Tests/RunCMake/Syntax/EscapeCharsDisallowed.cmake
Normal file
42
Tests/RunCMake/Syntax/EscapeCharsDisallowed.cmake
Normal file
@ -0,0 +1,42 @@
|
||||
set(disallowed_chars
|
||||
a b c d e f g h i j l m o p q s u v w x y z
|
||||
A B C D E F G H I J L M N O P Q R S T U V W X Y Z
|
||||
0 1 2 3 4 5 6 6 7 8 9)
|
||||
set(testnum 0)
|
||||
|
||||
configure_file(
|
||||
"${RunCMake_SOURCE_DIR}/CMakeLists.txt"
|
||||
"${RunCMake_BINARY_DIR}/CMakeLists.txt"
|
||||
COPYONLY)
|
||||
|
||||
foreach (char IN LISTS disallowed_chars)
|
||||
configure_file(
|
||||
"${RunCMake_SOURCE_DIR}/EscapeChar-char.cmake.in"
|
||||
"${RunCMake_BINARY_DIR}/EscapeChar-${char}-${testnum}.cmake"
|
||||
@ONLY)
|
||||
configure_file(
|
||||
"${RunCMake_SOURCE_DIR}/EscapeChar-char-stderr.txt.in"
|
||||
"${RunCMake_BINARY_DIR}/EscapeChar-${char}-${testnum}-stderr.txt"
|
||||
@ONLY)
|
||||
configure_file(
|
||||
"${RunCMake_SOURCE_DIR}/EscapeChar-char-result.txt"
|
||||
"${RunCMake_BINARY_DIR}/EscapeChar-${char}-${testnum}-result.txt"
|
||||
COPYONLY)
|
||||
|
||||
math(EXPR testnum "${testnum} + 1")
|
||||
endforeach ()
|
||||
|
||||
function (run_tests)
|
||||
set(GENERATED_RUNCMAKE_TESTS TRUE)
|
||||
# Find the tests in the binary directory.
|
||||
set(RunCMake_SOURCE_DIR "${RunCMake_BINARY_DIR}")
|
||||
|
||||
set(testnum 0)
|
||||
foreach (char IN LISTS disallowed_chars)
|
||||
run_cmake("EscapeChar-${char}-${testnum}")
|
||||
|
||||
math(EXPR testnum "${testnum} + 1")
|
||||
endforeach ()
|
||||
endfunction ()
|
||||
|
||||
run_tests()
|
1
Tests/RunCMake/Syntax/NameWithCarriageReturn-result.txt
Normal file
1
Tests/RunCMake/Syntax/NameWithCarriageReturn-result.txt
Normal file
@ -0,0 +1 @@
|
||||
1
|
12
Tests/RunCMake/Syntax/NameWithCarriageReturn-stderr.txt
Normal file
12
Tests/RunCMake/Syntax/NameWithCarriageReturn-stderr.txt
Normal file
@ -0,0 +1,12 @@
|
||||
^CMake Error at NameWithCarriageReturn.cmake:1 \(message\):
|
||||
Syntax error in cmake code at
|
||||
|
||||
.*/Tests/RunCMake/Syntax/NameWithCarriageReturn.cmake:1
|
||||
|
||||
when parsing string
|
||||
|
||||
\${var\\rwith\\rcarriagereturn}
|
||||
|
||||
syntax error, unexpected cal_SYMBOL, expecting } \(7\)
|
||||
Call Stack \(most recent call first\):
|
||||
CMakeLists.txt:3 \(include\)$
|
1
Tests/RunCMake/Syntax/NameWithCarriageReturn.cmake
Normal file
1
Tests/RunCMake/Syntax/NameWithCarriageReturn.cmake
Normal file
@ -0,0 +1 @@
|
||||
message(${var\rwith\rcarriagereturn})
|
@ -0,0 +1 @@
|
||||
1
|
@ -0,0 +1,12 @@
|
||||
^CMake Error at NameWithCarriageReturnQuoted.cmake:1 \(message\):
|
||||
Syntax error in cmake code at
|
||||
|
||||
.*/Tests/RunCMake/Syntax/NameWithCarriageReturnQuoted.cmake:1
|
||||
|
||||
when parsing string
|
||||
|
||||
\${var\\rwith\\rcarriagereturn}
|
||||
|
||||
syntax error, unexpected cal_SYMBOL, expecting } \(7\)
|
||||
Call Stack \(most recent call first\):
|
||||
CMakeLists.txt:3 \(include\)$
|
1
Tests/RunCMake/Syntax/NameWithCarriageReturnQuoted.cmake
Normal file
1
Tests/RunCMake/Syntax/NameWithCarriageReturnQuoted.cmake
Normal file
@ -0,0 +1 @@
|
||||
message("${var\rwith\rcarriagereturn}")
|
1
Tests/RunCMake/Syntax/NameWithEscapedSpaces-result.txt
Normal file
1
Tests/RunCMake/Syntax/NameWithEscapedSpaces-result.txt
Normal file
@ -0,0 +1 @@
|
||||
1
|
12
Tests/RunCMake/Syntax/NameWithEscapedSpaces-stderr.txt
Normal file
12
Tests/RunCMake/Syntax/NameWithEscapedSpaces-stderr.txt
Normal file
@ -0,0 +1,12 @@
|
||||
^CMake Error at NameWithEscapedSpaces.cmake:1 \(message\):
|
||||
Syntax error in cmake code at
|
||||
|
||||
.*/Tests/RunCMake/Syntax/NameWithEscapedSpaces.cmake:1
|
||||
|
||||
when parsing string
|
||||
|
||||
\${var\\ with\\ escaped\\ space}
|
||||
|
||||
syntax error, unexpected cal_SYMBOL, expecting } \(7\)
|
||||
Call Stack \(most recent call first\):
|
||||
CMakeLists.txt:3 \(include\)$
|
1
Tests/RunCMake/Syntax/NameWithEscapedSpaces.cmake
Normal file
1
Tests/RunCMake/Syntax/NameWithEscapedSpaces.cmake
Normal file
@ -0,0 +1 @@
|
||||
message(${var\ with\ escaped\ space})
|
@ -0,0 +1 @@
|
||||
1
|
12
Tests/RunCMake/Syntax/NameWithEscapedSpacesQuoted-stderr.txt
Normal file
12
Tests/RunCMake/Syntax/NameWithEscapedSpacesQuoted-stderr.txt
Normal file
@ -0,0 +1,12 @@
|
||||
^CMake Error at NameWithEscapedSpacesQuoted.cmake:1 \(message\):
|
||||
Syntax error in cmake code at
|
||||
|
||||
.*/Tests/RunCMake/Syntax/NameWithEscapedSpacesQuoted.cmake:1
|
||||
|
||||
when parsing string
|
||||
|
||||
\${var\\ with\\ escaped\\ space}
|
||||
|
||||
syntax error, unexpected cal_SYMBOL, expecting } \(7\)
|
||||
Call Stack \(most recent call first\):
|
||||
CMakeLists.txt:3 \(include\)$
|
1
Tests/RunCMake/Syntax/NameWithEscapedSpacesQuoted.cmake
Normal file
1
Tests/RunCMake/Syntax/NameWithEscapedSpacesQuoted.cmake
Normal file
@ -0,0 +1 @@
|
||||
message("${var\ with\ escaped\ space}")
|
1
Tests/RunCMake/Syntax/NameWithEscapedTabs-result.txt
Normal file
1
Tests/RunCMake/Syntax/NameWithEscapedTabs-result.txt
Normal file
@ -0,0 +1 @@
|
||||
1
|
12
Tests/RunCMake/Syntax/NameWithEscapedTabs-stderr.txt
Normal file
12
Tests/RunCMake/Syntax/NameWithEscapedTabs-stderr.txt
Normal file
@ -0,0 +1,12 @@
|
||||
^CMake Error at NameWithEscapedTabs.cmake:1 \(message\):
|
||||
Syntax error in cmake code at
|
||||
|
||||
.*/Tests/RunCMake/Syntax/NameWithEscapedTabs.cmake:1
|
||||
|
||||
when parsing string
|
||||
|
||||
\${var\\ with\\ escaped\\ tab}
|
||||
|
||||
Invalid escape sequence \\.?
|
||||
Call Stack \(most recent call first\):
|
||||
CMakeLists.txt:3 \(include\)$
|
1
Tests/RunCMake/Syntax/NameWithEscapedTabs.cmake
Normal file
1
Tests/RunCMake/Syntax/NameWithEscapedTabs.cmake
Normal file
@ -0,0 +1 @@
|
||||
message(${var\ with\ escaped\ tab})
|
@ -0,0 +1 @@
|
||||
1
|
12
Tests/RunCMake/Syntax/NameWithEscapedTabsQuoted-stderr.txt
Normal file
12
Tests/RunCMake/Syntax/NameWithEscapedTabsQuoted-stderr.txt
Normal file
@ -0,0 +1,12 @@
|
||||
^CMake Error at NameWithEscapedTabsQuoted.cmake:1 \(message\):
|
||||
Syntax error in cmake code at
|
||||
|
||||
.*/Tests/RunCMake/Syntax/NameWithEscapedTabsQuoted.cmake:1
|
||||
|
||||
when parsing string
|
||||
|
||||
\${var\\ with\\ escaped\\ tab}
|
||||
|
||||
Invalid escape sequence \\.?
|
||||
Call Stack \(most recent call first\):
|
||||
CMakeLists.txt:3 \(include\)$
|
1
Tests/RunCMake/Syntax/NameWithEscapedTabsQuoted.cmake
Normal file
1
Tests/RunCMake/Syntax/NameWithEscapedTabsQuoted.cmake
Normal file
@ -0,0 +1 @@
|
||||
message("${var\ with\ escaped\ tab}")
|
1
Tests/RunCMake/Syntax/NameWithNewline-result.txt
Normal file
1
Tests/RunCMake/Syntax/NameWithNewline-result.txt
Normal file
@ -0,0 +1 @@
|
||||
1
|
12
Tests/RunCMake/Syntax/NameWithNewline-stderr.txt
Normal file
12
Tests/RunCMake/Syntax/NameWithNewline-stderr.txt
Normal file
@ -0,0 +1,12 @@
|
||||
^CMake Error at NameWithNewline.cmake:1 \(message\):
|
||||
Syntax error in cmake code at
|
||||
|
||||
.*/Tests/RunCMake/Syntax/NameWithNewline.cmake:1
|
||||
|
||||
when parsing string
|
||||
|
||||
\${var\\nwith\\nnewline}
|
||||
|
||||
syntax error, unexpected cal_SYMBOL, expecting } \(7\)
|
||||
Call Stack \(most recent call first\):
|
||||
CMakeLists.txt:3 \(include\)$
|
1
Tests/RunCMake/Syntax/NameWithNewline.cmake
Normal file
1
Tests/RunCMake/Syntax/NameWithNewline.cmake
Normal file
@ -0,0 +1 @@
|
||||
message(${var\nwith\nnewline})
|
1
Tests/RunCMake/Syntax/NameWithNewlineQuoted-result.txt
Normal file
1
Tests/RunCMake/Syntax/NameWithNewlineQuoted-result.txt
Normal file
@ -0,0 +1 @@
|
||||
1
|
12
Tests/RunCMake/Syntax/NameWithNewlineQuoted-stderr.txt
Normal file
12
Tests/RunCMake/Syntax/NameWithNewlineQuoted-stderr.txt
Normal file
@ -0,0 +1,12 @@
|
||||
^CMake Error at NameWithNewlineQuoted.cmake:1 \(message\):
|
||||
Syntax error in cmake code at
|
||||
|
||||
.*/Tests/RunCMake/Syntax/NameWithNewlineQuoted.cmake:1
|
||||
|
||||
when parsing string
|
||||
|
||||
\${var\\nwith\\nnewline}
|
||||
|
||||
syntax error, unexpected cal_SYMBOL, expecting } \(7\)
|
||||
Call Stack \(most recent call first\):
|
||||
CMakeLists.txt:3 \(include\)$
|
1
Tests/RunCMake/Syntax/NameWithNewlineQuoted.cmake
Normal file
1
Tests/RunCMake/Syntax/NameWithNewlineQuoted.cmake
Normal file
@ -0,0 +1 @@
|
||||
message("${var\nwith\nnewline}")
|
1
Tests/RunCMake/Syntax/NameWithSpaces-result.txt
Normal file
1
Tests/RunCMake/Syntax/NameWithSpaces-result.txt
Normal file
@ -0,0 +1 @@
|
||||
1
|
12
Tests/RunCMake/Syntax/NameWithSpaces-stderr.txt
Normal file
12
Tests/RunCMake/Syntax/NameWithSpaces-stderr.txt
Normal file
@ -0,0 +1,12 @@
|
||||
^CMake Error at NameWithSpaces.cmake:1 \(message\):
|
||||
Syntax error in cmake code at
|
||||
|
||||
.*/Tests/RunCMake/Syntax/NameWithSpaces.cmake:1
|
||||
|
||||
when parsing string
|
||||
|
||||
\${var
|
||||
|
||||
syntax error, unexpected \$end, expecting } \(5\)
|
||||
Call Stack \(most recent call first\):
|
||||
CMakeLists.txt:3 \(include\)$
|
1
Tests/RunCMake/Syntax/NameWithSpaces.cmake
Normal file
1
Tests/RunCMake/Syntax/NameWithSpaces.cmake
Normal file
@ -0,0 +1 @@
|
||||
message(${var with space})
|
1
Tests/RunCMake/Syntax/NameWithSpacesQuoted-result.txt
Normal file
1
Tests/RunCMake/Syntax/NameWithSpacesQuoted-result.txt
Normal file
@ -0,0 +1 @@
|
||||
1
|
12
Tests/RunCMake/Syntax/NameWithSpacesQuoted-stderr.txt
Normal file
12
Tests/RunCMake/Syntax/NameWithSpacesQuoted-stderr.txt
Normal file
@ -0,0 +1,12 @@
|
||||
^CMake Error at NameWithSpacesQuoted.cmake:1 \(message\):
|
||||
Syntax error in cmake code at
|
||||
|
||||
.*/Tests/RunCMake/Syntax/NameWithSpacesQuoted.cmake:1
|
||||
|
||||
when parsing string
|
||||
|
||||
\${var with space}
|
||||
|
||||
syntax error, unexpected cal_SYMBOL, expecting } \(17\)
|
||||
Call Stack \(most recent call first\):
|
||||
CMakeLists.txt:3 \(include\)$
|
1
Tests/RunCMake/Syntax/NameWithSpacesQuoted.cmake
Normal file
1
Tests/RunCMake/Syntax/NameWithSpacesQuoted.cmake
Normal file
@ -0,0 +1 @@
|
||||
message("${var with space}")
|
1
Tests/RunCMake/Syntax/NameWithTabs-result.txt
Normal file
1
Tests/RunCMake/Syntax/NameWithTabs-result.txt
Normal file
@ -0,0 +1 @@
|
||||
1
|
12
Tests/RunCMake/Syntax/NameWithTabs-stderr.txt
Normal file
12
Tests/RunCMake/Syntax/NameWithTabs-stderr.txt
Normal file
@ -0,0 +1,12 @@
|
||||
^CMake Error at NameWithTabs.cmake:1 \(message\):
|
||||
Syntax error in cmake code at
|
||||
|
||||
.*/Tests/RunCMake/Syntax/NameWithTabs.cmake:1
|
||||
|
||||
when parsing string
|
||||
|
||||
\${var
|
||||
|
||||
syntax error, unexpected \$end, expecting } \(5\)
|
||||
Call Stack \(most recent call first\):
|
||||
CMakeLists.txt:3 \(include\)$
|
1
Tests/RunCMake/Syntax/NameWithTabs.cmake
Normal file
1
Tests/RunCMake/Syntax/NameWithTabs.cmake
Normal file
@ -0,0 +1 @@
|
||||
message(${var with tab})
|
1
Tests/RunCMake/Syntax/NameWithTabsQuoted-result.txt
Normal file
1
Tests/RunCMake/Syntax/NameWithTabsQuoted-result.txt
Normal file
@ -0,0 +1 @@
|
||||
1
|
12
Tests/RunCMake/Syntax/NameWithTabsQuoted-stderr.txt
Normal file
12
Tests/RunCMake/Syntax/NameWithTabsQuoted-stderr.txt
Normal file
@ -0,0 +1,12 @@
|
||||
^CMake Error at NameWithTabsQuoted.cmake:1 \(message\):
|
||||
Syntax error in cmake code at
|
||||
|
||||
.*/Tests/RunCMake/Syntax/NameWithTabsQuoted.cmake:1
|
||||
|
||||
when parsing string
|
||||
|
||||
\${var with tab}
|
||||
|
||||
syntax error, unexpected cal_SYMBOL, expecting } \(15\)
|
||||
Call Stack \(most recent call first\):
|
||||
CMakeLists.txt:3 \(include\)$
|
1
Tests/RunCMake/Syntax/NameWithTabsQuoted.cmake
Normal file
1
Tests/RunCMake/Syntax/NameWithTabsQuoted.cmake
Normal file
@ -0,0 +1 @@
|
||||
message("${var with tab}")
|
1
Tests/RunCMake/Syntax/ParenInVarName0-result.txt
Normal file
1
Tests/RunCMake/Syntax/ParenInVarName0-result.txt
Normal file
@ -0,0 +1 @@
|
||||
1
|
12
Tests/RunCMake/Syntax/ParenInVarName0-stderr.txt
Normal file
12
Tests/RunCMake/Syntax/ParenInVarName0-stderr.txt
Normal file
@ -0,0 +1,12 @@
|
||||
CMake Error at ParenInVarName0.cmake:4 \(message\):
|
||||
Syntax error in cmake code at
|
||||
|
||||
.*/Tests/RunCMake/Syntax/ParenInVarName0.cmake:4
|
||||
|
||||
when parsing string
|
||||
|
||||
-->\${e\(x\)}<--
|
||||
|
||||
Invalid character \('\('\) in a variable name: 'e'
|
||||
Call Stack \(most recent call first\):
|
||||
CMakeLists.txt:3 \(include\)
|
4
Tests/RunCMake/Syntax/ParenInVarName0.cmake
Normal file
4
Tests/RunCMake/Syntax/ParenInVarName0.cmake
Normal file
@ -0,0 +1,4 @@
|
||||
cmake_policy(SET CMP0053 NEW)
|
||||
|
||||
set("e(x)" value)
|
||||
message("-->${e(x)}<--")
|
1
Tests/RunCMake/Syntax/ParenInVarName1-result.txt
Normal file
1
Tests/RunCMake/Syntax/ParenInVarName1-result.txt
Normal file
@ -0,0 +1 @@
|
||||
1
|
12
Tests/RunCMake/Syntax/ParenInVarName1-stderr.txt
Normal file
12
Tests/RunCMake/Syntax/ParenInVarName1-stderr.txt
Normal file
@ -0,0 +1,12 @@
|
||||
CMake Error at ParenInVarName1.cmake:4 \(message\):
|
||||
Syntax error in cmake code at
|
||||
|
||||
.*/Tests/RunCMake/Syntax/ParenInVarName1.cmake:4
|
||||
|
||||
when parsing string
|
||||
|
||||
-->\${e\(x\)}<--
|
||||
|
||||
syntax error, unexpected cal_SYMBOL, expecting } \(10\)
|
||||
Call Stack \(most recent call first\):
|
||||
CMakeLists.txt:3 \(include\)
|
4
Tests/RunCMake/Syntax/ParenInVarName1.cmake
Normal file
4
Tests/RunCMake/Syntax/ParenInVarName1.cmake
Normal file
@ -0,0 +1,4 @@
|
||||
cmake_policy(SET CMP0053 OLD)
|
||||
|
||||
set("{e(x)}" value)
|
||||
message("-->${e(x)}<--")
|
@ -5,6 +5,14 @@ run_cmake(BOM-UTF-16-LE)
|
||||
run_cmake(BOM-UTF-16-BE)
|
||||
run_cmake(BOM-UTF-32-LE)
|
||||
run_cmake(BOM-UTF-32-BE)
|
||||
run_cmake(CMP0053-At-OLD)
|
||||
run_cmake(CMP0053-At-NEW)
|
||||
run_cmake(CMP0053-At-WARN)
|
||||
run_cmake(CMP0053-At-WARN-newlines)
|
||||
run_cmake(CMP0053-WARN)
|
||||
run_cmake(CMP0053-NUL)
|
||||
run_cmake(CMP0053-ParenInENV)
|
||||
run_cmake(CMP0053-ParenInQuotedENV)
|
||||
run_cmake(CommandSpaces)
|
||||
run_cmake(CommandTabs)
|
||||
run_cmake(CommandNewlines)
|
||||
@ -25,6 +33,7 @@ run_cmake(StringNoSpace)
|
||||
run_cmake(OneLetter)
|
||||
run_cmake(Unquoted0)
|
||||
run_cmake(Unquoted1)
|
||||
run_cmake(Unquoted2)
|
||||
run_cmake(Bracket0)
|
||||
run_cmake(Bracket1)
|
||||
run_cmake(Bracket2)
|
||||
@ -43,12 +52,20 @@ run_cmake(BracketNoSpace3)
|
||||
run_cmake(BracketNoSpace4)
|
||||
run_cmake(BracketNoSpace5)
|
||||
run_cmake(Escape1)
|
||||
run_cmake(Escape2)
|
||||
run_cmake(EscapeCharsAllowed)
|
||||
include("${RunCMake_SOURCE_DIR}/EscapeCharsDisallowed.cmake")
|
||||
run_cmake(ParenNoSpace0)
|
||||
run_cmake(ParenNoSpace1)
|
||||
run_cmake(ParenNoSpace2)
|
||||
run_cmake(ParenInVarName0)
|
||||
run_cmake(ParenInVarName1)
|
||||
run_cmake(UnterminatedCall1)
|
||||
run_cmake(UnterminatedCall2)
|
||||
run_cmake(UnterminatedString)
|
||||
run_cmake(UnterminatedBrace0)
|
||||
run_cmake(UnterminatedBrace1)
|
||||
run_cmake(UnterminatedBrace2)
|
||||
run_cmake(UnterminatedBracket0)
|
||||
run_cmake(UnterminatedBracket1)
|
||||
run_cmake(UnterminatedBracketComment)
|
||||
@ -65,3 +82,29 @@ run_cmake(AtWithVariableFile)
|
||||
run_cmake(AtWithVariableAtOnlyFile)
|
||||
run_cmake(ParenInENV)
|
||||
run_cmake(ParenInQuotedENV)
|
||||
|
||||
# Variable name tests
|
||||
run_cmake(NameWithSpaces)
|
||||
run_cmake(NameWithTabs)
|
||||
run_cmake(NameWithNewline)
|
||||
run_cmake(NameWithCarriageReturn)
|
||||
run_cmake(NameWithEscapedSpaces)
|
||||
run_cmake(NameWithEscapedTabs)
|
||||
run_cmake(NameWithSpacesQuoted)
|
||||
run_cmake(NameWithTabsQuoted)
|
||||
run_cmake(NameWithNewlineQuoted)
|
||||
run_cmake(NameWithCarriageReturnQuoted)
|
||||
run_cmake(NameWithEscapedSpacesQuoted)
|
||||
run_cmake(NameWithEscapedTabsQuoted)
|
||||
run_cmake(CMP0053-NameWithSpaces)
|
||||
run_cmake(CMP0053-NameWithTabs)
|
||||
run_cmake(CMP0053-NameWithNewline)
|
||||
run_cmake(CMP0053-NameWithCarriageReturn)
|
||||
run_cmake(CMP0053-NameWithEscapedSpaces)
|
||||
run_cmake(CMP0053-NameWithEscapedTabs)
|
||||
run_cmake(CMP0053-NameWithSpacesQuoted)
|
||||
run_cmake(CMP0053-NameWithTabsQuoted)
|
||||
run_cmake(CMP0053-NameWithNewlineQuoted)
|
||||
run_cmake(CMP0053-NameWithCarriageReturnQuoted)
|
||||
run_cmake(CMP0053-NameWithEscapedSpacesQuoted)
|
||||
run_cmake(CMP0053-NameWithEscapedTabsQuoted)
|
||||
|
1
Tests/RunCMake/Syntax/Unquoted2-stderr.txt
Normal file
1
Tests/RunCMake/Syntax/Unquoted2-stderr.txt
Normal file
@ -0,0 +1 @@
|
||||
^\[\[UnquotedBracketArgument1\]\]$
|
3
Tests/RunCMake/Syntax/Unquoted2.cmake
Normal file
3
Tests/RunCMake/Syntax/Unquoted2.cmake
Normal file
@ -0,0 +1,3 @@
|
||||
cmake_policy(SET CMP0053 NEW)
|
||||
|
||||
message(\[[Unquoted Bracket Argument 1]])
|
1
Tests/RunCMake/Syntax/UnterminatedBrace0-result.txt
Normal file
1
Tests/RunCMake/Syntax/UnterminatedBrace0-result.txt
Normal file
@ -0,0 +1 @@
|
||||
1
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user