OSDN Git Service

Include, and make <sys/bsdtypes.h> test suite safe (augmented).
[mingw/mingw-org-wsl.git] / mingwrt / tests / headers.at
1 # headers.at
2 #
3 # Autotest module for checking integrity of MinGW runtime headers.
4 # Each header is first individually compiled, to ensure that it is
5 # both valid and self contained; all are then compiled together, to
6 # verify mutual consistency.
7 #
8 # $Id$
9 #
10 # Written by Keith Marshall <keithmarshall@users.sourceforge.net>
11 # Copyright (C) 2016, MinGW.org Project
12 #
13 #
14 # Permission is hereby granted, free of charge, to any person obtaining a
15 # copy of this software and associated documentation files (the "Software"),
16 # to deal in the Software without restriction, including without limitation
17 # the rights to use, copy, modify, merge, publish, distribute, sublicense,
18 # and/or sell copies of the Software, and to permit persons to whom the
19 # Software is furnished to do so, subject to the following conditions:
20 #
21 # The above copyright notice and this permission notice (including the next
22 # paragraph) shall be included in all copies or substantial portions of the
23 # Software.
24 #
25 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
26 # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
27 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
28 # AUTHORS OR THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
29 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
30 # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
31 # DEALINGS IN THE SOFTWARE.
32 #
33 #
34 # MINGWRT_AT_PACKAGE_HEADERS
35 # --------------------------
36 # Specify the gamut of package headers to be tested.  This list is updated
37 # dynamically, when running "make check"; there is no need to edit it.
38 #
39 m4_define([MINGWRT_AT_PACKAGE_HEADERS],[dnl
40 assert.h dnl
41 complex.h dnl
42 conio.h dnl
43 ctype.h dnl
44 direct.h dnl
45 dirent.h dnl
46 dir.h dnl
47 dlfcn.h dnl
48 dos.h dnl
49 errno.h dnl
50 excpt.h dnl
51 fcntl.h dnl
52 fenv.h dnl
53 float.h dnl
54 getopt.h dnl
55 glob.h dnl
56 inttypes.h dnl
57 io.h dnl
58 libgen.h dnl
59 limits.h dnl
60 locale.h dnl
61 malloc.h dnl
62 math.h dnl
63 mbctype.h dnl
64 mbstring.h dnl
65 mem.h dnl
66 memory.h dnl
67 msvcrtver.h dnl
68 process.h dnl
69 search.h dnl
70 setjmp.h dnl
71 share.h dnl
72 signal.h dnl
73 stdint.h dnl
74 stdio.h dnl
75 stdlib.h dnl
76 string.h dnl
77 strings.h dnl
78 tchar.h dnl
79 time.h dnl
80 unistd.h dnl
81 utime.h dnl
82 values.h dnl
83 wchar.h dnl
84 wctype.h dnl
85 sys/bsdtypes.h dnl
86 sys/fcntl.h dnl
87 sys/file.h dnl
88 sys/locking.h dnl
89 sys/param.h dnl
90 sys/stat.h dnl
91 sys/timeb.h dnl
92 sys/time.h dnl
93 sys/types.h dnl
94 sys/unistd.h dnl
95 sys/utime.h dnl
96 ])# MINGWRT_AT_PACKAGE_HEADERS
97
98 # MINGWRT_AT_HASH_INCLUDE( HEADER )
99 # ---------------------------------
100 # Emit a single "#include <HEADER>" statement into a generated
101 # program language source file.
102 #
103 m4_define([MINGWRT_AT_HASH_INCLUDE],dnl
104 [[#include <$1>
105 ]])# MINGWRT_AT_HASH_INCLUDE
106
107 # MINGWRT_AT_CHECK_HEADERS_STANDALONE( LANG )
108 # -------------------------------------------
109 # Check compilability and self-containment of all package headers,
110 # when each is compiled individually, using the LANG compiler.
111 #
112 m4_define([MINGWRT_AT_CHECK_HEADERS_STANDALONE],[MINGW_AT_LANG([$1])dnl
113 AT_BANNER([Header integrity checks: stand-alone compile; language = $1.])
114 m4_foreach_w([HEADER],MINGWRT_AT_PACKAGE_HEADERS,[dnl
115 AT_SETUP([#include <]HEADER[>])AT_KEYWORDS([$1 $1-headers])
116 AS_VAR_APPEND([CPPFLAGS],[" -Wall -Wextra -Wsystem-headers"])
117 m4_if(HEADER,[unistd.h],AS_VAR_APPEND([CPPFLAGS],[" -Wno-deprecated-declarations"]))
118 m4_if(HEADER,[sys/stat.h],AS_VAR_APPEND([CPPFLAGS],[" -D_MINGW_S_IFBLK_KLUDGE"]))
119 MINGW_AT_CHECK_COMPILE([dnl
120 #define __IN_MINGWRT_TESTSUITE__ 1
121 m4_if(HEADER,[values.h],MINGWRT_AT_HASH_INCLUDE([_mingw.h]))dnl
122 MINGWRT_AT_HASH_INCLUDE(HEADER)dnl
123 int main(){ return __MINGW32_MAJOR_VERSION; }])
124 AT_CLEANUP
125 ])])# MINGWRT_AT_CHECK_HEADERS_STANDALONE
126 #
127 # Run it, for each of LANG = C and LANG = C++
128 #
129 m4_foreach([LANG],[C,C++],[MINGWRT_AT_CHECK_HEADERS_STANDALONE(LANG)])
130
131 # MINGWRT_AT_CHECK_HEADERS_COMBINED( LANG )
132 # -----------------------------------------
133 # Check compilability of package headers, when all are included within
134 # a single translation unit, and compiled using the LANG compiler.
135 #
136 m4_define([MINGWRT_AT_CHECK_HEADERS_COMBINED],[MINGW_AT_LANG([$1])dnl
137 AT_SETUP([#include all; language = $1])AT_KEYWORDS([$1 $1-headers])
138 AS_VAR_APPEND([CPPFLAGS],[" -Wall -Wextra -Wsystem-headers"])
139 m4_if([$1],[C],AS_VAR_APPEND([CPPFLAGS],[" -Wno-deprecated-declarations"]))
140 MINGW_AT_CHECK_COMPILE([dnl
141 #define _MINGW_S_IFBLK_KLUDGE 1
142 #define __IN_MINGWRT_TESTSUITE__ 1
143 m4_foreach_w([HEADER],MINGWRT_AT_PACKAGE_HEADERS,[dnl
144 MINGWRT_AT_HASH_INCLUDE(HEADER)])
145 int main(){ return __MINGW32_MAJOR_VERSION; }])
146 AT_CLEANUP
147 ])# MINGWRT_AT_CHECK_HEADERS_COMBINED
148 #
149 # Run it, for each of LANG = C and LANG = C++
150 #
151 AT_BANNER([Header consistency checks: composite compile.])
152 m4_foreach([LANG],[C,C++],[MINGWRT_AT_CHECK_HEADERS_COMBINED(LANG)])
153
154 # vim: filetype=config formatoptions=croql
155 # $RCSfile$: end of file