diff options
author | Hans Ulrich Niedermann <hun@n-dimensional.de> | 2008-06-21 00:35:32 +0200 |
---|---|---|
committer | Hans Ulrich Niedermann <hun@n-dimensional.de> | 2008-06-21 00:35:32 +0200 |
commit | 1a8245036598e0d1741b428f55178300649e8d8d (patch) | |
tree | 5f21d3936aef779f1c18745ba9f995064c530125 | |
parent | 28ceacbca5f3cc398606751456bd115585d01abd (diff) | |
download | ndim-git-utils-1a8245036598e0d1741b428f55178300649e8d8d.tar.gz ndim-git-utils-1a8245036598e0d1741b428f55178300649e8d8d.tar.xz ndim-git-utils-1a8245036598e0d1741b428f55178300649e8d8d.zip |
Add preliminary autotest test infrastructure
-rw-r--r-- | Makefile.am | 2 | ||||
-rw-r--r-- | NEWS | 2 | ||||
-rw-r--r-- | configure.ac | 5 | ||||
-rw-r--r-- | test/Makefile.am | 83 | ||||
-rw-r--r-- | test/atlocal.in | 0 | ||||
-rw-r--r-- | test/autotest.at | 3 | ||||
-rw-r--r-- | test/local.at | 4 |
7 files changed, 97 insertions, 2 deletions
diff --git a/Makefile.am b/Makefile.am index b941841..158c52b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -20,6 +20,8 @@ AM_CPPFLAGS = -I${top_builddir}/include ACLOCAL_AMFLAGS = -I m4 --install +SUBDIRS = . test + include Makefile-files include doc/Makefile-files include git-ndim-sh/Makefile-files @@ -1,4 +1,4 @@ -ndim-git-utils 1.17.1 +ndim-git-utils 1.17.2 ndim-git-utils 1.17 * New: diff --git a/configure.ac b/configure.ac index ac56c71..168aba7 100644 --- a/configure.ac +++ b/configure.ac @@ -2,13 +2,14 @@ AC_PREREQ(2.61) AC_INIT([ndims git utilities], - [1.17.1], + [1.17.2], [hun@n-dimensional.de], [ndim-git-utils]) AC_CONFIG_AUX_DIR([auto-aux]) AC_CONFIG_HEADER([include/config.h]) AC_CONFIG_SRCDIR([git-amb/git-amb.in]) AC_CONFIG_MACRO_DIR([m4]) +AC_CONFIG_TESTDIR([test]) AM_INIT_AUTOMAKE([-Wall -Werror foreign 1.10 dist-bzip2 check-news readme-alpha std-options]) @@ -37,6 +38,8 @@ AC_CONFIG_FILES([git-rebase-subtree/git-rebase-subtree]) AC_CONFIG_FILES([git-rebase-subtree/git-rebase-subtree.man]) AC_CONFIG_FILES([git-ndim-sh/git-ndim-sh]) AC_CONFIG_FILES([nbb/nbb_lib.py:nbb/nbb_lib.in]) +AC_CONFIG_FILES([test/atlocal]) +AC_CONFIG_FILES([test/Makefile]) AC_OUTPUT ######################################################################## diff --git a/test/Makefile.am b/test/Makefile.am new file mode 100644 index 0000000..cc239c8 --- /dev/null +++ b/test/Makefile.am @@ -0,0 +1,83 @@ +# tests/Makefile.am - handle the autotest based testsuite + +EXTRA_DIST = +DISTCLEANFILES = + +TESTCASES = +TESTCASES += autotest.at +# Add more testcases here + +EXTRA_DIST += $(TESTCASES) + +TESTSUITE = testsuite + +EXTRA_DIST += atlocal.in local.at +DISTCLEANFILES += atconfig atlocal + +DISTCLEANFILES += \ + testsuite.log \ + testsuite.dir/at-stderr \ + testsuite.dir/at-stdout \ + testsuite.dir/at-check-line \ + testsuite.dir/at-status + +check-local: atconfig atlocal $(TESTSUITE) + if test -f "$(srcdir)/$(TESTSUITE)"; then dir="$(srcdir)"; else dir="."; fi; \ + $(SHELL) "$${dir}/$(TESTSUITE)" AUTOTEST_PATH=`cd $(top_builddir) > /dev/null && pwd` \ + $(TESTSUITEFLAGS) + +installcheck-local: atconfig atlocal $(TESTSUITE) + if test -f "$(srcdir)/$(TESTSUITE)"; then dir="$(srcdir)"; else dir="."; fi; \ + $(SHELL) "$${dir}/$(TESTSUITE)" AUTOTEST_PATH='$(bindir)' \ + $(TESTSUITEFLAGS) + +clean-local: + test ! -f '$(TESTSUITE)' || \ + $(SHELL) '$(TESTSUITE)' --clean + +# Note about the location of testsuite.at, $(TESTSUITE), and package.m4: +# We locate these files in the $(srcdir), because +# a) They are shipped in the source tarball. +# b) If they are created in $(builddir), they will need to be removed on +# "make clean" or "make distclean". Re-generation requires tools a +# normal system does not need to have. +# c) They do not change depending on any configure run, they only change +# depending on configure.ac or tests/Makefile.am updates - and those +# require special build tools to handle anyway. Thus, a normal build +# will not touch these files at all and just leave the filese from +# upstream in place. + +# testsuite.at depends on Makefile.am to make sure that changes in the +# list of TESTCASES are reflected in testsuite.at. We do not depend on +# Makefile, as Makefile is re-created on every ./configure run, and that +# does not imply an addition to TESTCASES. +EXTRA_DIST += $(srcdir)/testsuite.at +$(srcdir)/testsuite.at: $(TESTCASES) Makefile.am + { \ + echo "dnl testsuite.at autogenerated from tests/Makefile.am"; \ + for tc in $(TESTCASES); do \ + echo "m4_include([$${tc}])"; \ + done; \ + } > $(srcdir)/testsuite.at + +# FIXME: Hack to handle unset AUTOM4TE variable +EXTRA_DIST += $(srcdir)/$(TESTSUITE) +$(srcdir)/$(TESTSUITE): $(srcdir)/testsuite.at $(srcdir)/local.at $(srcdir)/package.m4 + AUTOM4TE="$(AUTOM4TE)"; \ + if test "x$${AUTOM4TE}" = "x"; then AUTOM4TE="autom4te"; fi; \ + $${AUTOM4TE} --language=autotest -I '$(srcdir)' -o $(TESTSUITE).tmp $(srcdir)/testsuite.at + mv $(TESTSUITE).tmp $(srcdir)/$(TESTSUITE) + +EXTRA_DIST += $(srcdir)/package.m4 +$(srcdir)/package.m4: $(top_srcdir)/configure.ac + { \ + echo '# Signature of the current package (generated by tests/Makefile.am).'; \ + 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@])'; \ + } > $(srcdir)/package.m4 + +# End of tests/Makefile.am. + diff --git a/test/atlocal.in b/test/atlocal.in new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/test/atlocal.in diff --git a/test/autotest.at b/test/autotest.at new file mode 100644 index 0000000..29c4898 --- /dev/null +++ b/test/autotest.at @@ -0,0 +1,3 @@ +AT_SETUP([autotest tests]) +AT_KEYWORDS([autotest]) +AT_CLEANUP diff --git a/test/local.at b/test/local.at new file mode 100644 index 0000000..fddff98 --- /dev/null +++ b/test/local.at @@ -0,0 +1,4 @@ +AT_TESTED([autom4te autoconf autoheader autoupdate autoreconf]) +AT_INIT +AT_COPYRIGHT([Copyright (C) 2007 Hans Ulrich Niedermann]) +# Local initialization of the test environment would happen here |