Add RunCMake.Syntax test cases for command invocation styles

Cover commands with whitespace present in allowed combinations.
Also cover command error cases such as two on one line.
This commit is contained in:
Brad King 2013-02-16 20:10:21 -05:00
parent 0546484e4b
commit e945949d14
16 changed files with 74 additions and 0 deletions

1
Tests/RunCMake/Syntax/.gitattributes vendored Normal file
View File

@ -0,0 +1 @@
CommandTabs.cmake whitespace=-tab-in-indent

View File

@ -0,0 +1,4 @@
Example Message
Example Message
Example Message
Second Line of Example

View File

@ -0,0 +1,6 @@
message("Example Message"#)
)
message ("Example Message" # )
)
message( "Example Message\n" # "Commented" )
"Second Line of Example")

View File

@ -0,0 +1 @@
1

View File

@ -0,0 +1,8 @@
CMake Error: Error in cmake code at
.*/Tests/RunCMake/Syntax/CommandError0.cmake:2:
Parse error. Expected "\(", got newline with text "
".
CMake Error at CMakeLists.txt:3 \(include\):
include could not find load file:
CommandError0.cmake

View File

@ -0,0 +1,2 @@
message
("Example Message")

View File

@ -0,0 +1 @@
1

View File

@ -0,0 +1,7 @@
CMake Error: Error in cmake code at
.*/Tests/RunCMake/Syntax/CommandError1.cmake:1:
Parse error. Expected a newline, got identifier with text "message".
CMake Error at CMakeLists.txt:3 \(include\):
include could not find load file:
CommandError1.cmake

View File

@ -0,0 +1 @@
message("Example Message") message("Second Message")

View File

@ -0,0 +1,3 @@
Example Message
Example Message
Example Message

View File

@ -0,0 +1,10 @@
message(
"Example Message")
message (
"Example Message"
)
message(
"Example Message"
)

View File

@ -0,0 +1,6 @@
Example Message
Example Message
Example Message
Example Message
Example Message
Example Message

View File

@ -0,0 +1,6 @@
message("Example Message")
message ("Example Message")
message( "Example Message" )
message( "Example Message")
message ( "Example Message")
message ( Example " " Message )

View File

@ -0,0 +1,6 @@
Example Message
Example Message
Example Message
Example Message
Example Message
Example Message

View File

@ -0,0 +1,6 @@
message("Example Message")
message ("Example Message")
message( "Example Message" )
message( "Example Message")
message ( "Example Message")
message ( Example " " Message )

View File

@ -1,5 +1,11 @@
include(RunCMake)
run_cmake(CommandSpaces)
run_cmake(CommandTabs)
run_cmake(CommandNewlines)
run_cmake(CommandComments)
run_cmake(CommandError0)
run_cmake(CommandError1)
run_cmake(String0)
run_cmake(String1)
run_cmake(StringNoSpace)