From: Mark Wooding Date: Sat, 5 Apr 2008 13:57:55 +0000 (+0100) Subject: Add files to support Autotest-based test suites. X-Git-Tag: 1.3.2^0 X-Git-Url: https://git.distorted.org.uk/~mdw/cfd/commitdiff_plain/74c50df9aca7e5416d8e7d3d2c8f385ff103b081 Add files to support Autotest-based test suites. --- diff --git a/Makefile.am b/Makefile.am index 3f87396..29080c2 100644 --- a/Makefile.am +++ b/Makefile.am @@ -85,6 +85,10 @@ pkgdata_SCRIPTS += install-ac pkgdata_SCRIPTS += maninst pkgdata_SCRIPTS += confsubst +## Testsuites. +pkgdata_DATA += autotest.am +pkgdata_DATA += testsuite.at + EXTRA_DIST += $(pkgdata_DATA) EXTRA_DIST += $(pkgdata_SCRIPTS) diff --git a/autotest.am b/autotest.am new file mode 100644 index 0000000..3a34dc7 --- /dev/null +++ b/autotest.am @@ -0,0 +1,94 @@ +### -*-makefile-*- +### +### Build script for test framework +### +### (c) 2008 Straylight/Edgeware +### + +###----- Licensing notice --------------------------------------------------- +### +### This file is part of the Common Files Distribution (`common'). +### +### `Common' is free software; you can redistribute it and/or modify +### it under the terms of the GNU General Public License as published by +### the Free Software Foundation; either version 2 of the License, or +### (at your option) any later version. +### +### `Common' is distributed in the hope that it will be useful, +### but WITHOUT ANY WARRANTY; without even the implied warranty of +### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +### GNU General Public License for more details. +### +### You should have received a copy of the GNU General Public License +### along with `common'; if not, write to the Free Software Foundation, +### Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +EXTRA_DIST = +CLEANFILES = +DISTCLEANFILES = +MAINTAINERCLEANFILES = + +###-------------------------------------------------------------------------- +### The test suite. + +check-local: atconfig run-tests + ./run-tests $(TEST_ARGS) + +###-------------------------------------------------------------------------- +### Building the test suite. + +## testsuite +all_autotest_TESTS = $(autotest_TESTS) $(nodist_autotest_TESTS) +TESTDEPS = testsuite.at Makefile.in $(all_autotest_TESTS) +CLEANFILES += testsuite.log +DISTCLEANFILES += atconfig +MAINTAINERCLEANFILES += $(srcdir)/testsuite +EXTRA_DIST += testsuite.at testsuite $(autotest_TESTS) + +$(srcdir)/testsuite: $(TESTDEPS) + $(AUTOM4TE) --language=autotest \ + -I$(srcdir) $@.at -o $@.new && mv $@.new $@ + +clean-local: clean-testsuite-dir +.PHONY: clean-testsuite-dir +clean-testsuite-dir: + -rm -rf testsuite.dir + +## run-tests +CLEANFILES += run-tests + +run-tests: Makefile $(srcdir)/testsuite + { echo '#! /bin/sh'; \ + echo 'exec $(SHELL) $(srcdir)/testsuite "$$@"'; \ + } >$@.new && chmod +x $@.new && mv $@.new $@ + +###-------------------------------------------------------------------------- +### Infrastructure for the test suite build process. + +## tests.m4 +TESTDEPS += $(srcdir)/tests.m4 +MAINTAINERCLEANFILES += $(srcdir)/tests.m4 +EXTRA_DIST += tests.m4 + +$(srcdir)/tests.m4: Makefile.in + for i in $(all_autotest_TESTS); do \ + echo $$i | sed \ + -e 's:^$(top_srcdir):$(top_builddir):' \ + -e 's:\(.*\)/\([^/]*\)$$:TESTS([\1], [\2]):'; \ + done >$@.new && mv $@.new $@ + +## package.m4 +TESTDEPS += $(srcdir)/package.m4 +MAINTAINERCLEANFILES += $(srcdir)/package.m4 +EXTRA_DIST += package.m4 + +$(srcdir)/package.m4: $(top_srcdir)/configure.ac + { echo '### package information'; \ + echo 'm4_define([AT_PACKAGE_NAME], [@PACKAGE_NAME@])'; \ + echo 'm4_define([AT_PACKAGE_TARNAME], [@PACKAGE_TARNAME@])'; \ + echo 'm4_define([AT_PACKAGE_VERSION], [@PACKAGE_VERSION@])'; \ + echo 'm4_define([AT_PACKAGE_STRING], [@PACKAGE_STRING@])'; \ + echo 'm4_define([AT_PACKAGE_BUGREPORT], [@PACKAGE_BUGREPORT@])'; \ + } >$@.new && mv $@.new $@ + +###----- That's all, folks -------------------------------------------------- diff --git a/debian/changelog b/debian/changelog index 6f1a726..8c25f60 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +cfd (1.3.2) experimental; urgency=low + + * Add new files for Autotest support. + + -- Mark Wooding Sat, 05 Apr 2008 14:59:03 +0100 + cfd (1.3.1) experimental; urgency=low * Fix up scripts and build system for style. diff --git a/testsuite.at b/testsuite.at new file mode 100644 index 0000000..2122f5f --- /dev/null +++ b/testsuite.at @@ -0,0 +1,37 @@ +dnl -*-autotest-*- +dnl +dnl Generic test framework +dnl +dnl (c) 2008 Straylight/Edgeware +dnl + +dnl----- Licensing notice --------------------------------------------------- +dnl +dnl This file is part of the Common Files Distribution (`common'). +dnl +dnl `Common' is free software; you can redistribute it and/or modify +dnl it under the terms of the GNU General Public License as published by +dnl the Free Software Foundation; either version 2 of the License, or +dnl (at your option) any later version. +dnl +dnl `Common' is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +dnl GNU General Public License for more details. +dnl +dnl You should have received a copy of the GNU General Public License +dnl along with `common'; if not, write to the Free Software Foundation, +dnl Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +AT_INIT + +m4_define([TESTS], [dnl + m4_pushdef([SRCDIR], [$abs_srcdir/$1]) + m4_pushdef([BUILDDIR], [$abs_builddir/$1]) + m4_include([$1/$2]) + m4_popdef([BUILDDIR]) + m4_popdef([SRCDIR]) +]) +m4_include([tests.m4]) + +dnl----- That's all, folks --------------------------------------------------