summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-11-29 13:24:40 (GMT)
committerKitware Robot <kwrobot@kitware.com>2017-11-29 13:26:05 (GMT)
commitcaffddd620393fd9c73c1ce97d0451ce5570dedf (patch)
tree61fc673e7dcee6e2150f17685a9101064289fd5f /Tests
parent9e961930ee1ab526467651935bf7c285c170432d (diff)
parentb31d5e1dfdea5abcf95de05baf7b0e53cc18937a (diff)
downloadCMake-caffddd620393fd9c73c1ce97d0451ce5570dedf.zip
CMake-caffddd620393fd9c73c1ce97d0451ce5570dedf.tar.gz
CMake-caffddd620393fd9c73c1ce97d0451ce5570dedf.tar.bz2
Merge topic 'CheckIncludeFiles-language-CXX'
b31d5e1d CheckIncludeFiles: improve warning for missing argument 1f1c2a9f CheckIncludeFiles: clean up documentation of new features c8609992 Help: Add notes for topic 'CheckIncludeFiles-language-CXX' ea1bb902 CheckIncludeFiles: add unit tests 7669695a CheckIncludeFiles: extend to allow a LANGUAGE argument Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1464
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..36c28f9
--- /dev/null
+++ b/Tests/RunCMake/CheckModules/CheckIncludeFilesMissingLanguage-stderr.txt
@@ -0,0 +1,8 @@
+CMake Error at .*/Modules/CheckIncludeFiles.cmake:[0-9]+. \(message\):
+ No languages listed for LANGUAGE option.
+
+ Supported languages: C, CXX.
+
+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)