diff options
Diffstat (limited to 'Tests')
17 files changed, 52 insertions, 6 deletions
diff --git a/Tests/RunCMake/Syntax/FunctionUnmatchedForeach-result.txt b/Tests/RunCMake/Syntax/FunctionUnmatchedForeach-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/Syntax/FunctionUnmatchedForeach-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/Syntax/FunctionUnmatchedForeach-stderr.txt b/Tests/RunCMake/Syntax/FunctionUnmatchedForeach-stderr.txt new file mode 100644 index 0000000..f4ff709 --- /dev/null +++ b/Tests/RunCMake/Syntax/FunctionUnmatchedForeach-stderr.txt @@ -0,0 +1,8 @@ +^CMake Error at FunctionUnmatchedForeach.cmake:[0-9]+ \(f\): + A logical block opening on the line + + .*/Tests/RunCMake/Syntax/FunctionUnmatchedForeach.cmake:[0-9]+ \(foreach\) + + is not closed. +Call Stack \(most recent call first\): + CMakeLists.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/Syntax/FunctionUnmatchedForeach.cmake b/Tests/RunCMake/Syntax/FunctionUnmatchedForeach.cmake new file mode 100644 index 0000000..ee9c184 --- /dev/null +++ b/Tests/RunCMake/Syntax/FunctionUnmatchedForeach.cmake @@ -0,0 +1,5 @@ +function(f) + foreach(i 1) + #endforeach() # missing +endfunction() +f() diff --git a/Tests/RunCMake/Syntax/MacroUnmatchedForeach-result.txt b/Tests/RunCMake/Syntax/MacroUnmatchedForeach-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/Syntax/MacroUnmatchedForeach-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/Syntax/MacroUnmatchedForeach-stderr.txt b/Tests/RunCMake/Syntax/MacroUnmatchedForeach-stderr.txt new file mode 100644 index 0000000..820cd2e --- /dev/null +++ b/Tests/RunCMake/Syntax/MacroUnmatchedForeach-stderr.txt @@ -0,0 +1,8 @@ +^CMake Error at MacroUnmatchedForeach.cmake:[0-9]+ \(m\): + A logical block opening on the line + + .*/Tests/RunCMake/Syntax/MacroUnmatchedForeach.cmake:[0-9]+ \(foreach\) + + is not closed. +Call Stack \(most recent call first\): + CMakeLists.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/Syntax/MacroUnmatchedForeach.cmake b/Tests/RunCMake/Syntax/MacroUnmatchedForeach.cmake new file mode 100644 index 0000000..be443dd --- /dev/null +++ b/Tests/RunCMake/Syntax/MacroUnmatchedForeach.cmake @@ -0,0 +1,5 @@ +macro(m) + foreach(i 1) + #endforeach() # missing +endmacro() +m() diff --git a/Tests/RunCMake/Syntax/RunCMakeTest.cmake b/Tests/RunCMake/Syntax/RunCMakeTest.cmake index cecd338..c431280 100644 --- a/Tests/RunCMake/Syntax/RunCMakeTest.cmake +++ b/Tests/RunCMake/Syntax/RunCMakeTest.cmake @@ -108,3 +108,7 @@ run_cmake(CMP0053-NameWithNewlineQuoted) run_cmake(CMP0053-NameWithCarriageReturnQuoted) run_cmake(CMP0053-NameWithEscapedSpacesQuoted) run_cmake(CMP0053-NameWithEscapedTabsQuoted) + +# Function and macro tests. +run_cmake(FunctionUnmatchedForeach) +run_cmake(MacroUnmatchedForeach) diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference1-stderr.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference1-stderr.txt index 791c4a9..75a729e 100644 --- a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference1-stderr.txt +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference1-stderr.txt @@ -3,4 +3,4 @@ CMake Error: \$<TARGET_PROPERTY:INCLUDE_DIRECTORIES> - Self reference on target "TargetPropertyGeneratorExpressions".$ + Self reference on target "TargetPropertyGeneratorExpressions". diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference2-stderr.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference2-stderr.txt index 791c4a9..75a729e 100644 --- a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference2-stderr.txt +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference2-stderr.txt @@ -3,4 +3,4 @@ CMake Error: \$<TARGET_PROPERTY:INCLUDE_DIRECTORIES> - Self reference on target "TargetPropertyGeneratorExpressions".$ + Self reference on target "TargetPropertyGeneratorExpressions". diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference3-stderr.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference3-stderr.txt index f60d726..f52a27d 100644 --- a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference3-stderr.txt +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference3-stderr.txt @@ -3,4 +3,4 @@ CMake Error: \$<TARGET_PROPERTY:TargetPropertyGeneratorExpressions,INCLUDE_DIRECTORIES> - Self reference on target "TargetPropertyGeneratorExpressions".$ + Self reference on target "TargetPropertyGeneratorExpressions". diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference4-stderr.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference4-stderr.txt index f60d726..f52a27d 100644 --- a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference4-stderr.txt +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference4-stderr.txt @@ -3,4 +3,4 @@ CMake Error: \$<TARGET_PROPERTY:TargetPropertyGeneratorExpressions,INCLUDE_DIRECTORIES> - Self reference on target "TargetPropertyGeneratorExpressions".$ + Self reference on target "TargetPropertyGeneratorExpressions". diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference5-stderr.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference5-stderr.txt index 2b22d0f..d8d12b5 100644 --- a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference5-stderr.txt +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference5-stderr.txt @@ -3,4 +3,4 @@ CMake Error: \$<TARGET_PROPERTY:COMPILE_DEFINITIONS> - Self reference on target "TargetPropertyGeneratorExpressions".$ + Self reference on target "TargetPropertyGeneratorExpressions". diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference6-stderr.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference6-stderr.txt index fe7caa3..0b1dd26 100644 --- a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference6-stderr.txt +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference6-stderr.txt @@ -3,4 +3,4 @@ CMake Error: \$<TARGET_PROPERTY:TargetPropertyGeneratorExpressions,COMPILE_DEFINITIONS> - Self reference on target "TargetPropertyGeneratorExpressions".$ + Self reference on target "TargetPropertyGeneratorExpressions". diff --git a/Tests/RunCMake/if/RunCMakeTest.cmake b/Tests/RunCMake/if/RunCMakeTest.cmake index 6b6b74b..b5546a7 100644 --- a/Tests/RunCMake/if/RunCMakeTest.cmake +++ b/Tests/RunCMake/if/RunCMakeTest.cmake @@ -2,3 +2,4 @@ include(RunCMake) run_cmake(IsDirectory) run_cmake(IsDirectoryLong) +run_cmake(elseif-message) diff --git a/Tests/RunCMake/if/elseif-message-result.txt b/Tests/RunCMake/if/elseif-message-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/if/elseif-message-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/if/elseif-message-stderr.txt b/Tests/RunCMake/if/elseif-message-stderr.txt new file mode 100644 index 0000000..c73977c --- /dev/null +++ b/Tests/RunCMake/if/elseif-message-stderr.txt @@ -0,0 +1,8 @@ +CMake Error at elseif-message.cmake:[0-9]+ \(elseif\): + given arguments: + + "Unknown" "arguments" + + Unknown arguments specified +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/if/elseif-message.cmake b/Tests/RunCMake/if/elseif-message.cmake new file mode 100644 index 0000000..5930966 --- /dev/null +++ b/Tests/RunCMake/if/elseif-message.cmake @@ -0,0 +1,4 @@ + +if (0) +elseif(Unknown arguments) +endif() |