diff options
Diffstat (limited to 'Tests')
92 files changed, 313 insertions, 40 deletions
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 7dee86a..b9c99e3 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -261,6 +261,23 @@ if(BUILD_TESTING) PASS_REGULAR_EXPRESSION "(file is not of required architecture|does not match cputype|not the architecture being linked)") endif() + if(CMAKE_TEST_GENERATOR MATCHES Make) + set(InterfaceBuildTargets_libname testlib) + if (CMAKE_TEST_GENERATOR MATCHES "Borland|Watcom") + set(InterfaceBuildTargets_libname testlib.lib) + endif() + add_test(InterfaceBuildTargets ${CMAKE_CTEST_COMMAND} + --build-and-test + "${CMake_SOURCE_DIR}/Tests/InterfaceBuildTargets" + "${CMake_BINARY_DIR}/Tests/InterfaceBuildTargets" + --build-two-config + ${build_generator_args} + --build-project InterfaceBuildTargets + --test-command ${CMAKE_CMAKE_COMMAND} -E touch_nocreate ${InterfaceBuildTargets_libname} + ) + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/InterfaceBuildTargets") + endif() + list(APPEND TEST_BUILD_DIRS ${CMake_TEST_INSTALL_PREFIX}) if(NOT QT4_FOUND) diff --git a/Tests/InterfaceBuildTargets/CMakeLists.txt b/Tests/InterfaceBuildTargets/CMakeLists.txt new file mode 100644 index 0000000..a00e5d5 --- /dev/null +++ b/Tests/InterfaceBuildTargets/CMakeLists.txt @@ -0,0 +1,13 @@ +project(InterfaceBuildTargets) + +add_library(testlib EXCLUDE_FROM_ALL testlib.cxx) +set_property(TARGET testlib PROPERTY PREFIX "") +if(CMAKE_GENERATOR MATCHES "Borland|Watcom") + # These librarians add the .lib suffix anyway. + set_property(TARGET testlib PROPERTY SUFFIX ".lib") +else() + set_property(TARGET testlib PROPERTY SUFFIX "") +endif() + +add_library(iface INTERFACE) +target_link_libraries(iface INTERFACE testlib) diff --git a/Tests/InterfaceBuildTargets/main.cxx b/Tests/InterfaceBuildTargets/main.cxx new file mode 100644 index 0000000..e9ad257 --- /dev/null +++ b/Tests/InterfaceBuildTargets/main.cxx @@ -0,0 +1,5 @@ + +int main(int, char**) +{ + return 0; +} diff --git a/Tests/InterfaceBuildTargets/testlib.cxx b/Tests/InterfaceBuildTargets/testlib.cxx new file mode 100644 index 0000000..02bd6b0 --- /dev/null +++ b/Tests/InterfaceBuildTargets/testlib.cxx @@ -0,0 +1,5 @@ + +void testlib(void) +{ + +} diff --git a/Tests/RunCMake/CMP0026/CMakeLists.txt b/Tests/RunCMake/CMP0026/CMakeLists.txt index e8db6b0..12cd3c7 100644 --- a/Tests/RunCMake/CMP0026/CMakeLists.txt +++ b/Tests/RunCMake/CMP0026/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8) +cmake_minimum_required(VERSION 2.8.4) project(${RunCMake_TEST} NONE) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/Syntax/.gitattributes b/Tests/RunCMake/Syntax/.gitattributes index fc9ebff..35a9eaf 100644 --- a/Tests/RunCMake/Syntax/.gitattributes +++ b/Tests/RunCMake/Syntax/.gitattributes @@ -1 +1,3 @@ CommandTabs.cmake whitespace=-tab-in-indent +StringCRLF.cmake whitespace=cr-at-eol -crlf +BracketCRLF.cmake whitespace=cr-at-eol -crlf diff --git a/Tests/RunCMake/Syntax/BOM-UTF-16-BE-result.txt b/Tests/RunCMake/Syntax/BOM-UTF-16-BE-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/Syntax/BOM-UTF-16-BE-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/Syntax/BOM-UTF-16-BE-stderr.txt b/Tests/RunCMake/Syntax/BOM-UTF-16-BE-stderr.txt new file mode 100644 index 0000000..b3f1e47 --- /dev/null +++ b/Tests/RunCMake/Syntax/BOM-UTF-16-BE-stderr.txt @@ -0,0 +1,6 @@ +CMake Error at CMakeLists.txt:3 \(include\): + File + + .*/Tests/RunCMake/Syntax/BOM-UTF-16-BE.cmake + + starts with a Byte-Order-Mark that is not UTF-8. diff --git a/Tests/RunCMake/Syntax/BOM-UTF-16-BE.cmake b/Tests/RunCMake/Syntax/BOM-UTF-16-BE.cmake Binary files differnew file mode 100644 index 0000000..c51f6e6 --- /dev/null +++ b/Tests/RunCMake/Syntax/BOM-UTF-16-BE.cmake diff --git a/Tests/RunCMake/Syntax/BOM-UTF-16-LE-result.txt b/Tests/RunCMake/Syntax/BOM-UTF-16-LE-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/Syntax/BOM-UTF-16-LE-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/Syntax/BOM-UTF-16-LE-stderr.txt b/Tests/RunCMake/Syntax/BOM-UTF-16-LE-stderr.txt new file mode 100644 index 0000000..c08c902 --- /dev/null +++ b/Tests/RunCMake/Syntax/BOM-UTF-16-LE-stderr.txt @@ -0,0 +1,6 @@ +CMake Error at CMakeLists.txt:3 \(include\): + File + + .*/Tests/RunCMake/Syntax/BOM-UTF-16-LE.cmake + + starts with a Byte-Order-Mark that is not UTF-8. diff --git a/Tests/RunCMake/Syntax/BOM-UTF-16-LE.cmake b/Tests/RunCMake/Syntax/BOM-UTF-16-LE.cmake Binary files differnew file mode 100644 index 0000000..b57446f --- /dev/null +++ b/Tests/RunCMake/Syntax/BOM-UTF-16-LE.cmake diff --git a/Tests/RunCMake/Syntax/BOM-UTF-32-BE-result.txt b/Tests/RunCMake/Syntax/BOM-UTF-32-BE-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/Syntax/BOM-UTF-32-BE-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/Syntax/BOM-UTF-32-BE-stderr.txt b/Tests/RunCMake/Syntax/BOM-UTF-32-BE-stderr.txt new file mode 100644 index 0000000..5dde4e3 --- /dev/null +++ b/Tests/RunCMake/Syntax/BOM-UTF-32-BE-stderr.txt @@ -0,0 +1,6 @@ +CMake Error at CMakeLists.txt:3 \(include\): + File + + .*/Tests/RunCMake/Syntax/BOM-UTF-32-BE.cmake + + starts with a Byte-Order-Mark that is not UTF-8. diff --git a/Tests/RunCMake/Syntax/BOM-UTF-32-BE.cmake b/Tests/RunCMake/Syntax/BOM-UTF-32-BE.cmake Binary files differnew file mode 100644 index 0000000..23c57f3 --- /dev/null +++ b/Tests/RunCMake/Syntax/BOM-UTF-32-BE.cmake diff --git a/Tests/RunCMake/Syntax/BOM-UTF-32-LE-result.txt b/Tests/RunCMake/Syntax/BOM-UTF-32-LE-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/Syntax/BOM-UTF-32-LE-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/Syntax/BOM-UTF-32-LE-stderr.txt b/Tests/RunCMake/Syntax/BOM-UTF-32-LE-stderr.txt new file mode 100644 index 0000000..eb054ec --- /dev/null +++ b/Tests/RunCMake/Syntax/BOM-UTF-32-LE-stderr.txt @@ -0,0 +1,6 @@ +CMake Error at CMakeLists.txt:3 \(include\): + File + + .*/Tests/RunCMake/Syntax/BOM-UTF-32-LE.cmake + + starts with a Byte-Order-Mark that is not UTF-8. diff --git a/Tests/RunCMake/Syntax/BOM-UTF-32-LE.cmake b/Tests/RunCMake/Syntax/BOM-UTF-32-LE.cmake Binary files differnew file mode 100644 index 0000000..c330f5b --- /dev/null +++ b/Tests/RunCMake/Syntax/BOM-UTF-32-LE.cmake diff --git a/Tests/RunCMake/Syntax/BOM-UTF-8-stdout.txt b/Tests/RunCMake/Syntax/BOM-UTF-8-stdout.txt new file mode 100644 index 0000000..5776d6e --- /dev/null +++ b/Tests/RunCMake/Syntax/BOM-UTF-8-stdout.txt @@ -0,0 +1 @@ +-- message diff --git a/Tests/RunCMake/Syntax/BOM-UTF-8.cmake b/Tests/RunCMake/Syntax/BOM-UTF-8.cmake new file mode 100644 index 0000000..bdff83b --- /dev/null +++ b/Tests/RunCMake/Syntax/BOM-UTF-8.cmake @@ -0,0 +1 @@ +message(STATUS "message") diff --git a/Tests/RunCMake/Syntax/Bracket0-stderr.txt b/Tests/RunCMake/Syntax/Bracket0-stderr.txt new file mode 100644 index 0000000..39cc2bc --- /dev/null +++ b/Tests/RunCMake/Syntax/Bracket0-stderr.txt @@ -0,0 +1 @@ +^1 \${var} \\n 4$ diff --git a/Tests/RunCMake/Syntax/Bracket0.cmake b/Tests/RunCMake/Syntax/Bracket0.cmake new file mode 100644 index 0000000..4bc0172 --- /dev/null +++ b/Tests/RunCMake/Syntax/Bracket0.cmake @@ -0,0 +1 @@ +message([[1 ${var} \n 4]]) diff --git a/Tests/RunCMake/Syntax/Bracket1-stderr.txt b/Tests/RunCMake/Syntax/Bracket1-stderr.txt new file mode 100644 index 0000000..e1e13c1 --- /dev/null +++ b/Tests/RunCMake/Syntax/Bracket1-stderr.txt @@ -0,0 +1 @@ +^1 \${var} \\n 4\]==$ diff --git a/Tests/RunCMake/Syntax/Bracket1.cmake b/Tests/RunCMake/Syntax/Bracket1.cmake new file mode 100644 index 0000000..587a575 --- /dev/null +++ b/Tests/RunCMake/Syntax/Bracket1.cmake @@ -0,0 +1,2 @@ +message([==[1 ]==] [=[ +${var} \n 4]==]=]) diff --git a/Tests/RunCMake/Syntax/Bracket2-stdout.txt b/Tests/RunCMake/Syntax/Bracket2-stdout.txt new file mode 100644 index 0000000..0f8aa2f --- /dev/null +++ b/Tests/RunCMake/Syntax/Bracket2-stdout.txt @@ -0,0 +1,2 @@ +-- Bracket Argument 1 +-- Bracket Argument 2 diff --git a/Tests/RunCMake/Syntax/Bracket2.cmake b/Tests/RunCMake/Syntax/Bracket2.cmake new file mode 100644 index 0000000..5c5feed --- /dev/null +++ b/Tests/RunCMake/Syntax/Bracket2.cmake @@ -0,0 +1,2 @@ +message(STATUS [[Bracket Argument 1]] #[[Bracket Comment 1]]) +message(STATUS #[[Bracket Comment 2]] [[Bracket Argument 2]]) diff --git a/Tests/RunCMake/Syntax/BracketBackslash-result.txt b/Tests/RunCMake/Syntax/BracketBackslash-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/Syntax/BracketBackslash-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/Syntax/BracketBackslash-stderr.txt b/Tests/RunCMake/Syntax/BracketBackslash-stderr.txt new file mode 100644 index 0000000..b746953 --- /dev/null +++ b/Tests/RunCMake/Syntax/BracketBackslash-stderr.txt @@ -0,0 +1,6 @@ +CMake Error at BracketBackslash.cmake:1 \(message\): + a\\ + + b +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/Syntax/BracketBackslash.cmake b/Tests/RunCMake/Syntax/BracketBackslash.cmake new file mode 100644 index 0000000..5478e5d --- /dev/null +++ b/Tests/RunCMake/Syntax/BracketBackslash.cmake @@ -0,0 +1,2 @@ +message(FATAL_ERROR [==[a\ +b]==]) diff --git a/Tests/RunCMake/Syntax/BracketCRLF-stderr.txt b/Tests/RunCMake/Syntax/BracketCRLF-stderr.txt new file mode 100644 index 0000000..7aef26e --- /dev/null +++ b/Tests/RunCMake/Syntax/BracketCRLF-stderr.txt @@ -0,0 +1 @@ +CRLF->LF worked diff --git a/Tests/RunCMake/Syntax/BracketCRLF.cmake b/Tests/RunCMake/Syntax/BracketCRLF.cmake new file mode 100644 index 0000000..bda0e17 --- /dev/null +++ b/Tests/RunCMake/Syntax/BracketCRLF.cmake @@ -0,0 +1,8 @@ +if([[
+]] STREQUAL "" AND
+[[a
+b]] STREQUAL "a\nb")
+ message("CRLF->LF worked")
+else()
+ message(FATAL_ERROR "CRLF->LF failed")
+endif()
diff --git a/Tests/RunCMake/Syntax/BracketComment0-stdout.txt b/Tests/RunCMake/Syntax/BracketComment0-stdout.txt new file mode 100644 index 0000000..c9c0be4 --- /dev/null +++ b/Tests/RunCMake/Syntax/BracketComment0-stdout.txt @@ -0,0 +1 @@ +-- The above FATAL_ERROR did not occur. diff --git a/Tests/RunCMake/Syntax/BracketComment0.cmake b/Tests/RunCMake/Syntax/BracketComment0.cmake new file mode 100644 index 0000000..0ee95de --- /dev/null +++ b/Tests/RunCMake/Syntax/BracketComment0.cmake @@ -0,0 +1,5 @@ +#[=[ +#]] +message(FATAL_ERROR "This is commented out.") +#]==]=] +message(STATUS "The above FATAL_ERROR did not occur.") diff --git a/Tests/RunCMake/Syntax/BracketComment1-result.txt b/Tests/RunCMake/Syntax/BracketComment1-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/Syntax/BracketComment1-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/Syntax/BracketComment1-stderr.txt b/Tests/RunCMake/Syntax/BracketComment1-stderr.txt new file mode 100644 index 0000000..a9373de --- /dev/null +++ b/Tests/RunCMake/Syntax/BracketComment1-stderr.txt @@ -0,0 +1,4 @@ +CMake Error at BracketComment1.cmake:2 \(message\): + This is not commented out. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/Syntax/BracketComment1.cmake b/Tests/RunCMake/Syntax/BracketComment1.cmake new file mode 100644 index 0000000..2ec9d20 --- /dev/null +++ b/Tests/RunCMake/Syntax/BracketComment1.cmake @@ -0,0 +1,3 @@ +##[[ +message(FATAL_ERROR "This is not commented out.") +#]] diff --git a/Tests/RunCMake/Syntax/BracketComment2-result.txt b/Tests/RunCMake/Syntax/BracketComment2-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/Syntax/BracketComment2-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/Syntax/BracketComment2-stderr.txt b/Tests/RunCMake/Syntax/BracketComment2-stderr.txt new file mode 100644 index 0000000..7e98222 --- /dev/null +++ b/Tests/RunCMake/Syntax/BracketComment2-stderr.txt @@ -0,0 +1,4 @@ +CMake Error at BracketComment2.cmake:2 \(message\): + This is not commented out. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/Syntax/BracketComment2.cmake b/Tests/RunCMake/Syntax/BracketComment2.cmake new file mode 100644 index 0000000..3eda32d --- /dev/null +++ b/Tests/RunCMake/Syntax/BracketComment2.cmake @@ -0,0 +1,3 @@ +# [[ +message(FATAL_ERROR "This is not commented out.") +#]] diff --git a/Tests/RunCMake/Syntax/BracketComment3-stdout.txt b/Tests/RunCMake/Syntax/BracketComment3-stdout.txt new file mode 100644 index 0000000..c9c0be4 --- /dev/null +++ b/Tests/RunCMake/Syntax/BracketComment3-stdout.txt @@ -0,0 +1 @@ +-- The above FATAL_ERROR did not occur. diff --git a/Tests/RunCMake/Syntax/BracketComment3.cmake b/Tests/RunCMake/Syntax/BracketComment3.cmake new file mode 100644 index 0000000..ffd03a9 --- /dev/null +++ b/Tests/RunCMake/Syntax/BracketComment3.cmake @@ -0,0 +1,4 @@ +#[[Text on opening line +message(FATAL_ERROR "This is commented out.") +#]=]] +message(STATUS "The above FATAL_ERROR did not occur.") diff --git a/Tests/RunCMake/Syntax/BracketComment4-result.txt b/Tests/RunCMake/Syntax/BracketComment4-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/Syntax/BracketComment4-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/Syntax/BracketComment4-stderr.txt b/Tests/RunCMake/Syntax/BracketComment4-stderr.txt new file mode 100644 index 0000000..8ba32c2 --- /dev/null +++ b/Tests/RunCMake/Syntax/BracketComment4-stderr.txt @@ -0,0 +1,7 @@ +CMake Error: Error in cmake code at +.*/Tests/RunCMake/Syntax/BracketComment4.cmake:3: +Parse error. Expected a newline, got identifier with text "message". +CMake Error at CMakeLists.txt:3 \(include\): + include could not find load file: + + BracketComment4.cmake diff --git a/Tests/RunCMake/Syntax/BracketComment4.cmake b/Tests/RunCMake/Syntax/BracketComment4.cmake new file mode 100644 index 0000000..9d586f1 --- /dev/null +++ b/Tests/RunCMake/Syntax/BracketComment4.cmake @@ -0,0 +1,3 @@ +#[[ +message(FATAL_ERROR "This is commented out.") +#]] message(STATUS "This command not allowed here") diff --git a/Tests/RunCMake/Syntax/BracketComment5-stdout.txt b/Tests/RunCMake/Syntax/BracketComment5-stdout.txt new file mode 100644 index 0000000..c9c0be4 --- /dev/null +++ b/Tests/RunCMake/Syntax/BracketComment5-stdout.txt @@ -0,0 +1 @@ +-- The above FATAL_ERROR did not occur. diff --git a/Tests/RunCMake/Syntax/BracketComment5.cmake b/Tests/RunCMake/Syntax/BracketComment5.cmake new file mode 100644 index 0000000..bb6d9f3 --- /dev/null +++ b/Tests/RunCMake/Syntax/BracketComment5.cmake @@ -0,0 +1,6 @@ +#[[ +message(FATAL_ERROR "This is commented out.") +#]] #[[ +message(FATAL_ERROR "This is commented out.") +#]] #message(FATAL_ERROR "This is commented out.") +message(STATUS "The above FATAL_ERROR did not occur.") diff --git a/Tests/RunCMake/Syntax/BracketNoSpace0-result.txt b/Tests/RunCMake/Syntax/BracketNoSpace0-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/Syntax/BracketNoSpace0-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/Syntax/BracketNoSpace0-stderr.txt b/Tests/RunCMake/Syntax/BracketNoSpace0-stderr.txt new file mode 100644 index 0000000..afd91f9 --- /dev/null +++ b/Tests/RunCMake/Syntax/BracketNoSpace0-stderr.txt @@ -0,0 +1,6 @@ +CMake Error at CMakeLists.txt:3 \(include\): + Syntax Error in cmake code at + + .*/Tests/RunCMake/Syntax/BracketNoSpace0.cmake:1:27 + + Argument not separated from preceding token by whitespace. diff --git a/Tests/RunCMake/Syntax/BracketNoSpace0.cmake b/Tests/RunCMake/Syntax/BracketNoSpace0.cmake new file mode 100644 index 0000000..1de1450 --- /dev/null +++ b/Tests/RunCMake/Syntax/BracketNoSpace0.cmake @@ -0,0 +1 @@ +message(STATUS [[bracket]]unquoted) diff --git a/Tests/RunCMake/Syntax/BracketNoSpace1-result.txt b/Tests/RunCMake/Syntax/BracketNoSpace1-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/Syntax/BracketNoSpace1-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/Syntax/BracketNoSpace1-stderr.txt b/Tests/RunCMake/Syntax/BracketNoSpace1-stderr.txt new file mode 100644 index 0000000..826e511 --- /dev/null +++ b/Tests/RunCMake/Syntax/BracketNoSpace1-stderr.txt @@ -0,0 +1,6 @@ +CMake Error at CMakeLists.txt:3 \(include\): + Syntax Error in cmake code at + + .*/Tests/RunCMake/Syntax/BracketNoSpace1.cmake:1:24 + + Argument not separated from preceding token by whitespace. diff --git a/Tests/RunCMake/Syntax/BracketNoSpace1.cmake b/Tests/RunCMake/Syntax/BracketNoSpace1.cmake new file mode 100644 index 0000000..7982bf3 --- /dev/null +++ b/Tests/RunCMake/Syntax/BracketNoSpace1.cmake @@ -0,0 +1 @@ +message(STATUS "string"[[bracket]]) diff --git a/Tests/RunCMake/Syntax/BracketNoSpace2-result.txt b/Tests/RunCMake/Syntax/BracketNoSpace2-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/Syntax/BracketNoSpace2-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/Syntax/BracketNoSpace2-stderr.txt b/Tests/RunCMake/Syntax/BracketNoSpace2-stderr.txt new file mode 100644 index 0000000..23ecdcd --- /dev/null +++ b/Tests/RunCMake/Syntax/BracketNoSpace2-stderr.txt @@ -0,0 +1,6 @@ +CMake Error at CMakeLists.txt:3 \(include\): + Syntax Error in cmake code at + + .*/Tests/RunCMake/Syntax/BracketNoSpace2.cmake:1:44 + + Argument not separated from preceding token by whitespace. diff --git a/Tests/RunCMake/Syntax/BracketNoSpace2.cmake b/Tests/RunCMake/Syntax/BracketNoSpace2.cmake new file mode 100644 index 0000000..f1507f3 --- /dev/null +++ b/Tests/RunCMake/Syntax/BracketNoSpace2.cmake @@ -0,0 +1 @@ +message(STATUS "string"#[[bracket comment]][[bracket]]) diff --git a/Tests/RunCMake/Syntax/BracketNoSpace3-result.txt b/Tests/RunCMake/Syntax/BracketNoSpace3-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/Syntax/BracketNoSpace3-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/Syntax/BracketNoSpace3-stderr.txt b/Tests/RunCMake/Syntax/BracketNoSpace3-stderr.txt new file mode 100644 index 0000000..906d6fc --- /dev/null +++ b/Tests/RunCMake/Syntax/BracketNoSpace3-stderr.txt @@ -0,0 +1,6 @@ +CMake Error at CMakeLists.txt:3 \(include\): + Syntax Error in cmake code at + + .*/Tests/RunCMake/Syntax/BracketNoSpace3.cmake:1:45 + + Argument not separated from preceding token by whitespace. diff --git a/Tests/RunCMake/Syntax/BracketNoSpace3.cmake b/Tests/RunCMake/Syntax/BracketNoSpace3.cmake new file mode 100644 index 0000000..45dc900 --- /dev/null +++ b/Tests/RunCMake/Syntax/BracketNoSpace3.cmake @@ -0,0 +1 @@ +message(STATUS "string" #[[bracket comment]][[bracket]]) diff --git a/Tests/RunCMake/Syntax/BracketNoSpace4-result.txt b/Tests/RunCMake/Syntax/BracketNoSpace4-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/Syntax/BracketNoSpace4-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/Syntax/BracketNoSpace4-stderr.txt b/Tests/RunCMake/Syntax/BracketNoSpace4-stderr.txt new file mode 100644 index 0000000..a461e93 --- /dev/null +++ b/Tests/RunCMake/Syntax/BracketNoSpace4-stderr.txt @@ -0,0 +1,6 @@ +CMake Error at CMakeLists.txt:3 \(include\): + Syntax Error in cmake code at + + .*/Tests/RunCMake/Syntax/BracketNoSpace4.cmake:1:44 + + Argument not separated from preceding token by whitespace. diff --git a/Tests/RunCMake/Syntax/BracketNoSpace4.cmake b/Tests/RunCMake/Syntax/BracketNoSpace4.cmake new file mode 100644 index 0000000..cb4ddbe --- /dev/null +++ b/Tests/RunCMake/Syntax/BracketNoSpace4.cmake @@ -0,0 +1 @@ +message(STATUS "string"#[[bracket comment]]"string") diff --git a/Tests/RunCMake/Syntax/BracketNoSpace5-result.txt b/Tests/RunCMake/Syntax/BracketNoSpace5-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/Syntax/BracketNoSpace5-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/Syntax/BracketNoSpace5-stderr.txt b/Tests/RunCMake/Syntax/BracketNoSpace5-stderr.txt new file mode 100644 index 0000000..ff8bf1c --- /dev/null +++ b/Tests/RunCMake/Syntax/BracketNoSpace5-stderr.txt @@ -0,0 +1,6 @@ +CMake Error at CMakeLists.txt:3 \(include\): + Syntax Error in cmake code at + + .*/Tests/RunCMake/Syntax/BracketNoSpace5.cmake:1:45 + + Argument not separated from preceding token by whitespace. diff --git a/Tests/RunCMake/Syntax/BracketNoSpace5.cmake b/Tests/RunCMake/Syntax/BracketNoSpace5.cmake new file mode 100644 index 0000000..c684523 --- /dev/null +++ b/Tests/RunCMake/Syntax/BracketNoSpace5.cmake @@ -0,0 +1 @@ +message(STATUS "string" #[[bracket comment]]"string") diff --git a/Tests/RunCMake/Syntax/BracketWarn-stderr.txt b/Tests/RunCMake/Syntax/BracketWarn-stderr.txt deleted file mode 100644 index 4a9cca6..0000000 --- a/Tests/RunCMake/Syntax/BracketWarn-stderr.txt +++ /dev/null @@ -1,35 +0,0 @@ -CMake Warning \(dev\) at CMakeLists.txt:3 \(include\): - Syntax Warning in cmake code at - - .*/Tests/RunCMake/Syntax/BracketWarn.cmake:1:16 - - A future version of CMake may treat unquoted argument: - - \[\[ - - as an opening long bracket. Double-quote the argument. -This warning is for project developers. Use -Wno-dev to suppress it. - -CMake Warning \(dev\) at CMakeLists.txt:3 \(include\): - Syntax Warning in cmake code at - - .*/Tests/RunCMake/Syntax/BracketWarn.cmake:1:19 - - A future version of CMake may treat unquoted argument: - - \[=\[ - - as an opening long bracket. Double-quote the argument. -This warning is for project developers. Use -Wno-dev to suppress it. - -CMake Warning \(dev\) at CMakeLists.txt:3 \(include\): - Syntax Warning in cmake code at - - .*/Tests/RunCMake/Syntax/BracketWarn.cmake:1:27 - - A future version of CMake may treat unquoted argument: - - \[==\[x - - as an opening long bracket. Double-quote the argument. -This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/Syntax/BracketWarn-stdout.txt b/Tests/RunCMake/Syntax/BracketWarn-stdout.txt deleted file mode 100644 index 01b2caa..0000000 --- a/Tests/RunCMake/Syntax/BracketWarn-stdout.txt +++ /dev/null @@ -1 +0,0 @@ --- \[\[\[=\[\[=x\[==\[x diff --git a/Tests/RunCMake/Syntax/BracketWarn.cmake b/Tests/RunCMake/Syntax/BracketWarn.cmake deleted file mode 100644 index 8f33946..0000000 --- a/Tests/RunCMake/Syntax/BracketWarn.cmake +++ /dev/null @@ -1 +0,0 @@ -message(STATUS [[ [=[ [=x [==[x) diff --git a/Tests/RunCMake/Syntax/CommandError2-result.txt b/Tests/RunCMake/Syntax/CommandError2-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/Syntax/CommandError2-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/Syntax/CommandError2-stderr.txt b/Tests/RunCMake/Syntax/CommandError2-stderr.txt new file mode 100644 index 0000000..f4dfc77 --- /dev/null +++ b/Tests/RunCMake/Syntax/CommandError2-stderr.txt @@ -0,0 +1,7 @@ +CMake Error: Error in cmake code at +.*/Tests/RunCMake/Syntax/CommandError2.cmake:1: +Parse error. Expected a command name, got bracket argument with text "oops-not-a-comment". +CMake Error at CMakeLists.txt:3 \(include\): + include could not find load file: + + CommandError2.cmake diff --git a/Tests/RunCMake/Syntax/CommandError2.cmake b/Tests/RunCMake/Syntax/CommandError2.cmake new file mode 100644 index 0000000..a269682 --- /dev/null +++ b/Tests/RunCMake/Syntax/CommandError2.cmake @@ -0,0 +1 @@ +message("Example Message") [[oops-not-a-comment]] diff --git a/Tests/RunCMake/Syntax/OneLetter-stderr.txt b/Tests/RunCMake/Syntax/OneLetter-stderr.txt new file mode 100644 index 0000000..87c01c7 --- /dev/null +++ b/Tests/RunCMake/Syntax/OneLetter-stderr.txt @@ -0,0 +1 @@ +message diff --git a/Tests/RunCMake/Syntax/OneLetter.cmake b/Tests/RunCMake/Syntax/OneLetter.cmake new file mode 100644 index 0000000..3c341fa --- /dev/null +++ b/Tests/RunCMake/Syntax/OneLetter.cmake @@ -0,0 +1,7 @@ +function(f) + g(${ARGN}) +endfunction() +macro(g) + message(${ARGN}) +endmacro() +f(message) diff --git a/Tests/RunCMake/Syntax/ParenNoSpace0-stdout.txt b/Tests/RunCMake/Syntax/ParenNoSpace0-stdout.txt new file mode 100644 index 0000000..5c4076f --- /dev/null +++ b/Tests/RunCMake/Syntax/ParenNoSpace0-stdout.txt @@ -0,0 +1,3 @@ +-- \(unquoted\) +-- \(quoted\) +-- \(bracket\) diff --git a/Tests/RunCMake/Syntax/ParenNoSpace0.cmake b/Tests/RunCMake/Syntax/ParenNoSpace0.cmake new file mode 100644 index 0000000..175fe4a --- /dev/null +++ b/Tests/RunCMake/Syntax/ParenNoSpace0.cmake @@ -0,0 +1,3 @@ +message(STATUS (unquoted)) +message(STATUS ("quoted")) +message(STATUS ([[bracket]])) diff --git a/Tests/RunCMake/Syntax/ParenNoSpace1-result.txt b/Tests/RunCMake/Syntax/ParenNoSpace1-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/Syntax/ParenNoSpace1-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/Syntax/ParenNoSpace1-stderr.txt b/Tests/RunCMake/Syntax/ParenNoSpace1-stderr.txt new file mode 100644 index 0000000..64ef8b1 --- /dev/null +++ b/Tests/RunCMake/Syntax/ParenNoSpace1-stderr.txt @@ -0,0 +1,22 @@ +CMake Warning \(dev\) at CMakeLists.txt:3 \(include\): + Syntax Warning in cmake code at + + .*/Tests/RunCMake/Syntax/ParenNoSpace1.cmake:1:26 + + Argument not separated from preceding token by whitespace. +This warning is for project developers. Use -Wno-dev to suppress it. + +CMake Warning \(dev\) at CMakeLists.txt:3 \(include\): + Syntax Warning in cmake code at + + .*/Tests/RunCMake/Syntax/ParenNoSpace1.cmake:2:26 + + Argument not separated from preceding token by whitespace. +This warning is for project developers. Use -Wno-dev to suppress it. + +CMake Error at CMakeLists.txt:3 \(include\): + Syntax Error in cmake code at + + .*/Tests/RunCMake/Syntax/ParenNoSpace1.cmake:3:29 + + Argument not separated from preceding token by whitespace. diff --git a/Tests/RunCMake/Syntax/ParenNoSpace1.cmake b/Tests/RunCMake/Syntax/ParenNoSpace1.cmake new file mode 100644 index 0000000..550339a --- /dev/null +++ b/Tests/RunCMake/Syntax/ParenNoSpace1.cmake @@ -0,0 +1,3 @@ +message(STATUS (unquoted)unquoted) +message(STATUS ("quoted")"quoted") +message(STATUS ([[bracket]])[[bracket]]) diff --git a/Tests/RunCMake/Syntax/ParenNoSpace-stderr.txt b/Tests/RunCMake/Syntax/ParenNoSpace2-stderr.txt index 10f3293..10f3293 100644 --- a/Tests/RunCMake/Syntax/ParenNoSpace-stderr.txt +++ b/Tests/RunCMake/Syntax/ParenNoSpace2-stderr.txt diff --git a/Tests/RunCMake/Syntax/ParenNoSpace-stdout.txt b/Tests/RunCMake/Syntax/ParenNoSpace2-stdout.txt index 72addd7..0e657b9 100644 --- a/Tests/RunCMake/Syntax/ParenNoSpace-stdout.txt +++ b/Tests/RunCMake/Syntax/ParenNoSpace2-stdout.txt @@ -1,2 +1,3 @@ -- unquoted\(unquoted\) -- quoted\(quoted\) +-- bracket\(bracket\) diff --git a/Tests/RunCMake/Syntax/ParenNoSpace.cmake b/Tests/RunCMake/Syntax/ParenNoSpace2.cmake index c690d96..c46a887 100644 --- a/Tests/RunCMake/Syntax/ParenNoSpace.cmake +++ b/Tests/RunCMake/Syntax/ParenNoSpace2.cmake @@ -1,2 +1,3 @@ message(STATUS unquoted(unquoted)) message(STATUS "quoted"("quoted")) +message(STATUS [[bracket]]([[bracket]])) diff --git a/Tests/RunCMake/Syntax/RunCMakeTest.cmake b/Tests/RunCMake/Syntax/RunCMakeTest.cmake index 94963f3..f5e0d11 100644 --- a/Tests/RunCMake/Syntax/RunCMakeTest.cmake +++ b/Tests/RunCMake/Syntax/RunCMakeTest.cmake @@ -1,18 +1,47 @@ include(RunCMake) +run_cmake(BOM-UTF-8) +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(CommandSpaces) run_cmake(CommandTabs) run_cmake(CommandNewlines) run_cmake(CommandComments) run_cmake(CommandError0) run_cmake(CommandError1) +run_cmake(CommandError2) run_cmake(String0) run_cmake(String1) +run_cmake(StringCRLF) run_cmake(StringNoSpace) +run_cmake(OneLetter) run_cmake(Unquoted0) run_cmake(Unquoted1) -run_cmake(ParenNoSpace) +run_cmake(Bracket0) +run_cmake(Bracket1) +run_cmake(Bracket2) +run_cmake(BracketBackslash) +run_cmake(BracketCRLF) +run_cmake(BracketComment0) +run_cmake(BracketComment1) +run_cmake(BracketComment2) +run_cmake(BracketComment3) +run_cmake(BracketComment4) +run_cmake(BracketComment5) +run_cmake(BracketNoSpace0) +run_cmake(BracketNoSpace1) +run_cmake(BracketNoSpace2) +run_cmake(BracketNoSpace3) +run_cmake(BracketNoSpace4) +run_cmake(BracketNoSpace5) +run_cmake(ParenNoSpace0) +run_cmake(ParenNoSpace1) +run_cmake(ParenNoSpace2) run_cmake(UnterminatedCall1) run_cmake(UnterminatedCall2) run_cmake(UnterminatedString) -run_cmake(BracketWarn) +run_cmake(UnterminatedBracket0) +run_cmake(UnterminatedBracket1) +run_cmake(UnterminatedBracketComment) diff --git a/Tests/RunCMake/Syntax/StringCRLF-stderr.txt b/Tests/RunCMake/Syntax/StringCRLF-stderr.txt new file mode 100644 index 0000000..7aef26e --- /dev/null +++ b/Tests/RunCMake/Syntax/StringCRLF-stderr.txt @@ -0,0 +1 @@ +CRLF->LF worked diff --git a/Tests/RunCMake/Syntax/StringCRLF.cmake b/Tests/RunCMake/Syntax/StringCRLF.cmake new file mode 100644 index 0000000..d20cfea --- /dev/null +++ b/Tests/RunCMake/Syntax/StringCRLF.cmake @@ -0,0 +1,6 @@ +if("a
+b" STREQUAL "a\nb")
+ message("CRLF->LF worked")
+else()
+ message(FATAL_ERROR "CRLF->LF failed")
+endif()
diff --git a/Tests/RunCMake/Syntax/UnterminatedBracket0-result.txt b/Tests/RunCMake/Syntax/UnterminatedBracket0-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/Syntax/UnterminatedBracket0-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/Syntax/UnterminatedBracket0-stderr.txt b/Tests/RunCMake/Syntax/UnterminatedBracket0-stderr.txt new file mode 100644 index 0000000..3559c18 --- /dev/null +++ b/Tests/RunCMake/Syntax/UnterminatedBracket0-stderr.txt @@ -0,0 +1,8 @@ +CMake Error: Error in cmake code at +.*/Syntax/UnterminatedBracket0.cmake:2: +Parse error. Function missing ending "\)". Instead found unterminated bracket with text "\) +". +CMake Error at CMakeLists.txt:3 \(include\): + include could not find load file: + + UnterminatedBracket0.cmake$ diff --git a/Tests/RunCMake/Syntax/UnterminatedBracket0.cmake b/Tests/RunCMake/Syntax/UnterminatedBracket0.cmake new file mode 100644 index 0000000..98cd906 --- /dev/null +++ b/Tests/RunCMake/Syntax/UnterminatedBracket0.cmake @@ -0,0 +1 @@ +set(var [[) diff --git a/Tests/RunCMake/Syntax/UnterminatedBracket1-result.txt b/Tests/RunCMake/Syntax/UnterminatedBracket1-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/Syntax/UnterminatedBracket1-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/Syntax/UnterminatedBracket1-stderr.txt b/Tests/RunCMake/Syntax/UnterminatedBracket1-stderr.txt new file mode 100644 index 0000000..55d458b --- /dev/null +++ b/Tests/RunCMake/Syntax/UnterminatedBracket1-stderr.txt @@ -0,0 +1,8 @@ +CMake Error: Error in cmake code at +.*/Syntax/UnterminatedBracket1.cmake:2: +Parse error. Function missing ending "\)". Instead found unterminated bracket with text "\]\]\) +". +CMake Error at CMakeLists.txt:3 \(include\): + include could not find load file: + + UnterminatedBracket1.cmake$ diff --git a/Tests/RunCMake/Syntax/UnterminatedBracket1.cmake b/Tests/RunCMake/Syntax/UnterminatedBracket1.cmake new file mode 100644 index 0000000..706f7a3 --- /dev/null +++ b/Tests/RunCMake/Syntax/UnterminatedBracket1.cmake @@ -0,0 +1 @@ +set(var [=[]]) diff --git a/Tests/RunCMake/Syntax/UnterminatedBracketComment-result.txt b/Tests/RunCMake/Syntax/UnterminatedBracketComment-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/Syntax/UnterminatedBracketComment-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/Syntax/UnterminatedBracketComment-stderr.txt b/Tests/RunCMake/Syntax/UnterminatedBracketComment-stderr.txt new file mode 100644 index 0000000..0a799eb --- /dev/null +++ b/Tests/RunCMake/Syntax/UnterminatedBracketComment-stderr.txt @@ -0,0 +1,8 @@ +CMake Error: Error in cmake code at +.*/Syntax/UnterminatedBracketComment.cmake:1: +Parse error. Expected a command name, got unterminated bracket with text "#\]\] +". +CMake Error at CMakeLists.txt:3 \(include\): + include could not find load file: + + UnterminatedBracketComment.cmake diff --git a/Tests/RunCMake/Syntax/UnterminatedBracketComment.cmake b/Tests/RunCMake/Syntax/UnterminatedBracketComment.cmake new file mode 100644 index 0000000..ad71f3c --- /dev/null +++ b/Tests/RunCMake/Syntax/UnterminatedBracketComment.cmake @@ -0,0 +1,2 @@ +#[=[ +#]] |