CheckIncludeFiles: add unit tests

This commit is contained in:
David Adam 2017-11-11 23:02:08 +08:00
parent 7669695a74
commit ea1bb90270
12 changed files with 54 additions and 0 deletions

View File

@ -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\)

View File

@ -0,0 +1,3 @@
enable_language(C)
include(CheckIncludeFiles)
check_include_files("stddef.h;stdlib.h" HAVE_MISSING_ARGUMENT_H LANGUAGE)

View File

@ -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)

View File

@ -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)

View File

@ -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\)

View File

@ -0,0 +1,3 @@
enable_language(C)
include(CheckIncludeFiles)
check_include_files("stddef.h;stdlib.h" HAVE_UNKNOWN_ARGUMENT_H FOOBAR)

View File

@ -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\)

View File

@ -0,0 +1,3 @@
enable_language(C)
include(CheckIncludeFiles)
check_include_files("stddef.h;stdlib.h" HAVE_UNKNOWN_ARGUMENT_H LANGUAGE FOOBAR)

View File

@ -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)