--- /dev/null
+### -*-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 --------------------------------------------------
--- /dev/null
+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 --------------------------------------------------