]> git.draconx.ca Git - dxcommon.git/blob - testsuite.at
Move TAP testsuite macros into snippets.
[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 AT_INIT
8 AT_COLOR_TESTS
9
10 m4_include([snippet/test-tap.at])
11
12 m4_divert_push([PREPARE_TESTS])dnl
13 # Reduce influence from the toplevel "make" invocation on test cases.
14 AS_UNSET([MAKEFLAGS])
15 AS_UNSET([MAKELEVEL])
16 AS_UNSET([MFLAGS])
17 m4_divert_pop([PREPARE_TESTS])
18
19 m4_define([TEST_CONFIGURE_AC], [AT_KEYWORDS([autoconf m4])dnl
20 AT_DATA([configure.ac],
21 [[AC_INIT([test], [0])
22
23 # Install t/bork into the path, which contains a non-functional
24 # dummy "awk" command to catch direct "awk" usage (as opposed to
25 # using AC_PROG_AWK and $AWK).  Then work around direct awk usage
26 # in LT_INIT to avoid the dummy.
27 test_orig_PATH=$PATH
28 PATH=$at_srcdir/t/bork:$PATH
29 m4@&t@_ifdef([LT_INIT], [m4@&t@_define([LT_INIT],
30 [m4@&t@_pushdef([awk], [$AWK])]m4@&t@_defn([LT_INIT])[m4@&t@_popdef([awk])])])
31
32 ]$1[
33 AC_OUTPUT
34 ]])
35 cp "$srcdir/install-sh" \
36    "$srcdir/depcomp" \
37    "$srcdir/missing" \
38    "$srcdir/compile" \
39    "$srcdir/config.sub" \
40    .
41 # Simplified config.guess script avoids some spurious testcase failures
42 # when using heirloom-sh on GNU/Linux.
43 config_guess=`"$srcdir/config.guess"`
44 cat >config.guess <<EOF
45 #!/bin/sh
46 cat <<'GUESS_EOF'
47 $config_guess
48 GUESS_EOF
49 EOF
50 chmod +x config.guess
51 ])
52 m4_define([TEST_AUTORECONF], [AT_KEYWORDS([autoconf])dnl
53 AT_CHECK([autoreconf -I "$srcdir/m4"], [0], [], [stderr])])
54
55 m4_define([TEST_CONFIGURE], [AT_KEYWORDS([configure])dnl
56 AT_CHECK([export CC
57 CONFIG_SHELL=$TEST_SHELL $TEST_SHELL m4_default([$2],
58 [./configure]) --quiet CONFIG_SHELL="$TEST_SHELL" \
59   at_srcdir="$srcdir" AWK="$AWK" $1])])
60
61 m4_include([tests/macros.at])
62 m4_include([tests/snippets.at])
63 m4_include([tests/functions.at])
64 m4_include([tests/programs.at])
65 m4_include([tests/libs.at])
66 m4_include([tests/scripts.at])