From: Ralf Wildenhues Date: Sat, 17 Oct 2009 13:18:27 +0000 (+0200) Subject: Add convenience `recheck' target to our toplevel Makefile.am. X-Git-Tag: ng-0.5a~461^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ba8a10e5e24c4df4bacd072ad755f295596861e0;p=thirdparty%2Fautomake.git Add convenience `recheck' target to our toplevel Makefile.am. * Makefile.am (recheck): New convenience target. * tests/README: Give examples for running only failed or outdated or otherwise selected tests. Signed-off-by: Ralf Wildenhues --- diff --git a/ChangeLog b/ChangeLog index 5313f4ed1..23cba8ed6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2009-10-17 Ralf Wildenhues + Add convenience `recheck' target to our toplevel Makefile.am. + * Makefile.am (recheck): New convenience target. + * tests/README: Give examples for running only failed or + outdated or otherwise selected tests. + Sync auxiliary files from upstream. * INSTALL, lib/INSTALL, lib/config.guess, lib/config.sub, lib/texinfo.tex: Sync from upstream. diff --git a/Makefile.am b/Makefile.am index d082a3ae9..66d8315cb 100644 --- a/Makefile.am +++ b/Makefile.am @@ -94,6 +94,23 @@ automake aclocal: Makefile INSTALL: lib/INSTALL cp $(srcdir)/lib/INSTALL $@ +## recheck: convenience proxy target for the test suites. +TEST_SUBDIRS = lib/Automake/tests tests + +.PHONY: recheck +recheck: + @failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + for subdir in $(TEST_SUBDIRS); do \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $@) || eval $$failcom; \ + done; \ + test -z "$$fail" + ################################################################ ## ## Everything past here is useful to the maintainer, but probably not diff --git a/Makefile.in b/Makefile.in index c52239021..f06e655d2 100644 --- a/Makefile.in +++ b/Makefile.in @@ -245,6 +245,7 @@ do_subst = sed \ -e 's,[@]configure_input[@],Generated from $@.in; do not edit by hand.,g' \ -e 's,[@]datadir[@],$(datadir),g' +TEST_SUBDIRS = lib/Automake/tests tests # Some simple checks, and then ordinary check. These are only really # guaranteed to work on my machine. @@ -843,6 +844,20 @@ automake aclocal: Makefile INSTALL: lib/INSTALL cp $(srcdir)/lib/INSTALL $@ +.PHONY: recheck +recheck: + @failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + for subdir in $(TEST_SUBDIRS); do \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $@) || eval $$failcom; \ + done; \ + test -z "$$fail" + ################################################################ # Ensure tests are world-executable diff --git a/tests/README b/tests/README index 4068ad6fc..d494b103d 100644 --- a/tests/README +++ b/tests/README @@ -5,15 +5,33 @@ User interface ============== -Running all tests +Running the tests ----------------- - make check + To run all tests: + + make -k check You can use `-jN' for faster completion (it even helps on a uniprocessor system, due to unavoidable sleep delays, as noted below). + To rerun only failed tests: + + make -k recheck + + To run only tests that are newer than their last results: + + make -k check RECHECK_LOGS= + + To run only selected tests: + + make -k check TESTS="foo.test bar.test" + + For non-GNU make, you might have to use this instead: + + env TESTS="foo.test bar.test" make -e -k check + Interpretation --------------