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.
10 # Written by Keith Marshall <keithmarshall@users.sourceforge.net>
11 # Copyright (C) 2017, MinGW.org Project
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:
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
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.
34 # W32API_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.
39 m4_define([W32API_AT_PACKAGE_HEADERS],[dnl
272 ])# W32API_AT_PACKAGE_HEADERS
274 # W32API_AT_HASH_INCLUDE( HEADER )
275 # --------------------------------
276 # Emit a single "#include <HEADER>" statement into a generated
277 # program language source file.
279 m4_define([W32API_AT_HASH_INCLUDE],dnl
281 ]])# W32API_AT_HASH_INCLUDE
283 # W32API_AT_CHECK_HEADERS_STANDALONE( LANG )
284 # ------------------------------------------
285 # Check compilability and self-containment of all package headers,
286 # when each is compiled individually, using the LANG compiler.
288 m4_define([W32API_AT_CHECK_HEADERS_STANDALONE],[MINGW_AT_LANG([$1])dnl
289 AT_BANNER([Header integrity checks: stand-alone compile; language = $1.])
290 m4_foreach_w([HEADER],W32API_AT_PACKAGE_HEADERS,[dnl
291 AT_SETUP([#include <]HEADER[>])AT_KEYWORDS([$1 $1-headers])
292 AS_VAR_APPEND([CPPFLAGS],[" -Wall -Wextra -Wsystem-headers"])
293 MINGW_AT_CHECK_COMPILE([dnl
294 #define __IN_W32API_TESTSUITE__ 1
295 W32API_AT_HASH_INCLUDE(HEADER)dnl
296 int main(){ return 0; }])
298 ])])# W32API_AT_CHECK_HEADERS_STANDALONE
300 # Run it, for each of LANG = C and LANG = C++
302 m4_foreach([LANG],[C,C++],[W32API_AT_CHECK_HEADERS_STANDALONE(LANG)])
304 # W32API_AT_CHECK_HEADERS_COMBINED( LANG )
305 # ----------------------------------------
306 # Check compilability of package headers, when all are included within
307 # a single translation unit, and compiled using the LANG compiler.
309 m4_define([W32API_AT_CHECK_HEADERS_COMBINED],[MINGW_AT_LANG([$1])dnl
310 AT_SETUP([#include all; language = $1])AT_KEYWORDS([$1 $1-headers])
311 AS_VAR_APPEND([CPPFLAGS],[" -Wall -Wextra -Wsystem-headers"])
312 m4_if([$1],[C],AS_VAR_APPEND([CPPFLAGS],[" -Wno-deprecated-declarations"]))
313 MINGW_AT_CHECK_COMPILE([dnl
314 m4_foreach_w([HEADER],W32API_AT_PACKAGE_HEADERS,[dnl
315 W32API_AT_HASH_INCLUDE(HEADER)])
316 int main(){ return __W32API_MAJOR_VERSION; }])
318 ])# W32API_AT_CHECK_HEADERS_COMBINED
320 # Run it, for each of LANG = C and LANG = C++
322 AT_BANNER([Header consistency checks: composite compile.])
323 m4_foreach([LANG],[C,C++],[W32API_AT_CHECK_HEADERS_COMBINED(LANG)])
325 # vim: filetype=config formatoptions=croql
326 # $RCSfile$: end of file