OSDN Git Service

Correct project name references in w32api source files.
[mingw/mingw-org-wsl.git] / w32api / tests / testsuite.at.in
1 # @configure_input@
2 #
3 # Top level autotest module for instantiation of the mingwrt testsuite.
4 #
5 m4_define([AT_PACKAGE_STRING],[@PACKAGE_STRING@])
6 m4_define([AT_PACKAGE_BUGREPORT],[@PACKAGE_BUGREPORT@])
7 #
8 # $Id$
9 #
10 # Written by Keith Marshall <keith@users.osdn.me>
11 # Copyright (C) 2017, 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 # MINGW_AT_LANG( [LANGUAGE = C] )
35 # -------------------------------
36 # Select to programming language compiler which is to be used
37 # when compiling subsequent program fragments, as specified in
38 # MINGW_AT_CHECK_COMPILE or MINGW_AT_CHECK_RUN tests.
39 #
40 m4_define([MINGW_AT_LANG],[m4_if([$1],[C++],dnl
41 [m4_define([at_lang_compile],[$at_compiler_cxx $CPPFLAGS $CFLAGS])]dnl
42 [m4_define([at_lang_source],[at_source.cpp])],dnl
43 [m4_define([at_lang_compile],[$at_compiler_cc $CPPFLAGS $CFLAGS])]dnl
44 [m4_define([at_lang_source],[at_source.c])])dnl
45 ])# MINGW_AT_LANG
46
47 # MINGW_AT_CHECK_COMPILE( SOURCE )
48 # --------------------------------
49 # Check that the SOURCE program fragment is compilable, using the
50 # compiler appropriate to the currently selected source language;
51 # the compiler is expected to complete with zero exit status, and
52 # to have written nothing to either STDOUT or STDERR.
53 #
54 m4_define([MINGW_AT_CHECK_COMPILE],[AT_DATA([at_lang_source],$1
55 ) AT_CHECK([at_lang_compile -c at_lang_source -o /dev/null])
56 ])# MINGW_AT_CHECK_COMPILE
57
58 # MINGW_AT_CHECK_RUN( SOURCE, [STATUS = 0], [STDOUT], [STDERR] )
59 # --------------------------------------------------------------
60 # Check that the SOURCE program fragment is both compilable, using
61 # the compiler appropriate to the currently selected source language,
62 # and may then be executed to exit with STATUS, and with output as
63 # specified to each of STDOUT and STDERR.
64 #
65 m4_define([MINGW_AT_CHECK_RUN],[AT_DATA([at_lang_source],$1
66 ) AT_CHECK([at_lang_compile at_lang_source -o at_prog.exe at_lang_libs])
67 AT_CHECK([./at_prog.exe],[$2],[$3],[$4])
68 ])# MINGW_AT_CHECK_RUN
69
70 # MINGW_AT_LINK_LIBS( [-LIBPATH_OPTION ...] LIB ... )
71 # ---------------------------------------------------
72 # Specify the sequence of library specification arguments, and
73 # library search path options, to be passed to the compiler for
74 # any subsequent invocation of MINGW_AT_CHECK_RUN.
75 #
76 m4_define([MINGW_AT_LINK_LIBS],dnl
77 [m4_define([at_lang_libs],[at_lang_libs_default $1])dnl
78 ])# MINGW_AT_LINK_LIBS
79
80 # MINGW_AT_LINK_LIBS_DEFAULT
81 # --------------------------
82 # Initialize the list of libraries to be specified in subsequent
83 # invocations of MINGW_AT_CHECK_RUN, or reset the library list to
84 # its initial default state, after completion of any invocation of
85 # MINGW_AT_CHECK_RUN, for which the list was extended by a prior
86 # invocation of MINGW_AT_LINK_LIBS
87 #
88 m4_define([MINGW_AT_LINK_LIBS_DEFAULT],dnl
89 [m4_define([at_lang_libs_default],[-L../../lib])]dnl
90 [m4_define([at_lang_libs],[at_lang_libs_default])dnl
91 ])# MINGW_AT_LINK_LIBS
92
93 # MINGW_AT_DATA_CRLF( FILENAME, TEXT )
94 # ------------------------------------
95 # Construct reference data file FILENAME, with content as specified
96 # by TEXT, (which may comprise multiple lines), ensuring that each
97 # line of TEXT is terminated according to the CRLF convention.
98 #
99 m4_define([MINGW_AT_DATA_CRLF],[AT_DATA([$1],[$2])
100 AT_CHECK([awk '{sub("\r$",""); printf "%s\r\n", $][0}' $1],,[stdout])
101 m4_if([$1],[stdout],,AT_CHECK([mv stdout $1]))dnl
102 ])# MINGW_AT_DATA_CRLF
103
104 # Initialize autotest, and select C as default programming language.
105 #
106 AT_INIT
107 MINGW_AT_LANG([C])
108 MINGW_AT_LINK_LIBS_DEFAULT
109
110 # Individual test groups are specified separately, via the following
111 # collection of autotest M4 include files.
112 #
113 m4_include([headers.at])
114 m4_include([winsock.at])
115
116 # vim: filetype=config formatoptions=croql
117 # $RCSfile$: end of file