diff options
author | Asit Dhal <dhal.asitk@gmail.com> | 2020-06-18 06:26:32 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2020-06-18 14:01:45 (GMT) |
commit | 470b3a76b363951c343d5523bb9de77c9ba4bf16 (patch) | |
tree | 8d08c9ef8389e92506b1312074469b2d0396aa77 /Tests/RunCMake/get_filename_component | |
parent | 0a7a4665beaa5a8af42995410e590bc0731d6748 (diff) | |
download | CMake-470b3a76b363951c343d5523bb9de77c9ba4bf16.zip CMake-470b3a76b363951c343d5523bb9de77c9ba4bf16.tar.gz CMake-470b3a76b363951c343d5523bb9de77c9ba4bf16.tar.bz2 |
get_filename_component: make errors fatal
Make all errors in `get_filename_component` fatal.
Fixes: #20015
Diffstat (limited to 'Tests/RunCMake/get_filename_component')
6 files changed, 11 insertions, 2 deletions
diff --git a/Tests/RunCMake/get_filename_component/IncorrectArguments-result.txt b/Tests/RunCMake/get_filename_component/IncorrectArguments-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/get_filename_component/IncorrectArguments-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/get_filename_component/IncorrectArguments-stderr.txt b/Tests/RunCMake/get_filename_component/IncorrectArguments-stderr.txt new file mode 100644 index 0000000..af08afa --- /dev/null +++ b/Tests/RunCMake/get_filename_component/IncorrectArguments-stderr.txt @@ -0,0 +1,4 @@ +^CMake Error at IncorrectArguments.cmake:1 \(get_filename_component\): + get_filename_component called with incorrect number of arguments +Call Stack \(most recent call first\): + CMakeLists.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/get_filename_component/IncorrectArguments.cmake b/Tests/RunCMake/get_filename_component/IncorrectArguments.cmake new file mode 100644 index 0000000..e329e29 --- /dev/null +++ b/Tests/RunCMake/get_filename_component/IncorrectArguments.cmake @@ -0,0 +1,2 @@ +get_filename_component(var) +message("The error is fatal, so this should not print") diff --git a/Tests/RunCMake/get_filename_component/RunCMakeTest.cmake b/Tests/RunCMake/get_filename_component/RunCMakeTest.cmake index 156fc8f..a7820a0 100644 --- a/Tests/RunCMake/get_filename_component/RunCMakeTest.cmake +++ b/Tests/RunCMake/get_filename_component/RunCMakeTest.cmake @@ -1,4 +1,5 @@ include(RunCMake) +run_cmake(IncorrectArguments) run_cmake(KnownComponents) run_cmake(UnknownComponent) diff --git a/Tests/RunCMake/get_filename_component/UnknownComponent-stderr.txt b/Tests/RunCMake/get_filename_component/UnknownComponent-stderr.txt index b146e5b..f86a688 100644 --- a/Tests/RunCMake/get_filename_component/UnknownComponent-stderr.txt +++ b/Tests/RunCMake/get_filename_component/UnknownComponent-stderr.txt @@ -1,4 +1,4 @@ -CMake Error at UnknownComponent.cmake:1 \(get_filename_component\): +^CMake Error at UnknownComponent.cmake:1 \(get_filename_component\): get_filename_component unknown component BOGUS Call Stack \(most recent call first\): - CMakeLists.txt:[0-9]+ \(include\) + CMakeLists.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/get_filename_component/UnknownComponent.cmake b/Tests/RunCMake/get_filename_component/UnknownComponent.cmake index 06abc51..19521ba 100644 --- a/Tests/RunCMake/get_filename_component/UnknownComponent.cmake +++ b/Tests/RunCMake/get_filename_component/UnknownComponent.cmake @@ -1 +1,2 @@ get_filename_component(var "/path/to/filename.ext.in" BOGUS) +message("The error is fatal, so this should not print") |