1 # Copyright © 2015 Nick Bowler
3 # Automake fragment to hook up a basic Autotest test suite into the build.
4 # It is expected that a testsuite.at file exists in $(srcdir). The
5 # testsuite will be output to $(builddir)/testsuite.
7 # You must define the AUTOTEST variable to the Autotest program (normally,
8 # this is autom4te -l autotest). The DX_PROG_AUTOTEST macro can be used
9 # to set this automatically. You must also define the HAVE_AUTOTEST Automake
10 # conditional which controls whether the testsuite-generating rules are
11 # enabled. If DX_PROG_AUTOTEST is used, this may be set like:
14 # AM_CONDITIONAL([HAVE_AUTOTEST], [test x"$dx_cv_autotest_works" = x"yes"])
16 # License WTFPL2: Do What The Fuck You Want To Public License, version 2.
17 # This is free software: you are free to do what the fuck you want to.
18 # There is NO WARRANTY, to the extent permitted by law.
20 check-local: check-autotest
21 check-autotest: testsuite
22 $(SHELL) $? $(TESTSUITEFLAGS)
23 .PHONY: check-autotest
25 clean-local: clean-autotest
27 for f in testsuite "$(srcdir)/testsuite"; do \
28 test ! -f "$$f" || { $(SHELL) "$$f" --clean; break; }; \
30 .PHONY: clean-autotest
32 maintainer-clean-local: maintainer-clean-autotest
33 maintainer-clean-autotest:
34 rm -f testsuite package.m4
35 .PHONY: maintainerclean-autotest
39 printf 'm4_define([%s], [%s])\n' \
40 AT_PACKAGE_NAME '$(PACKAGE_NAME)' \
41 AT_PACKAGE_TARNAME '$(PACKAGE_TARNAME)' \
42 AT_PACKAGE_VERSION '$(PACKAGE_VERSION)' \
43 AT_PACKAGE_STRING '$(PACKAGE_STRING)' \
44 AT_PACKAGE_BUGREPORT '$(PACKAGE_BUGREPORT)' \
45 AT_PACKAGE_URL '$(PACKAGE_URL)' \
47 $(AM_V_at) mv -f $@.tmp $@
49 testsuite: testsuite.at package.m4
52 printf 'ERROR: Autotest was not available at configure time.\n'; \
53 printf 'You should only need it if you modified the test suite.\n'; \
54 printf 'Autotest is part of autom4te, included in the GNU\n'; \
55 printf 'Autoconf package: <https://gnu.org/s/autoconf/>\n'; \
59 $(AM_V_GEN) $(AUTOTEST) $(ATFLAGS) -p m4_include -o $@.tmp testsuite.at
61 $(AUTOTEST) $(ATFLAGS) -t m4_include:'$@: $$1' testsuite.at; \
62 $(AUTOTEST) $(ATFLAGS) -t m4_include:'$$1:' testsuite.at; \
64 $(AM_V_at) mv -f $@.tmp $@
66 EXTRA_DIST += testsuite testsuite.at package.m4
67 DISTCLEANFILES += atconfig $(DEPDIR)/testsuite.P
69 @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/testsuite.P@am__quote@