OSDN Git Service

3252925f3b501f51a2c0478cfce401a42fa00759
[mingw/mingw-org-wsl.git] / mingwrt / 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 <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 # 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 -L../../lib])
67 AT_CHECK([./at_prog.exe],[$2],[$3],[$4])
68 ])# MINGW_AT_CHECK_RUN
69
70 # MINGW_AT_DATA_CRLF( FILENAME, TEXT )
71 # ------------------------------------
72 # Construct reference data file FILENAME, with content as specified
73 # by TEXT, (which may comprise multiple lines), ensuring that each
74 # line of TEXT is terminated according to the CRLF convention.
75 #
76 m4_define([MINGW_AT_DATA_CRLF],[AT_DATA([$1],[$2])
77 AT_CHECK([awk '{sub("\r$",""); printf "%s\r\n", $][0}' $1],,[stdout])
78 m4_if([$1],[stdout],,AT_CHECK([mv stdout $1]))dnl
79 ])# MINGW_AT_DATA_CRLF
80
81 # Initialize autotest, and select C as default programming language.
82 #
83 AT_INIT
84 MINGW_AT_LANG([C])
85
86 # Individual test groups are specified separately, via the following
87 # collection of autotest M4 include files.
88 #
89 m4_include([headers.at])
90 m4_include([ansiprintf.at])
91 m4_include([logarithms.at])
92
93 # vim: filetype=config formatoptions=croql
94 # $RCSfile$: end of file