diff options
author | Brad King <brad.king@kitware.com> | 2020-10-16 13:19:33 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2020-10-16 13:22:32 (GMT) |
commit | ce11bace37692853382757c28eca34e8b6a32d2d (patch) | |
tree | cba42808f14c79a36bdc117c638eb1782af8dc66 /Tests | |
parent | b2d22b3fa0450419a893d7cf504d64727507fafb (diff) | |
parent | c4c636cef59edabdbfe278ea037ac06ca7d09d35 (diff) | |
download | CMake-ce11bace37692853382757c28eca34e8b6a32d2d.zip CMake-ce11bace37692853382757c28eca34e8b6a32d2d.tar.gz CMake-ce11bace37692853382757c28eca34e8b6a32d2d.tar.bz2 |
Merge topic 'CheckSource-Fortran'
c4c636cef5 Tests: Add cases for CheckSource{Compiles,Runs} bad arguments
1e519df025 CheckSource{Runs,Compiles}: Fix default Fortran source extension
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5378
Diffstat (limited to 'Tests')
8 files changed, 32 insertions, 0 deletions
diff --git a/Tests/RunCMake/CheckSourceCompiles/RunCMakeTest.cmake b/Tests/RunCMake/CheckSourceCompiles/RunCMakeTest.cmake index 22cb466..6e9088f 100644 --- a/Tests/RunCMake/CheckSourceCompiles/RunCMakeTest.cmake +++ b/Tests/RunCMake/CheckSourceCompiles/RunCMakeTest.cmake @@ -2,6 +2,7 @@ include(RunCMake) run_cmake(NotEnabledLanguage) run_cmake(NonExistentLanguage) +run_cmake(UnknownArgument) run_cmake(CheckCSourceCompiles) run_cmake(CheckCXXSourceCompiles) diff --git a/Tests/RunCMake/CheckSourceCompiles/UnknownArgument-result.txt b/Tests/RunCMake/CheckSourceCompiles/UnknownArgument-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CheckSourceCompiles/UnknownArgument-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CheckSourceCompiles/UnknownArgument-stderr.txt b/Tests/RunCMake/CheckSourceCompiles/UnknownArgument-stderr.txt new file mode 100644 index 0000000..eed581a --- /dev/null +++ b/Tests/RunCMake/CheckSourceCompiles/UnknownArgument-stderr.txt @@ -0,0 +1,9 @@ +^CMake Error at [^ +]*/Modules/CheckSourceCompiles.cmake:[0-9]+ \(message\): + Unknown argument: + + BAD + +Call Stack \(most recent call first\): + UnknownArgument.cmake:[0-9]+ \(check_source_compiles\) + CMakeLists.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/CheckSourceCompiles/UnknownArgument.cmake b/Tests/RunCMake/CheckSourceCompiles/UnknownArgument.cmake new file mode 100644 index 0000000..3b861da --- /dev/null +++ b/Tests/RunCMake/CheckSourceCompiles/UnknownArgument.cmake @@ -0,0 +1,5 @@ + +enable_language (C) +include(CheckSourceCompiles) + +check_source_compiles(C "int main() {return 0;}" SHOULD_BUILD SRC_EXT C BAD) diff --git a/Tests/RunCMake/CheckSourceRuns/RunCMakeTest.cmake b/Tests/RunCMake/CheckSourceRuns/RunCMakeTest.cmake index b27b08d..c99ac8b 100644 --- a/Tests/RunCMake/CheckSourceRuns/RunCMakeTest.cmake +++ b/Tests/RunCMake/CheckSourceRuns/RunCMakeTest.cmake @@ -2,6 +2,7 @@ include(RunCMake) run_cmake(NotEnabledLanguage) run_cmake(NonExistentLanguage) +run_cmake(UnknownArgument) run_cmake(CheckCSourceRuns) run_cmake(CheckCXXSourceRuns) diff --git a/Tests/RunCMake/CheckSourceRuns/UnknownArgument-result.txt b/Tests/RunCMake/CheckSourceRuns/UnknownArgument-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CheckSourceRuns/UnknownArgument-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CheckSourceRuns/UnknownArgument-stderr.txt b/Tests/RunCMake/CheckSourceRuns/UnknownArgument-stderr.txt new file mode 100644 index 0000000..8ae1ea1 --- /dev/null +++ b/Tests/RunCMake/CheckSourceRuns/UnknownArgument-stderr.txt @@ -0,0 +1,9 @@ +^CMake Error at [^ +]*/Modules/CheckSourceRuns.cmake:[0-9]+ \(message\): + Unknown argument: + + BAD + +Call Stack \(most recent call first\): + UnknownArgument.cmake:[0-9]+ \(check_source_runs\) + CMakeLists.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/CheckSourceRuns/UnknownArgument.cmake b/Tests/RunCMake/CheckSourceRuns/UnknownArgument.cmake new file mode 100644 index 0000000..6e50fa7 --- /dev/null +++ b/Tests/RunCMake/CheckSourceRuns/UnknownArgument.cmake @@ -0,0 +1,5 @@ + +enable_language (C) +include(CheckSourceRuns) + +check_source_runs(C "int main() {return 0;}" SHOULD_BUILD SRC_EXT C BAD) |