summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorDavid Adam <zanchey@ucc.gu.uwa.edu.au>2017-11-11 15:02:08 (GMT)
committerDavid Adam <zanchey@ucc.gu.uwa.edu.au>2017-11-11 15:04:05 (GMT)
commitea1bb90270357ecd033c11c941b83e76e6d1525b (patch)
treea501e3b2dabbed2223c8e80449afb2634d4ef931 /Tests
parent7669695a74959dbad7c801facea4c7428875ffc3 (diff)
downloadCMake-ea1bb90270357ecd033c11c941b83e76e6d1525b.zip
CMake-ea1bb90270357ecd033c11c941b83e76e6d1525b.tar.gz
CMake-ea1bb90270357ecd033c11c941b83e76e6d1525b.tar.bz2
CheckIncludeFiles: add unit tests
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/CheckModules/CheckIncludeFilesMissingLanguage-result.txt1
-rw-r--r--Tests/RunCMake/CheckModules/CheckIncludeFilesMissingLanguage-stderr.txt8
-rw-r--r--Tests/RunCMake/CheckModules/CheckIncludeFilesMissingLanguage.cmake3
-rw-r--r--Tests/RunCMake/CheckModules/CheckIncludeFilesOk.cmake6
-rw-r--r--Tests/RunCMake/CheckModules/CheckIncludeFilesOkNoC.cmake4
-rw-r--r--Tests/RunCMake/CheckModules/CheckIncludeFilesUnknownArgument-result.txt1
-rw-r--r--Tests/RunCMake/CheckModules/CheckIncludeFilesUnknownArgument-stderr.txt8
-rw-r--r--Tests/RunCMake/CheckModules/CheckIncludeFilesUnknownArgument.cmake3
-rw-r--r--Tests/RunCMake/CheckModules/CheckIncludeFilesUnknownLanguage-result.txt1
-rw-r--r--Tests/RunCMake/CheckModules/CheckIncludeFilesUnknownLanguage-stderr.txt10
-rw-r--r--Tests/RunCMake/CheckModules/CheckIncludeFilesUnknownLanguage.cmake3
-rw-r--r--Tests/RunCMake/CheckModules/RunCMakeTest.cmake6
12 files changed, 54 insertions, 0 deletions
diff --git a/Tests/RunCMake/CheckModules/CheckIncludeFilesMissingLanguage-result.txt b/Tests/RunCMake/CheckModules/CheckIncludeFilesMissingLanguage-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CheckModules/CheckIncludeFilesMissingLanguage-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CheckModules/CheckIncludeFilesMissingLanguage-stderr.txt b/Tests/RunCMake/CheckModules/CheckIncludeFilesMissingLanguage-stderr.txt
new file mode 100644
index 0000000..4b31dbd
--- /dev/null
+++ b/Tests/RunCMake/CheckModules/CheckIncludeFilesMissingLanguage-stderr.txt
@@ -0,0 +1,8 @@
+CMake Error at .*/Modules/CheckIncludeFiles.cmake:[0-9]+. \(message\):
+ Unknown arguments:
+
+ LANGUAGE
+
+Call Stack \(most recent call first\):
+ CheckIncludeFilesMissingLanguage.cmake:[0-9]+ \(check_include_files\)
+ CMakeLists.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/CheckModules/CheckIncludeFilesMissingLanguage.cmake b/Tests/RunCMake/CheckModules/CheckIncludeFilesMissingLanguage.cmake
new file mode 100644
index 0000000..59accb0
--- /dev/null
+++ b/Tests/RunCMake/CheckModules/CheckIncludeFilesMissingLanguage.cmake
@@ -0,0 +1,3 @@
+enable_language(C)
+include(CheckIncludeFiles)
+check_include_files("stddef.h;stdlib.h" HAVE_MISSING_ARGUMENT_H LANGUAGE)
diff --git a/Tests/RunCMake/CheckModules/CheckIncludeFilesOk.cmake b/Tests/RunCMake/CheckModules/CheckIncludeFilesOk.cmake
new file mode 100644
index 0000000..0891ec6
--- /dev/null
+++ b/Tests/RunCMake/CheckModules/CheckIncludeFilesOk.cmake
@@ -0,0 +1,6 @@
+enable_language(C)
+enable_language(CXX)
+include(CheckIncludeFiles)
+check_include_files("stddef.h;stdlib.h" HAVE_STDLIB_H)
+check_include_files("stddef.h;stdlib.h" HAVE_STDLIB_H2 LANGUAGE C)
+check_include_files("cstddef;cstdlib" HAVE_CSTDLIB_H LANGUAGE CXX)
diff --git a/Tests/RunCMake/CheckModules/CheckIncludeFilesOkNoC.cmake b/Tests/RunCMake/CheckModules/CheckIncludeFilesOkNoC.cmake
new file mode 100644
index 0000000..a1d2843
--- /dev/null
+++ b/Tests/RunCMake/CheckModules/CheckIncludeFilesOkNoC.cmake
@@ -0,0 +1,4 @@
+enable_language(CXX)
+include(CheckIncludeFiles)
+check_include_files("cstddef;cstdlib" HAVE_CSTDLIB_H3 LANGUAGE CXX)
+check_include_files("cstddef;cstdlib" HAVE_CSTDLIB_H4)
diff --git a/Tests/RunCMake/CheckModules/CheckIncludeFilesUnknownArgument-result.txt b/Tests/RunCMake/CheckModules/CheckIncludeFilesUnknownArgument-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CheckModules/CheckIncludeFilesUnknownArgument-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CheckModules/CheckIncludeFilesUnknownArgument-stderr.txt b/Tests/RunCMake/CheckModules/CheckIncludeFilesUnknownArgument-stderr.txt
new file mode 100644
index 0000000..098da79
--- /dev/null
+++ b/Tests/RunCMake/CheckModules/CheckIncludeFilesUnknownArgument-stderr.txt
@@ -0,0 +1,8 @@
+CMake Error at .*/Modules/CheckIncludeFiles.cmake:[0-9]+. \(message\):
+ Unknown arguments:
+
+ FOOBAR
+
+Call Stack \(most recent call first\):
+ CheckIncludeFilesUnknownArgument.cmake:[0-9]+ \(check_include_files\)
+ CMakeLists.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/CheckModules/CheckIncludeFilesUnknownArgument.cmake b/Tests/RunCMake/CheckModules/CheckIncludeFilesUnknownArgument.cmake
new file mode 100644
index 0000000..dfc2b93
--- /dev/null
+++ b/Tests/RunCMake/CheckModules/CheckIncludeFilesUnknownArgument.cmake
@@ -0,0 +1,3 @@
+enable_language(C)
+include(CheckIncludeFiles)
+check_include_files("stddef.h;stdlib.h" HAVE_UNKNOWN_ARGUMENT_H FOOBAR)
diff --git a/Tests/RunCMake/CheckModules/CheckIncludeFilesUnknownLanguage-result.txt b/Tests/RunCMake/CheckModules/CheckIncludeFilesUnknownLanguage-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CheckModules/CheckIncludeFilesUnknownLanguage-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CheckModules/CheckIncludeFilesUnknownLanguage-stderr.txt b/Tests/RunCMake/CheckModules/CheckIncludeFilesUnknownLanguage-stderr.txt
new file mode 100644
index 0000000..5d4a9ec
--- /dev/null
+++ b/Tests/RunCMake/CheckModules/CheckIncludeFilesUnknownLanguage-stderr.txt
@@ -0,0 +1,10 @@
+CMake Error at .*/Modules/CheckIncludeFiles.cmake:[0-9]+. \(message\):
+ Unknown language:
+
+ FOOBAR
+
+ Supported languages: C, CXX.
+
+Call Stack \(most recent call first\):
+ CheckIncludeFilesUnknownLanguage.cmake:[0-9]+ \(check_include_files\)
+ CMakeLists.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/CheckModules/CheckIncludeFilesUnknownLanguage.cmake b/Tests/RunCMake/CheckModules/CheckIncludeFilesUnknownLanguage.cmake
new file mode 100644
index 0000000..3a77cf9
--- /dev/null
+++ b/Tests/RunCMake/CheckModules/CheckIncludeFilesUnknownLanguage.cmake
@@ -0,0 +1,3 @@
+enable_language(C)
+include(CheckIncludeFiles)
+check_include_files("stddef.h;stdlib.h" HAVE_UNKNOWN_ARGUMENT_H LANGUAGE FOOBAR)
diff --git a/Tests/RunCMake/CheckModules/RunCMakeTest.cmake b/Tests/RunCMake/CheckModules/RunCMakeTest.cmake
index 5b4e57e..c5aaa64 100644
--- a/Tests/RunCMake/CheckModules/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CheckModules/RunCMakeTest.cmake
@@ -14,3 +14,9 @@ run_cmake(CheckTypeSizeUnknownArgument)
run_cmake(CheckTypeSizeMixedArgs)
run_cmake(CheckTypeSizeOkNoC)
+
+run_cmake(CheckIncludeFilesOk)
+run_cmake(CheckIncludeFilesOkNoC)
+run_cmake(CheckIncludeFilesMissingLanguage)
+run_cmake(CheckIncludeFilesUnknownArgument)
+run_cmake(CheckIncludeFilesUnknownLanguage)