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 | 0bdaa60e43f9e7321cede059a9a6013608b45e56 (patch) | |
tree | e9610a34c3f5fd3dedcbbb1e91226fda83c01d06 /Tests | |
parent | 39b964272ca1d2d663c70ac925b69f1ff89a7739 (diff) | |
parent | c4c636cef59edabdbfe278ea037ac06ca7d09d35 (diff) | |
download | CMake-0bdaa60e43f9e7321cede059a9a6013608b45e56.zip CMake-0bdaa60e43f9e7321cede059a9a6013608b45e56.tar.gz CMake-0bdaa60e43f9e7321cede059a9a6013608b45e56.tar.bz2 |
Merge topic 'CheckSource-Fortran' into release-3.19
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) |