]> git.draconx.ca Git - dxcommon.git/blob - testsuite.at
Include AT_INIT bugfix monkey patch in the testsuite.
[dxcommon.git] / testsuite.at
1 AT_COPYRIGHT([dnl
2 Copyright © 2015, 2019-2023 Nick Bowler
3 License WTFPL2: Do What The Fuck You Want To Public License, version 2.
4 This is free software: you are free to do what the fuck you want to.
5 There is NO WARRANTY, to the extent permitted by law.])
6
7 m4_include([snippet/at-compat.at])
8 m4_include([snippet/test-tap.at])
9 m4_include([snippet/test-nls.at])
10
11 AT_INIT
12 AT_COLOR_TESTS
13
14 m4_divert_push([PREPARE_TESTS])dnl
15 # Reduce influence from the toplevel "make" invocation on test cases.
16 AS_UNSET([MAKEFLAGS])
17 AS_UNSET([MAKELEVEL])
18 AS_UNSET([MFLAGS])
19 m4_divert_pop([PREPARE_TESTS])
20
21 m4_define([TEST_CONFIGURE_AC], [AT_KEYWORDS([autoconf m4])dnl
22 AT_DATA([configure.ac],
23 [[AC_INIT([test], [0])
24
25 # Install t/bork into the path, which contains a non-functional
26 # dummy "awk" command to catch direct "awk" usage (as opposed to
27 # using AC_PROG_AWK and $AWK).  Then work around direct awk usage
28 # in LT_INIT to avoid the dummy.
29 test_orig_PATH=$PATH
30 PATH=$at_srcdir/t/bork:$PATH
31 m4@&t@_ifdef([LT_INIT], [m4@&t@_define([LT_INIT],
32 [m4@&t@_pushdef([awk], [$AWK])]m4@&t@_defn([LT_INIT])[m4@&t@_popdef([awk])])])
33
34 ]$1[
35 AC_OUTPUT
36 ]])
37 cp "$srcdir/install-sh" \
38    "$srcdir/depcomp" \
39    "$srcdir/missing" \
40    "$srcdir/compile" \
41    "$srcdir/config.sub" \
42    .
43 # Simplified config.guess script avoids some spurious testcase failures
44 # when using heirloom-sh on GNU/Linux.
45 config_guess=`"$srcdir/config.guess"`
46 cat >config.guess <<EOF
47 #!/bin/sh
48 cat <<'GUESS_EOF'
49 $config_guess
50 GUESS_EOF
51 EOF
52 chmod +x config.guess
53 ])
54 m4_define([TEST_AUTORECONF], [AT_KEYWORDS([autoconf])dnl
55 AT_CHECK([autoreconf -I "$srcdir/m4"], [0], [], [stderr])])
56
57 m4_define([TEST_CONFIGURE], [AT_KEYWORDS([configure])dnl
58 AT_CHECK([export CC
59 CONFIG_SHELL=$TEST_SHELL $TEST_SHELL m4_default([$2],
60 [./configure]) --quiet CONFIG_SHELL="$TEST_SHELL" \
61   at_srcdir="$srcdir" AWK="$AWK" $1])])
62
63 m4_include([tests/macros.at])
64 m4_include([tests/snippets.at])
65 m4_include([tests/functions.at])
66 m4_include([tests/programs.at])
67 m4_include([tests/libs.at])
68 m4_include([tests/scripts.at])