OSDN Git Service

Correct project name references in mingwrt source files.
[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 <keith@users.osdn.me>
11 # Copyright (C) 2016, 2020, 2022, MinGW.OSDN 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 alloca.h dnl
41 assert.h dnl
42 complex.h dnl
43 conio.h dnl
44 ctype.h dnl
45 dir.h dnl
46 direct.h dnl
47 dirent.h dnl
48 dlfcn.h dnl
49 dos.h dnl
50 errno.h dnl
51 excpt.h dnl
52 fcntl.h dnl
53 fenv.h dnl
54 float.h dnl
55 getopt.h dnl
56 glob.h dnl
57 inttypes.h dnl
58 io.h dnl
59 libgen.h dnl
60 limits.h dnl
61 locale.h dnl
62 malloc.h dnl
63 math.h dnl
64 mbctype.h dnl
65 mbstring.h dnl
66 mem.h dnl
67 memory.h dnl
68 msvcrtver.h dnl
69 process.h dnl
70 search.h dnl
71 setjmp.h dnl
72 share.h dnl
73 signal.h dnl
74 stdint.h dnl
75 stdio.h dnl
76 stdlib.h dnl
77 string.h dnl
78 strings.h dnl
79 tchar.h dnl
80 time.h dnl
81 unistd.h dnl
82 utime.h dnl
83 values.h dnl
84 wchar.h dnl
85 wctype.h dnl
86 sys/bsdtypes.h dnl
87 sys/fcntl.h dnl
88 sys/file.h dnl
89 sys/locking.h dnl
90 sys/param.h dnl
91 sys/stat.h dnl
92 sys/time.h dnl
93 sys/timeb.h dnl
94 sys/types.h dnl
95 sys/unistd.h dnl
96 sys/utime.h dnl
97 ])# MINGWRT_AT_PACKAGE_HEADERS
98
99 # MINGWRT_AT_HASH_INCLUDE( HEADER )
100 # ---------------------------------
101 # Emit a single "#include <HEADER>" statement into a generated
102 # program language source file.
103 #
104 m4_define([MINGWRT_AT_HASH_INCLUDE],dnl
105 [[#include <$1>
106 ]])# MINGWRT_AT_HASH_INCLUDE
107
108 # MINGWRT_AT_CHECK_HEADERS_STANDALONE( LANG )
109 # -------------------------------------------
110 # Check compilability and self-containment of all package headers,
111 # when each is compiled individually, using the LANG compiler.
112 #
113 m4_define([MINGWRT_AT_CHECK_HEADERS_STANDALONE],[MINGW_AT_LANG([$1])dnl
114 AT_BANNER([Header integrity checks: stand-alone compile; language = $1.])
115 m4_foreach_w([HEADER],MINGWRT_AT_PACKAGE_HEADERS,[dnl
116 AT_SETUP([#include <]HEADER[>])AT_KEYWORDS([$1 $1-headers])
117 AS_VAR_APPEND([CPPFLAGS],[" -Wall -Wextra -Wsystem-headers"])
118 m4_if(HEADER,[unistd.h],AS_VAR_APPEND([CPPFLAGS],[" -Wno-deprecated-declarations"]))
119 m4_if(HEADER,[sys/timeb.h],AS_VAR_APPEND([CPPFLAGS],[" -Wno-deprecated-declarations"]))
120 m4_if(HEADER,[sys/stat.h],AS_VAR_APPEND([CPPFLAGS],[" -D_MINGW_S_IFBLK_KLUDGE"]))
121 MINGW_AT_CHECK_COMPILE([dnl
122 #define __IN_MINGWRT_TESTSUITE__ 1
123 m4_if(HEADER,[values.h],MINGWRT_AT_HASH_INCLUDE([_mingw.h]))dnl
124 MINGWRT_AT_HASH_INCLUDE(HEADER)dnl
125 int main(){ return __MINGW32_MAJOR_VERSION; }])
126 AT_CLEANUP
127 ])])# MINGWRT_AT_CHECK_HEADERS_STANDALONE
128 #
129 # Run it, for each of LANG = C and LANG = C++
130 #
131 m4_foreach([LANG],[C,C++],[MINGWRT_AT_CHECK_HEADERS_STANDALONE(LANG)])
132
133 # MINGWRT_AT_CHECK_HEADERS_COMBINED( LANG )
134 # -----------------------------------------
135 # Check compilability of package headers, when all are included within
136 # a single translation unit, and compiled using the LANG compiler.
137 #
138 m4_define([MINGWRT_AT_CHECK_HEADERS_COMBINED],[MINGW_AT_LANG([$1])dnl
139 AT_SETUP([#include all; language = $1])AT_KEYWORDS([$1 $1-headers])
140 AS_VAR_APPEND([CPPFLAGS],[" -Wall -Wextra -Wsystem-headers"])
141 AS_VAR_APPEND([CPPFLAGS],[" -Wno-deprecated-declarations"])
142 MINGW_AT_CHECK_COMPILE([dnl
143 #define _MINGW_S_IFBLK_KLUDGE 1
144 #define __IN_MINGWRT_TESTSUITE__ 1
145 m4_foreach_w([HEADER],MINGWRT_AT_PACKAGE_HEADERS,[dnl
146 MINGWRT_AT_HASH_INCLUDE(HEADER)])
147 int main(){ return __MINGW32_MAJOR_VERSION; }])
148 AT_CLEANUP
149 ])# MINGWRT_AT_CHECK_HEADERS_COMBINED
150 #
151 # Run it, for each of LANG = C and LANG = C++
152 #
153 AT_BANNER([Header consistency checks: composite compile.])
154 m4_foreach([LANG],[C,C++],[MINGWRT_AT_CHECK_HEADERS_COMBINED(LANG)])
155
156 # vim: filetype=config formatoptions=croql
157 # $RCSfile$: end of file