test-tap: Fix Solaris /bin/sh "prove: not found" on stderr.
[dxcommon.git] / tests / snippets.at
blobfe4eb0855a11dcdea87075e921e0de78de42009d
1 dnl Copyright © 2021-2022 Nick Bowler
2 dnl
3 dnl License WTFPL2: Do What The Fuck You Want To Public License, version 2.
4 dnl This is free software: you are free to do what the fuck you want to.
5 dnl There is NO WARRANTY, to the extent permitted by law.
7 AT_BANNER([Automake snippet tests])
9 m4_define([TEST_DEPFILES_INIT],
10 [TEST_CONFIGURE_AC(
11 [[AM_INIT_AUTOMAKE([foreign])
13 DX_PROG_AUTOTEST
14 AM_CONDITIONAL([HAVE_AUTOTEST], [test x"$dx_cv_autotest_works" = x"yes"])
16 AM_SET_DEPDIR
17 AM_OUTPUT_DEPENDENCY_COMMANDS
18 AM_MAKE_INCLUDE
19 AM_DEP_TRACK
21 AC_CONFIG_FILES([Makefile])
22 ]])
24 cp "$srcdir/snippet/autotest.mk" .
25 AT_DATA([Makefile.am],
26 [[EXTRA_DIST =
27 DISTCLEANFILES =
28 include $(top_srcdir)/autotest.mk
29 ]])
31 TEST_AUTORECONF])
33 AT_SETUP([autotest.mk depfiles (MAKE=gmake)])
35 TEST_DEPFILES_INIT
37 # gmake sanity check
38 AT_CHECK([{ echo 'rule:; @: $(info works)' |
39               gmake --no-print-directory -f - >out 2>/dev/null &&
40             read s <out && test x"$s" = x"works"; } || exit 77])
42 mkdir build
43 AT_CHECK([cd build && ../configure MAKE=gmake && test -f .deps/testsuite.P],
44   [0], [ignore])
45 AT_CHECK([gmake --no-print-directory -sC build distclean &&
46   find build -type f])
48 AT_CLEANUP
50 AT_SETUP([autotest.mk depfiles (MAKE=dmake)])
52 TEST_DEPFILES_INIT
54 # dmake sanity check
55 AT_CHECK([{ echo 'rule:; @echo works' | dmake -f - >out 2>/dev/null &&
56             read s <out && test x"$s" = x"works"; } || exit 77])
58 AT_CHECK([./configure MAKE=dmake && test -f .deps/testsuite.P], [0], [ignore])
60 AT_CLEANUP
62 AT_SETUP([autotest.mk no depfiles])
64 TEST_CONFIGURE_AC(
65 [[AM_INIT_AUTOMAKE([foreign])
67 AM_SET_DEPDIR
68 AM_OUTPUT_DEPENDENCY_COMMANDS
69 AM_MAKE_INCLUDE
70 AM_DEP_TRACK
72 DX_AUTOMAKE_COMPAT
73 AM_CONDITIONAL([HAVE_AUTOTEST], [:])
75 AC_CONFIG_FILES([Makefile])
76 ]])
78 cp "$srcdir/snippet/autotest.mk" .
79 AT_DATA([Makefile.am],
80 [[DISTCLEANFILES =
81 EXTRA_DIST =
82 include $(top_srcdir)/autotest.mk
83 ]])
84 TEST_AUTORECONF
86 TEST_CONFIGURE([--disable-dependency-tracking])
88 AT_DATA([testsuite.at])
89 AT_CHECK([make -s AUTOTEST="$srcdir/t/autotest.sh" testsuite])
91 AT_CLEANUP
93 AT_SETUP([glconfig.mk no depfiles])
95 TEST_CONFIGURE_AC(
96 [[AM_INIT_AUTOMAKE([foreign])
98 AM_SET_DEPDIR
99 AM_OUTPUT_DEPENDENCY_COMMANDS
100 AM_MAKE_INCLUDE
101 AM_DEP_TRACK
103 DX_AUTOMAKE_COMPAT
104 AC_SUBST([GLSRC], [lib])
106 AC_CONFIG_FILES([Makefile])
109 cp "$srcdir/snippet/glconfig.mk" .
110 AT_DATA([Makefile.am],
111 [[CLEANFILES =
112 DISTCLEANFILES =
113 gnulib_headers =
114 include $(top_srcdir)/glconfig.mk
116 TEST_AUTORECONF
118 TEST_CONFIGURE([--disable-dependency-tracking])
119 AT_CHECK([make -s lib/glconfig.h])
120 AT_CHECK([test ! -d lib/.deps && test ! -d lib/_deps && cat lib/glconfig.h])
122 AT_CLEANUP