]> git.draconx.ca Git - dxcommon.git/blobdiff - testsuite.at
DX_C_ALIGNAS: Work around bash-5 parsing bug.
[dxcommon.git] / testsuite.at
index ee9925f876d941fc749241b5b3a60e4ed0e81412..5ca87bfd9a63362f5ea0ff794e38c0a841cdbd57 100644 (file)
@@ -1,13 +1,68 @@
-dnl Copyright © 2015 Nick Bowler
-dnl
-dnl License WTFPL2: Do What The Fuck You Want To Public License, version 2.
-dnl This is free software: you are free to do what the fuck you want to.
-dnl There is NO WARRANTY, to the extent permitted by law.
+AT_COPYRIGHT([dnl
+Copyright © 2015, 2019-2023 Nick Bowler
+License WTFPL2: Do What The Fuck You Want To Public License, version 2.
+This is free software: you are free to do what the fuck you want to.
+There is NO WARRANTY, to the extent permitted by law.])
+
+m4_include([snippet/at-compat.at])
+m4_include([snippet/test-tap.at])
+m4_include([snippet/test-nls.at])
 
 AT_INIT
 AT_COLOR_TESTS
 
-AT_TESTED([prove])
+m4_divert_push([PREPARE_TESTS])dnl
+# Reduce influence from the toplevel "make" invocation on test cases.
+AS_UNSET([MAKEFLAGS])
+AS_UNSET([MAKELEVEL])
+AS_UNSET([MFLAGS])
+m4_divert_pop([PREPARE_TESTS])
+
+m4_define([TEST_CONFIGURE_AC], [AT_KEYWORDS([autoconf m4])dnl
+AT_DATA([configure.ac],
+[[AC_INIT([test], [0])
+
+# Install t/bork into the path, which contains a non-functional
+# dummy "awk" command to catch direct "awk" usage (as opposed to
+# using AC_PROG_AWK and $AWK).  Then work around direct awk usage
+# in LT_INIT to avoid the dummy.
+test_orig_PATH=$PATH
+PATH=$at_srcdir/t/bork:$PATH
+m4@&t@_ifdef([LT_INIT], [m4@&t@_define([LT_INIT],
+[m4@&t@_pushdef([awk], [$AWK])]m4@&t@_defn([LT_INIT])[m4@&t@_popdef([awk])])])
+
+]$1[
+AC_OUTPUT
+]])
+cp "$srcdir/install-sh" \
+   "$srcdir/depcomp" \
+   "$srcdir/missing" \
+   "$srcdir/compile" \
+   "$srcdir/config.sub" \
+   .
+# Simplified config.guess script avoids some spurious testcase failures
+# when using heirloom-sh on GNU/Linux.
+config_guess=`"$srcdir/config.guess"`
+cat >config.guess <<EOF
+#!/bin/sh
+cat <<'GUESS_EOF'
+$config_guess
+GUESS_EOF
+EOF
+chmod +x config.guess
+])
+m4_define([TEST_AUTORECONF], [AT_KEYWORDS([autoconf])dnl
+AT_CHECK([autoreconf -I "$srcdir/m4"], [0], [], [stderr])])
+
+m4_define([TEST_CONFIGURE], [AT_KEYWORDS([configure])dnl
+AT_CHECK([export CC
+CONFIG_SHELL=$TEST_SHELL $TEST_SHELL m4_default([$2],
+[./configure]) --quiet CONFIG_SHELL="$TEST_SHELL" \
+  at_srcdir="$srcdir" AWK="$AWK" $1])])
 
 m4_include([tests/macros.at])
+m4_include([tests/snippets.at])
 m4_include([tests/functions.at])
+m4_include([tests/programs.at])
+m4_include([tests/libs.at])
+m4_include([tests/scripts.at])