summaryrefslogtreecommitdiff
path: root/lib/Automake
diff options
context:
space:
mode:
authorStefano Lattarini <stefano.lattarini@gmail.com>2011-08-08 14:49:06 +0200
committerStefano Lattarini <stefano.lattarini@gmail.com>2011-08-08 14:49:06 +0200
commit2ad993189da921058338b2cfdc1897ec7df35354 (patch)
treeb551c4031266aafadb42ef0526c13cf9155f2e47 /lib/Automake
parentb0a7f1ef5bfbcec5e8942270cdca18b424b5f28f (diff)
parent2cf22db73f5374bd0f528abfaf65987eab12a665 (diff)
downloadautomake-2ad993189da921058338b2cfdc1897ec7df35354.tar.gz
Merge branch 'test-protocols' into tap-testsuite-work
* test-protocols: test defs: more environment cleanup test harness: more minor VPATH-rewrite issues test harness: "make -n check" works correctly with Solaris make
Diffstat (limited to 'lib/Automake')
-rw-r--r--lib/Automake/tests/Makefile.in112
1 files changed, 60 insertions, 52 deletions
diff --git a/lib/Automake/tests/Makefile.in b/lib/Automake/tests/Makefile.in
index ab25bfedf..582294cb9 100644
--- a/lib/Automake/tests/Makefile.in
+++ b/lib/Automake/tests/Makefile.in
@@ -167,12 +167,8 @@ $(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT)
# See also 'test-harness-vpath-rewrite.test' and 'test-trs-basic.test'.
am__set_TESTS_bases = \
bases='$(TEST_LOGS)'; \
- bases=`for f in $$bases; do echo $$f; done | sed 's/\.log$$//'`; \
+ bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \
bases=`echo $$bases`
-# This can be used instead of $(MAKE) in recipes requiring a recursive call
-# to make, but which are not intended to be executed by "make -n". See the
-# GNU make manual for more details.
-am__stealth_MAKE = $(MAKE)
RECHECK_LOGS = $(TEST_LOGS)
AM_RECURSIVE_TARGETS = check check-html recheck recheck-html
TEST_SUITE_LOG = test-suite.log
@@ -354,34 +350,45 @@ cscope cscopelist:
# Recover from deleted `.trs' file; this should ensure that
# "rm -f foo.log; make foo.trs" re-run `foo.test', and re-create
-# both `foo.log' and `foo.trs'.
+# both `foo.log' and `foo.trs'. Break the recipe in two subshells
+# to avoid problems with "make -n".
.log.trs:
- rm -f $< $@ && $(am__stealth_MAKE) $(AM_MAKEFLAGS) $<
+ rm -f $< $@
+ $(MAKE) $(AM_MAKEFLAGS) $<
+
+# Helper recipe used by $(TEST_SUITE_LOG) below, to avoid problems with
+# "make -n". Break this recipe in multiple shell invocations too, to
+# really work as expected with "make -n".
+am--redo-logs:
+ @rm -f $$redo_logs
+ @rm -f $$redo_results
+ @$(MAKE) $(AM_MAKEFLAGS) $$redo_logs
+ @st=0; \
+ errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \
+ for i in $$redo_bases; do \
+ test -f $$i.trs && test -r $$i.trs \
+ || { echo "$$errmsg $$i.trs"; st=1; }; \
+ test -f $$i.log && test -r $$i.log \
+ || { echo "$$errmsg $$i.log"; st=1; }; \
+ done; \
+ test $$st -eq 0
$(TEST_SUITE_LOG): $(TEST_LOGS)
- @$(am__sh_e_setup); $(am__tty_colors); \
- f_ok () { test -f "$$1" && test -r "$$1"; }; \
- $(am__set_TESTS_bases); \
- ws='[ ]'; \
- redo_bases=`for b in $$bases; do \
- f_ok $$b.trs && f_ok $$b.log || echo $$b; \
+ @$(am__set_TESTS_bases); \
+ am__f_ok () { test -f "$$1" && test -r "$$1"; }; \
+ redo_bases=`for i in $$bases; do \
+ am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \
done`; \
if test -n "$$redo_bases"; then \
redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \
redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \
- rm -f $$redo_logs && rm -f $$redo_results \
- && $(am__stealth_MAKE) $(AM_MAKEFLAGS) $$redo_logs; \
- fi; \
- st=0; \
- for b in $$redo_bases; do \
- for e in trs log; do \
- f_ok $$b.$$e || { \
- echo "fatal: making $@: failed to create $$b.$$e" >&2; \
- st=1; \
- }; \
- done; \
- done; \
- test $$st -eq 0 || exit 1; \
+ redo_bases="$$redo_bases" \
+ redo_logs="$$redo_logs" \
+ redo_results="$$redo_results" \
+ $(MAKE) am--redo-logs || exit 1; \
+ else :; fi;
+ @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \
+ ws='[ ]'; \
results=`for b in $$bases; do echo $$b.trs; done`; \
test -n "$$results" || results=/dev/null; \
all=` grep "^$$ws*:test-result:" $$results | wc -l`; \
@@ -432,20 +439,20 @@ $(TEST_SUITE_LOG): $(TEST_LOGS)
echo; \
echo ".. contents:: :depth: 2"; \
echo; \
- for b in $$bases; do \
- if grep "^$$ws*:copy-in-global-log:$$ws*no$$ws*$$" $$b.trs \
+ for i in $$bases; do \
+ if grep "^$$ws*:copy-in-global-log:$$ws*no$$ws*$$" $$i.trs \
>/dev/null; then continue; \
fi; \
glob_res=`sed -n -e "s/$$ws*$$//" \
-e "s/^$$ws*:global-test-result:$$ws*//p" \
- $$b.trs`; \
+ $$i.trs`; \
test -n "$$glob_res" || glob_res=RUN; \
- echo "$$glob_res: $$b" | $(am__rst_section); \
- if test ! -r $$b.log; then \
- echo "fatal: making $@: $$b.log is unreadable" >&2; \
+ echo "$$glob_res: $$i" | $(am__rst_section); \
+ if test ! -r $$i.log; then \
+ echo "fatal: making $@: $$i.log is unreadable" >&2; \
exit 1; \
fi; \
- cat $$b.log; echo; \
+ cat $$i.log; echo; \
done; \
} >$(TEST_SUITE_LOG).tmp; \
mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \
@@ -474,11 +481,11 @@ check-TESTS:
@list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list
@list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list
@test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
- @list='$(TEST_LOGS)'; \
- list=`for f in $$list; do \
- test .log = $$f || echo $$f; \
- done | tr '\012\015' ' '`; \
- list=`echo "$$list" | sed 's/ *$$//'`; \
+ @list='$(TEST_LOGS)'; \
+ list=`for i in $$list; do \
+ test .log = $$i || echo $$i; \
+ done | tr '\012\015' ' '`; \
+ list=`echo "$$list" | sed 's/ *$$//'`; \
$(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$list"
.log.html:
@@ -509,10 +516,10 @@ recheck recheck-html:
@ws='[ ]'; \
target=`echo $@ | sed 's,^re,,'`; \
$(am__set_TESTS_bases); \
- list=`for b in $$bases; do \
- test -f $$b.trs || test -f $$b.log || continue; \
- grep "^$$ws*:recheck:$$ws*no$$ws*$$" $$b.trs \
- >/dev/null 2>&1 || echo $$b.log; \
+ list=`for i in $$bases; do \
+ test -f $$i.trs || test -f $$i.log || continue; \
+ grep "^$$ws*:recheck:$$ws*no$$ws*$$" $$i.trs \
+ >/dev/null 2>&1 || echo $$i.log; \
done | tr '\012\015' ' '`; \
list=`echo "$$list" | sed 's/ *$$//'`; \
$(MAKE) $(AM_MAKEFLAGS) $$target AM_MAKEFLAGS='$(AM_MAKEFLAGS) TEST_LOGS="'"$$list"'"'
@@ -660,16 +667,17 @@ uninstall-am:
.MAKE: check-am check-html install-am install-strip recheck \
recheck-html
-.PHONY: all all-am check check-TESTS check-am check-html clean \
- clean-generic clean-local distclean distclean-generic distdir \
- dvi dvi-am html html-am info info-am install install-am \
- install-data install-data-am install-dvi install-dvi-am \
- install-exec install-exec-am install-html install-html-am \
- install-info install-info-am install-man install-pdf \
- install-pdf-am install-ps install-ps-am install-strip \
- installcheck installcheck-am installdirs maintainer-clean \
- maintainer-clean-generic mostlyclean mostlyclean-generic pdf \
- pdf-am ps ps-am recheck recheck-html uninstall uninstall-am
+.PHONY: all all-am am--redo-logs check check-TESTS check-am check-html \
+ clean clean-generic clean-local distclean distclean-generic \
+ distdir dvi dvi-am html html-am info info-am install \
+ install-am install-data install-data-am install-dvi \
+ install-dvi-am install-exec install-exec-am install-html \
+ install-html-am install-info install-info-am install-man \
+ install-pdf install-pdf-am install-ps install-ps-am \
+ install-strip installcheck installcheck-am installdirs \
+ maintainer-clean maintainer-clean-generic mostlyclean \
+ mostlyclean-generic pdf pdf-am ps ps-am recheck recheck-html \
+ uninstall uninstall-am
.PHONY: maintainer-check-list-of-tests