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