]> git.draconx.ca Git - dxcommon.git/blobdiff - Makefile.am
Implement initial test suite.
[dxcommon.git] / Makefile.am
diff --git a/Makefile.am b/Makefile.am
new file mode 100644 (file)
index 0000000..21b5f95
--- /dev/null
@@ -0,0 +1,58 @@
+# Copyright © 2015 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.
+
+ACLOCAL_AMFLAGS = -I m4
+
+EXTRA_DIST =
+SUFFIXES =
+
+check-local: check-autotest
+check-autotest: testsuite
+       $(SHELL) testsuite $(TESTSUITEFLAGS)
+.PHONY: check-autotest
+
+clean-local: clean-autotest
+clean-autotest:
+       test ! -f testsuite || $(SHELL) testsuite --clean
+.PHONY: clean-autotest
+
+maintainer-clean-local: maintainer-clean-autotest
+maintainer-clean-autotest:
+       rm -f testsuite package.m4
+.PHONY: maintainerclean-autotest
+
+package.m4:
+       $(AM_V_GEN) :; { \
+         printf 'm4_define([%s], [%s])\n' \
+           AT_PACKAGE_NAME      '$(PACKAGE_NAME)' \
+           AT_PACKAGE_TARNAME   '$(PACKAGE_TARNAME)' \
+           AT_PACKAGE_VERSION   '$(PACKAGE_VERSION)' \
+           AT_PACKAGE_STRING    '$(PACKAGE_STRING)' \
+           AT_PACKAGE_BUGREPORT '$(PACKAGE_BUGREPORT)' \
+           AT_PACKAGE_URL       '$(PACKAGE_URL)' \
+       ; } >$@.tmp
+       $(AM_V_at) mv -f $@.tmp $@
+
+testsuite: testsuite.at package.m4
+if !HAVE_AUTOTEST
+       @:; { \
+         printf 'ERROR: Autotest was not available at configure time.\n'; \
+         printf 'You should only need it if you modified the test suite.\n'; \
+         printf 'Autotest is part of autom4te, included in the GNU\n'; \
+         printf 'Autoconf package: <https://gnu.org/s/autoconf/>\n'; \
+       } 1>&2
+       @false
+endif
+       $(AM_V_GEN) $(AUTOTEST) $(ATFLAGS) -p m4_include -o $@.tmp testsuite.at
+       $(AM_V_at) :; { \
+         $(AUTOTEST) $(ATFLAGS) -t m4_include:'$@: $$1' testsuite.at; \
+         $(AUTOTEST) $(ATFLAGS) -t m4_include:'$$1:' testsuite.at; \
+       } >$(DEPDIR)/$(@F).P
+       $(AM_V_at) mv -f $@.tmp $@
+
+EXTRA_DIST += testsuite testsuite.at package.m4
+
+@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/testsuite.P@am__quote@