summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-10-15 13:40:20 (GMT)
committerBrad King <brad.king@kitware.com>2020-10-15 13:42:56 (GMT)
commitc4c636cef59edabdbfe278ea037ac06ca7d09d35 (patch)
tree5953265f522abe0d5d71edd84a4ec21fa8e2df7b /Tests/RunCMake
parent1e519df0259677df67b5e7d21e1f189d655ddbd3 (diff)
downloadCMake-c4c636cef59edabdbfe278ea037ac06ca7d09d35.zip
CMake-c4c636cef59edabdbfe278ea037ac06ca7d09d35.tar.gz
CMake-c4c636cef59edabdbfe278ea037ac06ca7d09d35.tar.bz2
Tests: Add cases for CheckSource{Compiles,Runs} bad arguments
Diffstat (limited to 'Tests/RunCMake')
-rw-r--r--Tests/RunCMake/CheckSourceCompiles/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/CheckSourceCompiles/UnknownArgument-result.txt1
-rw-r--r--Tests/RunCMake/CheckSourceCompiles/UnknownArgument-stderr.txt9
-rw-r--r--Tests/RunCMake/CheckSourceCompiles/UnknownArgument.cmake5
-rw-r--r--Tests/RunCMake/CheckSourceRuns/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/CheckSourceRuns/UnknownArgument-result.txt1
-rw-r--r--Tests/RunCMake/CheckSourceRuns/UnknownArgument-stderr.txt9
-rw-r--r--Tests/RunCMake/CheckSourceRuns/UnknownArgument.cmake5
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)