diff options
author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2016-02-16 03:02:01 +0100 |
---|---|---|
committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2016-02-16 03:19:32 +0100 |
commit | 107536fe38773ebe408cee5e01add97989797370 (patch) | |
tree | c71f895115dca3289f2be135bdf4e7b513dac994 /tests | |
parent | 845738eb874cc2ca80b45a4fe873b25207179197 (diff) | |
download | sciteco-107536fe38773ebe408cee5e01add97989797370.tar.gz |
finally added Autotest suite
* Autotest ships with Autoconf, so it's available already
and relatively easy to integrate into an Autotools package.
* This is attached to `make check` using some Automake magic.
* The test suite will only call the built SciTECO for the time being.
But using tests/Makefile.am, custom programs could be easily
built.
* Since it uses the target sciteco, it cannot work in cross-compile
environments.
* The test suite tests/testsuite.at should be used for regression
tests at least: Whenever there is a bug, a test case should be
added to testsuite.at.
Later this might be split up into multiple includes for regressions
other tests.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Makefile.am | 37 | ||||
-rw-r--r-- | tests/atlocal.in | 9 | ||||
-rw-r--r-- | tests/testsuite.at | 5 |
3 files changed, 51 insertions, 0 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am new file mode 100644 index 0000000..2fe3a53 --- /dev/null +++ b/tests/Makefile.am @@ -0,0 +1,37 @@ +# The `:;' works around a Bash 3.2 bug when the output is not writable. +$(srcdir)/package.m4: $(top_srcdir)/configure.ac + :;{ \ + echo '# Signature of the current package.' && \ + echo 'm4_define([AT_PACKAGE_NAME],' && \ + echo ' [$(PACKAGE_NAME)])' && \ + echo 'm4_define([AT_PACKAGE_TARNAME],' && \ + echo ' [$(PACKAGE_TARNAME)])' && \ + echo 'm4_define([AT_PACKAGE_VERSION],' && \ + echo ' [$(PACKAGE_VERSION)])' && \ + echo 'm4_define([AT_PACKAGE_STRING],' && \ + echo ' [$(PACKAGE_STRING)])' && \ + echo 'm4_define([AT_PACKAGE_BUGREPORT],' && \ + echo ' [$(PACKAGE_BUGREPORT)])'; \ + echo 'm4_define([AT_PACKAGE_URL],' && \ + echo ' [$(PACKAGE_URL)])'; \ + } >'$(srcdir)/package.m4' + +EXTRA_DIST = testsuite.at $(srcdir)/package.m4 $(TESTSUITE) atlocal.in +TESTSUITE = $(srcdir)/testsuite + +check-local: atconfig atlocal $(TESTSUITE) + $(SHELL) '$(TESTSUITE)' $(TESTSUITEFLAGS) + +installcheck-local: atconfig atlocal $(TESTSUITE) + $(SHELL) '$(TESTSUITE)' AUTOTEST_PATH='$(bindir)' \ + $(TESTSUITEFLAGS) + +clean-local: + test ! -f '$(TESTSUITE)' || \ + $(SHELL) '$(TESTSUITE)' --clean + +AUTOM4TE = $(SHELL) $(top_srcdir)/config/missing --run autom4te +AUTOTEST = $(AUTOM4TE) --language=autotest +$(TESTSUITE): $(srcdir)/testsuite.at $(srcdir)/package.m4 + $(AUTOTEST) -I '$(srcdir)' -o $@.tmp $@.at + mv $@.tmp $@ diff --git a/tests/atlocal.in b/tests/atlocal.in new file mode 100644 index 0000000..a4f30cc --- /dev/null +++ b/tests/atlocal.in @@ -0,0 +1,9 @@ +# `tests` is after `src`, so the target SciTECO is already +# built. +# Using the $BOOTSTRAP_SCITECO wouldn't make sense +# anyway as we don't want to test some preinstalled SciTECO. +SCITECO=@abs_top_builddir@/src/sciteco + +# Make sure that the standard library from the source package +# is used. +SCITECOPATH=@abs_top_srcdir@/lib diff --git a/tests/testsuite.at b/tests/testsuite.at new file mode 100644 index 0000000..b43f874 --- /dev/null +++ b/tests/testsuite.at @@ -0,0 +1,5 @@ +AT_INIT + +AT_SETUP([Closing loops at the correct macro level]) +AT_CHECK([$SCITECO -e '@^Ua{>} <Ma'], 1, ignore, ignore) +AT_CLEANUP |