diff options
author | Brad King <brad.king@kitware.com> | 2013-02-17 01:10:21 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2013-08-08 17:26:27 (GMT) |
commit | e945949d141c196df7f6232a7839c1de94f935ec (patch) | |
tree | 9681f8f821675e7f10ed63030c40134ae36f0b05 | |
parent | 0546484e4b7856c417f30a5b8ff6af6a5a080f0d (diff) | |
download | CMake-e945949d141c196df7f6232a7839c1de94f935ec.zip CMake-e945949d141c196df7f6232a7839c1de94f935ec.tar.gz CMake-e945949d141c196df7f6232a7839c1de94f935ec.tar.bz2 |
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.
-rw-r--r-- | Tests/RunCMake/Syntax/.gitattributes | 1 | ||||
-rw-r--r-- | Tests/RunCMake/Syntax/CommandComments-stderr.txt | 4 | ||||
-rw-r--r-- | Tests/RunCMake/Syntax/CommandComments.cmake | 6 | ||||
-rw-r--r-- | Tests/RunCMake/Syntax/CommandError0-result.txt | 1 | ||||
-rw-r--r-- | Tests/RunCMake/Syntax/CommandError0-stderr.txt | 8 | ||||
-rw-r--r-- | Tests/RunCMake/Syntax/CommandError0.cmake | 2 | ||||
-rw-r--r-- | Tests/RunCMake/Syntax/CommandError1-result.txt | 1 | ||||
-rw-r--r-- | Tests/RunCMake/Syntax/CommandError1-stderr.txt | 7 | ||||
-rw-r--r-- | Tests/RunCMake/Syntax/CommandError1.cmake | 1 | ||||
-rw-r--r-- | Tests/RunCMake/Syntax/CommandNewlines-stderr.txt | 3 | ||||
-rw-r--r-- | Tests/RunCMake/Syntax/CommandNewlines.cmake | 10 | ||||
-rw-r--r-- | Tests/RunCMake/Syntax/CommandSpaces-stderr.txt | 6 | ||||
-rw-r--r-- | Tests/RunCMake/Syntax/CommandSpaces.cmake | 6 | ||||
-rw-r--r-- | Tests/RunCMake/Syntax/CommandTabs-stderr.txt | 6 | ||||
-rw-r--r-- | Tests/RunCMake/Syntax/CommandTabs.cmake | 6 | ||||
-rw-r--r-- | Tests/RunCMake/Syntax/RunCMakeTest.cmake | 6 |
16 files changed, 74 insertions, 0 deletions
diff --git a/Tests/RunCMake/Syntax/.gitattributes b/Tests/RunCMake/Syntax/.gitattributes new file mode 100644 index 0000000..fc9ebff --- /dev/null +++ b/Tests/RunCMake/Syntax/.gitattributes @@ -0,0 +1 @@ +CommandTabs.cmake whitespace=-tab-in-indent diff --git a/Tests/RunCMake/Syntax/CommandComments-stderr.txt b/Tests/RunCMake/Syntax/CommandComments-stderr.txt new file mode 100644 index 0000000..df72cc5 --- /dev/null +++ b/Tests/RunCMake/Syntax/CommandComments-stderr.txt @@ -0,0 +1,4 @@ +Example Message +Example Message +Example Message +Second Line of Example diff --git a/Tests/RunCMake/Syntax/CommandComments.cmake b/Tests/RunCMake/Syntax/CommandComments.cmake new file mode 100644 index 0000000..0fd7484 --- /dev/null +++ b/Tests/RunCMake/Syntax/CommandComments.cmake @@ -0,0 +1,6 @@ +message("Example Message"#) + ) +message ("Example Message" # ) + ) +message( "Example Message\n" # "Commented" ) + "Second Line of Example") diff --git a/Tests/RunCMake/Syntax/CommandError0-result.txt b/Tests/RunCMake/Syntax/CommandError0-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/Syntax/CommandError0-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/Syntax/CommandError0-stderr.txt b/Tests/RunCMake/Syntax/CommandError0-stderr.txt new file mode 100644 index 0000000..24d7997 --- /dev/null +++ b/Tests/RunCMake/Syntax/CommandError0-stderr.txt @@ -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 diff --git a/Tests/RunCMake/Syntax/CommandError0.cmake b/Tests/RunCMake/Syntax/CommandError0.cmake new file mode 100644 index 0000000..3222a97 --- /dev/null +++ b/Tests/RunCMake/Syntax/CommandError0.cmake @@ -0,0 +1,2 @@ +message + ("Example Message") diff --git a/Tests/RunCMake/Syntax/CommandError1-result.txt b/Tests/RunCMake/Syntax/CommandError1-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/Syntax/CommandError1-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/Syntax/CommandError1-stderr.txt b/Tests/RunCMake/Syntax/CommandError1-stderr.txt new file mode 100644 index 0000000..599f600 --- /dev/null +++ b/Tests/RunCMake/Syntax/CommandError1-stderr.txt @@ -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 diff --git a/Tests/RunCMake/Syntax/CommandError1.cmake b/Tests/RunCMake/Syntax/CommandError1.cmake new file mode 100644 index 0000000..f8661a1 --- /dev/null +++ b/Tests/RunCMake/Syntax/CommandError1.cmake @@ -0,0 +1 @@ +message("Example Message") message("Second Message") diff --git a/Tests/RunCMake/Syntax/CommandNewlines-stderr.txt b/Tests/RunCMake/Syntax/CommandNewlines-stderr.txt new file mode 100644 index 0000000..571b152 --- /dev/null +++ b/Tests/RunCMake/Syntax/CommandNewlines-stderr.txt @@ -0,0 +1,3 @@ +Example Message +Example Message +Example Message diff --git a/Tests/RunCMake/Syntax/CommandNewlines.cmake b/Tests/RunCMake/Syntax/CommandNewlines.cmake new file mode 100644 index 0000000..0587afb --- /dev/null +++ b/Tests/RunCMake/Syntax/CommandNewlines.cmake @@ -0,0 +1,10 @@ +message( + "Example Message") +message ( + "Example Message" + ) +message( + + "Example Message" + + ) diff --git a/Tests/RunCMake/Syntax/CommandSpaces-stderr.txt b/Tests/RunCMake/Syntax/CommandSpaces-stderr.txt new file mode 100644 index 0000000..54a8b38 --- /dev/null +++ b/Tests/RunCMake/Syntax/CommandSpaces-stderr.txt @@ -0,0 +1,6 @@ +Example Message +Example Message +Example Message +Example Message +Example Message +Example Message diff --git a/Tests/RunCMake/Syntax/CommandSpaces.cmake b/Tests/RunCMake/Syntax/CommandSpaces.cmake new file mode 100644 index 0000000..5bd4294 --- /dev/null +++ b/Tests/RunCMake/Syntax/CommandSpaces.cmake @@ -0,0 +1,6 @@ +message("Example Message") +message ("Example Message") +message( "Example Message" ) +message( "Example Message") + message ( "Example Message") +message ( Example " " Message ) diff --git a/Tests/RunCMake/Syntax/CommandTabs-stderr.txt b/Tests/RunCMake/Syntax/CommandTabs-stderr.txt new file mode 100644 index 0000000..54a8b38 --- /dev/null +++ b/Tests/RunCMake/Syntax/CommandTabs-stderr.txt @@ -0,0 +1,6 @@ +Example Message +Example Message +Example Message +Example Message +Example Message +Example Message diff --git a/Tests/RunCMake/Syntax/CommandTabs.cmake b/Tests/RunCMake/Syntax/CommandTabs.cmake new file mode 100644 index 0000000..93876f8 --- /dev/null +++ b/Tests/RunCMake/Syntax/CommandTabs.cmake @@ -0,0 +1,6 @@ +message("Example Message") +message ("Example Message") +message( "Example Message" ) +message( "Example Message") + message ( "Example Message") +message ( Example " " Message ) diff --git a/Tests/RunCMake/Syntax/RunCMakeTest.cmake b/Tests/RunCMake/Syntax/RunCMakeTest.cmake index f2424c9..b1eeff9 100644 --- a/Tests/RunCMake/Syntax/RunCMakeTest.cmake +++ b/Tests/RunCMake/Syntax/RunCMakeTest.cmake @@ -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) |