• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

The MinGW.org Windows System Libraries


Commit MetaInfo

Revisãof8d4c2bfcd158266036e206314a7f8048c231c9f (tree)
Hora2016-09-14 04:45:57
AutorKeith Marshall <keithmarshall@user...>
CommiterKeith Marshall

Mensagem de Log

Create a preliminary autotest framework.

Mudança Sumário

Diff

--- a/mingwrt/ChangeLog
+++ b/mingwrt/ChangeLog
@@ -1,3 +1,23 @@
1+2016-09-13 Keith Marshall <keithmarshall@users.sourceforge.net>
2+
3+ Create a preliminary autotest framework.
4+
5+ * configure.ac (AC_TESTDIR): Initialize tests subdirectory.
6+ (AC_PROG_CXX): Identify C++ compiler; the testsuite will use it.
7+ (AC_CHECK_PROG): Check availability of autom4te; specify fallback.
8+ (AC_CONFIG_FILES): Add instantiation requests for tests/atlocal,
9+ tests/Makefile, and tests/testsuite.at.tmp
10+
11+ * tests/testsuite.at.in tests/atlocal.in tests/headers.at
12+ * tests/Makefile.in: New files; implement them.
13+
14+ * Makefile.in (check, check-recursive, tests): Implement new goals.
15+ (mingwrt-srcdist-files): Subdivide package files complement into...
16+ (mingwrt-srcdist-package-files): ...this original collection, and...
17+ (mingwrt-srcdist-testsuite-files): ...this additional set.
18+
19+ * test_headers.c: Superseded by autotest; delete it.
20+
121 2016-08-25 Keith Marshall <keithmarshall@users.sourceforge.net>
222
323 Add pthreads-win32 courtesy support hooks.
--- a/mingwrt/Makefile.in
+++ b/mingwrt/Makefile.in
@@ -870,11 +870,14 @@ mingwrt-srcdist-dir:
870870 $(RM) -r dist/$(PACKAGE_TARNAME)-$(PACKAGE_VERSION)
871871 $(call mkinstalldirs,,dist/$(PACKAGE_TARNAME)-$(PACKAGE_VERSION))
872872
873-mingwrt-srcdist-files:
873+mingwrt-srcdist-files: mingwrt-srcdist-package-files
874+mingwrt-srcdist-files: mingwrt-srcdist-testsuite-files
875+
876+mingwrt-srcdist-package-files:
874877 (cd ${mingwrt_srcdir} && tar chf - --hard-dereference $(notdir $^)) | \
875878 (cd dist/$(PACKAGE_TARNAME)-$(PACKAGE_VERSION) && tar xf -)
876879
877-mingwrt-srcdist-files: $(wildcard ${mingwrt_srcdir}/*.[chs]) \
880+mingwrt-srcdist-package-files: $(wildcard ${mingwrt_srcdir}/*.[chs]) \
878881 $(addprefix ${mingwrt_srcdir}/,ChangeLog CONTRIBUTORS DISCLAIMER README) \
879882 $(wildcard ${mingwrt_srcdir}/*.def.in) $(wildcard ${mingwrt_srcdir}/config*) \
880883 $(addprefix ${mingwrt_srcdir}/,aclocal.m4 VERSION.m4 install-sh Makefile.in) \
@@ -882,6 +885,11 @@ mingwrt-srcdist-files: $(wildcard ${mingwrt_srcdir}/*.[chs]) \
882885 $(addprefix ${mingwrt_srcdir}/,msvcrt-xref crtdll.def) \
883886 $(wildcard ${mingwrt_srcdir}/*.txt)
884887
888+mingwrt-srcdist-testsuite-files: $(wildcard ${mingwrt_srcdir}/tests/*.at)
889+mingwrt-srcdist-testsuite-files: $(wildcard ${mingwrt_srcdir}/tests/*.in)
890+ (cd ${mingwrt_srcdir} && tar chf - $(addprefix tests/,$(notdir $^))) | \
891+ (cd dist/$(PACKAGE_TARNAME)-$(PACKAGE_VERSION) && tar xf -)
892+
885893 install-html install-pdf: install-%: %dir mingwrt-man$(man3ext)
886894 $(MAKE) --no-print-directory install-$*-files
887895
@@ -927,4 +935,12 @@ maintainer-clean-local: maintainer-clean-warning distclean-local
927935
928936 clean mostlyclean distclean maintainer-clean: %clean: %clean-local
929937
938+# Testsuite
939+# ---------
940+#
941+.PHONY: check-recursive
942+check tests: check-recursive
943+check-recursive:
944+ $(MAKE) -C tests $@
945+
930946 # $RCSfile$: end of file
--- a/mingwrt/configure.ac
+++ b/mingwrt/configure.ac
@@ -15,11 +15,11 @@
1515 # the rights to use, copy, modify, merge, publish, distribute, sublicense,
1616 # and/or sell copies of the Software, and to permit persons to whom the
1717 # Software is furnished to do so, subject to the following conditions:
18-#
18+#
1919 # The above copyright notice and this permission notice (including the next
2020 # paragraph) shall be included in all copies or substantial portions of the
2121 # Software.
22-#
22+#
2323 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
2424 # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
2525 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -52,6 +52,12 @@
5252 AC_PROG_MKDIR_P
5353 AC_PROG_LN_S
5454
55+ AC_CONFIG_TESTDIR([tests])
56+ AC_CONFIG_FILES([tests/testsuite.at.tmp:tests/testsuite.at.in])
57+ AC_CHECK_PROG([AUTOTEST_COMPILE],[autom4te],[command],[missing])
58+ AC_CONFIG_FILES([tests/atlocal tests/Makefile])
59+ AC_PROG_CXX
60+
5561 MINGW_AC_MAKE_COMMAND_GOALS
5662 AC_CONFIG_FILES([Makefile])
5763 AC_OUTPUT
--- a/mingwrt/test_headers.c
+++ /dev/null
@@ -1,54 +0,0 @@
1-#include <_mingw.h>
2-#include <assert.h>
3-#include <conio.h>
4-#include <ctype.h>
5-#include <dir.h>
6-#include <direct.h>
7-#include <dirent.h>
8-#include <dos.h>
9-#include <errno.h>
10-#include <excpt.h>
11-#include <fcntl.h>
12-#include <fenv.h>
13-#include <float.h>
14-#include <inttypes.h>
15-#include <io.h>
16-#include <limits.h>
17-#include <locale.h>
18-#include <malloc.h>
19-#include <math.h>
20-#include <mbctype.h>
21-#include <mbstring.h>
22-#include <mem.h>
23-#include <memory.h>
24-#include <process.h>
25-#include <search.h>
26-#include <setjmp.h>
27-#include <share.h>
28-#include <signal.h>
29-#include <stdarg.h>
30-#include <stddef.h>
31-#include <stdint.h>
32-#include <stdio.h>
33-#include <stdlib.h>
34-#include <string.h>
35-#include <strings.h>
36-#include <tchar.h>
37-#include <time.h>
38-#include <unistd.h>
39-#include <values.h>
40-#include <wchar.h>
41-#include <wctype.h>
42-#include <sys/fcntl.h>
43-#include <sys/file.h>
44-#include <sys/locking.h>
45-#include <sys/param.h>
46-#include <sys/stat.h>
47-#include <sys/time.h>
48-#include <sys/timeb.h>
49-#include <sys/types.h>
50-#include <sys/unistd.h>
51-#include <sys/utime.h>
52-
53-int main()
54-{return 0;}
--- /dev/null
+++ b/mingwrt/tests/Makefile.in
@@ -0,0 +1,142 @@
1+# @configure_input@
2+#
3+# Makefile template for MinGW.org Runtime Library testsuite
4+#
5+# $Id$
6+#
7+# Written by Keith Marshall <keithmarshall@users.sourceforge.net>
8+# Copyright (C) 2016, MinGW.org Project
9+#
10+#
11+# Permission is hereby granted, free of charge, to any person obtaining a
12+# copy of this software and associated documentation files (the "Software"),
13+# to deal in the Software without restriction, including without limitation
14+# the rights to use, copy, modify, merge, publish, distribute, sublicense,
15+# and/or sell copies of the Software, and to permit persons to whom the
16+# Software is furnished to do so, subject to the following conditions:
17+#
18+# The above copyright notice and this permission notice (including the next
19+# paragraph) shall be included in all copies or substantial portions of the
20+# Software.
21+#
22+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
23+# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25+# AUTHORS OR THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
27+# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
28+# DEALINGS IN THE SOFTWARE.
29+
30+srcdir = @srcdir@
31+top_srcdir = @top_srcdir@
32+
33+# The default rule is "check"; it is a synonym for the "check-recursive"
34+# request, from the parent directory's make process, which initiates the
35+# installation of the package components to be tested, then prepares the
36+# testsuite itself, compiling it if necessary, and finally, runs it.
37+#
38+check check-recursive: check-install check-pretest check-local
39+
40+check-local: testsuite
41+ $(SHELL) $^ $(TESTSUITEFLAGS)
42+
43+check-install: testsuite.install
44+check-pretest: testsuite.pretest headers.at.pretest
45+
46+LN_S = @LN_S@
47+
48+# Favour any copy of the testsuite which already exists in the build
49+# directory, but fall back to any which may have been distributed with
50+# the source package.
51+#
52+testsuite.pretest: %.pretest: %.at.pretest
53+ test -r $* || if test -r ${srcdir}/$*; then \
54+ $(LN_S) ${srcdir}/$* $*; fi
55+
56+# The primary testsuite.at source is nominally generated, when the
57+# package is configured, but is then distributed within the release
58+# tarball; update it as a side effect of running the testsuite, but
59+# only if its content differs from any distributed copy, to ensure
60+# that users building from a release tarball can do so, without a
61+# requirement to install autom4te.
62+#
63+vpath %.at ${srcdir}
64+vpath %.at.in ${srcdir}
65+testsuite.at.pretest: %.pretest: %.tmp
66+ test -r $* || if test -r ${srcdir}/$*; then \
67+ $(LN_S) ${srcdir}/$* $*; else touch $*; fi
68+ sed '1s,tests/$<,$*,' $< > $@
69+ cmp -s $@ $* || cp -f $@ $*
70+ $(RM) $@ $<
71+
72+testsuite.at.tmp: %.tmp: ../config.status %.in
73+ cd ..; ./config.status tests/$@
74+
75+# The enumerated list of headers, which are to be tested, is also a
76+# candidate for dynamic update; in this case, we prefer to update the
77+# list in place, within the testsuite source tree.
78+#
79+headers.at.pretest: MINGWRT_AT_ENUM := MINGWRT_AT_PACKAGE_HEADERS
80+headers.at.pretest: %.pretest:
81+ sed '/^m4_define(\[$(MINGWRT_AT_ENUM)],/q' ${srcdir}/$* > $@
82+ $(call enum_headers,hdr,${top_srcdir}/include, dnl >> $@;)
83+ $(call enum_headers,hdr,${top_srcdir}/include/sys, dnl >> $@;,sys)
84+ sed -n '/^])# $(MINGWRT_AT_ENUM)/,$$p' ${srcdir}/$* >> $@
85+ cmp -s $@ ${srcdir}/$* || cp -f $@ ${srcdir}/$*
86+ $(RM) $@
87+
88+enum_headers = $(foreach $1,$(notdir $(wildcard $2/*.h)),echo $(4:%=%/)$($1)$3)
89+
90+# Compile the testsuite, from autotest sources.
91+#
92+AUTOTEST_COMPILE = $(autotest_@AUTOTEST_COMPILE@)
93+autotest_command = autom4te --language autotest --include ${srcdir}
94+autotest_missing = $(call missing,autom4te,Unable to compile the testsuite)
95+
96+testsuite: %: %.at headers.at
97+ $(AUTOTEST_COMPILE) -o $* $<
98+
99+# Display a diagnostic message, explaining that any specified program
100+# is required, but has not been installed.
101+#
102+define missing
103+$(warning The program '$1' does not appear to be installed.)
104+$(call $1_description)$(error $2)
105+endef
106+
107+# Describe the circumstances under which the autom4te program may be
108+# required for building the testsuite, as an adjunct to the diagnostic
109+# notification that it may need to be installed.
110+#
111+define autom4te_description
112+$(info )
113+$(info This program is used to compile the testsuite driver script, from)
114+$(info original autotest source files. You need it when you are building)
115+$(info the testsuite from a checked-out clone of the source code repository;)
116+$(info otherwise, you should need it only if you have modified any of those)
117+$(info testsuite source files, or you have changed the package content in)
118+$(info any way which may cause any of these files to be regenerated.)
119+$(info )
120+$(info If you do need it, you may obtain it by installing GNU autoconf.)
121+$(info )
122+endef
123+
124+# Install a local copy of the package components to be tested; we need
125+# the full mingwrt package, and also the w32api headers, to ensure that
126+# we are testing what we've built, and not those which were installed
127+# with whatever compiler we are using for the build.
128+#
129+testsuite.install: install-mingwrt install-w32api-headers
130+
131+install-mingwrt:
132+ $(MAKE) -C .. --no-print-directory prefix=${CURDIR} $@
133+
134+chkconfig = ($1/config.status --version | grep $2) 2>&1 > /dev/null
135+install-w32api-headers:
136+ @for dir in ../../w32api*; do \
137+ if $(call chkconfig,$$dir,'MinGW Win32 API'); then \
138+ $(MAKE) -C $$dir --no-print-directory prefix=${CURDIR} $@; break; \
139+ fi; \
140+ done
141+
142+# $RCSfile$: end of file
--- /dev/null
+++ b/mingwrt/tests/atlocal.in
@@ -0,0 +1,45 @@
1+# @autoconf_input@
2+#
3+# Autotest configuration template for MinGW.org Runtime Library Package
4+#
5+# $Id$
6+#
7+# Written by Keith Marshall <keithmarshall@users.sourceforge.net>
8+# Copyright (C) 2016, MinGW.org Project
9+#
10+#
11+# Permission is hereby granted, free of charge, to any person obtaining a
12+# copy of this software and associated documentation files (the "Software"),
13+# to deal in the Software without restriction, including without limitation
14+# the rights to use, copy, modify, merge, publish, distribute, sublicense,
15+# and/or sell copies of the Software, and to permit persons to whom the
16+# Software is furnished to do so, subject to the following conditions:
17+#
18+# The above copyright notice and this permission notice (including the next
19+# paragraph) shall be included in all copies or substantial portions of the
20+# Software.
21+#
22+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
23+# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25+# AUTHORS OR THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
27+# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
28+# DEALINGS IN THE SOFTWARE.
29+#
30+#
31+# Options we need to pass to the GCC compilers, to ensure that we will be
32+# testing locally installed copies of our system headers and libraries, in
33+# the testsuite directory, rather than those associated with the compilers
34+# themselves.
35+#
36+at_compiler_config="-nostdinc -iwithprefixbefore include"
37+at_package_includes="-I $at_top_build_prefix/../include"
38+
39+# Commands to invoke the C and C++ compilers, as identified during package
40+# configuration.
41+#
42+at_compiler_cc="@CC@ $at_compiler_config $at_package_includes"
43+at_compiler_cxx="@CXX@ $at_compiler_config $at_package_includes"
44+
45+# $RCSfile$: vim: set filetype=config: end of file
--- /dev/null
+++ b/mingwrt/tests/headers.at
@@ -0,0 +1,154 @@
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/fcntl.h dnl
86+sys/file.h dnl
87+sys/locking.h dnl
88+sys/param.h dnl
89+sys/stat.h dnl
90+sys/timeb.h dnl
91+sys/time.h dnl
92+sys/types.h dnl
93+sys/unistd.h dnl
94+sys/utime.h dnl
95+])# MINGWRT_AT_PACKAGE_HEADERS
96+
97+# MINGWRT_AT_HASH_INCLUDE( HEADER )
98+# ---------------------------------
99+# Emit a single "#include <HEADER>" statement into a generated
100+# program language source file.
101+#
102+m4_define([MINGWRT_AT_HASH_INCLUDE],dnl
103+[[#include <$1>
104+]])# MINGWRT_AT_HASH_INCLUDE
105+
106+# MINGWRT_AT_CHECK_HEADERS_STANDALONE( LANG )
107+# -------------------------------------------
108+# Check compilability and self-containment of all package headers,
109+# when each is compiled individually, using the LANG compiler.
110+#
111+m4_define([MINGWRT_AT_CHECK_HEADERS_STANDALONE],[MINGW_AT_LANG([$1])dnl
112+AT_BANNER([Header integrity checks: stand-alone compile; language = $1.])
113+m4_foreach_w([HEADER],MINGWRT_AT_PACKAGE_HEADERS,[dnl
114+AT_SETUP([#include <]HEADER[>])AT_KEYWORDS([$1 $1-headers])
115+AS_VAR_APPEND([CPPFLAGS],[" -Wall -Wextra -Wsystem-headers"])
116+m4_if(HEADER,[unistd.h],AS_VAR_APPEND([CPPFLAGS],[" -Wno-deprecated-declarations"]))
117+m4_if(HEADER,[sys/stat.h],AS_VAR_APPEND([CPPFLAGS],[" -D_MINGW_S_IFBLK_KLUDGE"]))
118+MINGW_AT_CHECK_COMPILE([dnl
119+#define __IN_MINGWRT_TESTSUITE__ 1
120+m4_if(HEADER,[values.h],MINGWRT_AT_HASH_INCLUDE([_mingw.h]))dnl
121+MINGWRT_AT_HASH_INCLUDE(HEADER)dnl
122+int main(){ return __MINGW32_MAJOR_VERSION; }])
123+AT_CLEANUP
124+])])# MINGWRT_AT_CHECK_HEADERS_STANDALONE
125+#
126+# Run it, for each of LANG = C and LANG = C++
127+#
128+m4_foreach([LANG],[C,C++],[MINGWRT_AT_CHECK_HEADERS_STANDALONE(LANG)])
129+
130+# MINGWRT_AT_CHECK_HEADERS_COMBINED( LANG )
131+# -----------------------------------------
132+# Check compilability of package headers, when all are included within
133+# a single translation unit, and compiled using the LANG compiler.
134+#
135+m4_define([MINGWRT_AT_CHECK_HEADERS_COMBINED],[MINGW_AT_LANG([$1])dnl
136+AT_SETUP([#include all; language = $1])AT_KEYWORDS([$1 $1-headers])
137+AS_VAR_APPEND([CPPFLAGS],[" -Wall -Wextra -Wsystem-headers"])
138+m4_if([$1],[C],AS_VAR_APPEND([CPPFLAGS],[" -Wno-deprecated-declarations"]))
139+MINGW_AT_CHECK_COMPILE([dnl
140+#define _MINGW_S_IFBLK_KLUDGE 1
141+#define __IN_MINGWRT_TESTSUITE__ 1
142+m4_foreach_w([HEADER],MINGWRT_AT_PACKAGE_HEADERS,[dnl
143+MINGWRT_AT_HASH_INCLUDE(HEADER)])
144+int main(){ return __MINGW32_MAJOR_VERSION; }])
145+AT_CLEANUP
146+])# MINGWRT_AT_CHECK_HEADERS_COMBINED
147+#
148+# Run it, for each of LANG = C and LANG = C++
149+#
150+AT_BANNER([Header consistency checks: composite compile.])
151+m4_foreach([LANG],[C,C++],[MINGWRT_AT_CHECK_HEADERS_COMBINED(LANG)])
152+
153+# vim: filetype=config formatoptions=croql
154+# $RCSfile$: end of file
--- /dev/null
+++ b/mingwrt/tests/testsuite.at.in
@@ -0,0 +1,92 @@
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+
91+# vim: filetype=config formatoptions=croql
92+# $RCSfile$: end of file