diff options
author | Morgan Deters <mdeters@gmail.com> | 2010-05-27 19:49:17 +0000 |
---|---|---|
committer | Morgan Deters <mdeters@gmail.com> | 2010-05-27 19:49:17 +0000 |
commit | e5c77b0674a9cb698e6012ccc1950fef9bee4f8d (patch) | |
tree | f7bba60da261be820931148c8637c3cf2b116514 /test/Makefile.am | |
parent | 6f5d68c98be8a53ed98b0c0bd1c466f415b01526 (diff) |
Use the newer automake test driver "parallel-tests". This driver:
* keeps test logs around
* provides parallel testing functionality (with make -jN).
I've also added new functionality in test/Makefile.am which deletes old test logs, ensures that ALL tests are tried (even if units fail), and provides a color-coded summary at the end of the test run, which shows how many units, regressions (per level), and system tests failed (or passed), and provides a link to the log file for further information.
Resolves bug 117.
Diffstat (limited to 'test/Makefile.am')
-rw-r--r-- | test/Makefile.am | 41 |
1 files changed, 38 insertions, 3 deletions
diff --git a/test/Makefile.am b/test/Makefile.am index 316b2a140..31978b3c2 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -1,11 +1,46 @@ -SUBDIRS = unit system regress +SUBDIRS = unit system regress . + +MAKEFLAGS = -k .PHONY: regress0 regress1 regress2 regress3 regress0 regress1 regress2 regress3: + @$(MAKE) check-pre; \ for dir in $(SUBDIRS); do \ - (cd $$dir && $(MAKE) $(AM_MAKEFLAGS) $@) || exit 1; \ - done + test $$dir = . || (cd $$dir && $(MAKE) $(AM_MAKEFLAGS) $@); \ + done; \ + $(MAKE) check-local # synonyms for "check" .PHONY: regress test regress test: check + +am__tty_colors = \ +red=; grn=; lgn=; blu=; std=; \ +test "X$(AM_COLOR_TESTS)" != Xno \ +&& test "X$$TERM" != Xdumb \ +&& { test "X$(AM_COLOR_TESTS)" = Xalways || test -t 1 2>/dev/null; } \ +&& { \ + red='[0;31m'; \ + grn='[0;32m'; \ + lgn='[1;32m'; \ + blu='[1;34m'; \ + std='[m'; \ +} +subdirs_to_check = unit system regress/regress0 regress/regress1 regress/regress2 regress/regress3 +check-recursive: check-pre +.PHONY: check-pre +check-pre: + @rm -f $(subdirs_to_check:=/test-suite.log) +check-local: + @$(am__tty_colors); \ + echo $${blu}=============================== TESTING SUMMARY =============================$$std; \ + for log in $(subdirs_to_check:=/test-suite.log); do \ + if test -s "$$log"; then \ + status="`head -n 5 $$log | tail -1`"; \ + if echo "$$status" | grep -q failed; then col=$$red; \ + else col=$$grn; fi; \ + echo "$$col$$status"; \ + echo " @abs_builddir@/$$log$$std"; \ + fi; \ + done; \ + echo $${blu}=============================== TESTING SUMMARY =============================$$std |