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