automake-ng
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Automake-NG] [FYI] [ng] contrib: rewrite and fix 'check-html' and 'rech


From: Stefano Lattarini
Subject: [Automake-NG] [FYI] [ng] contrib: rewrite and fix 'check-html' and 'recheck-html'
Date: Sat, 11 Aug 2012 21:52:03 +0200

That has actually been broken for some time, due to the changes
done in Automake-NG proper in the meantime.

* contrib/check-html.am (.log.html): Re-declare this suffix rule ...
(%.html: %.log): ... as a pattern rule.
(mostlyclean-check-html): Remove, instead ...
(MOSTLYCLEANFILES): ... appending to this variable.  Not only this
reduce the code size, but will give us resilience against possible
exceeded command line length limits for free.
(check-html, recheck-html): Rewrite as static pattern rules.  Fix
the recursive "make check" and "make recheck" invocation to override
TESTS, not TEST_LOGS (the latter override is not honoured anymore
by the new incarnation of the parallel-test rules).
* contrib/t/parallel-tests-html-recursive.sh: Adjust a little, by
initializing 'MOSTLYCLEANFILES' (to empty) in all the 'Makefile.am'
files that use 'check-html.am'.
* contrib/t/parallel-tests-html.sh: Likewise.  Also, since the
parallel-tests API does not allow command-line overriding of
TEST_LOGS anymore, stop doing that.

Signed-off-by: Stefano Lattarini <address@hidden>
---
 contrib/check-html.am                      | 20 ++++++++------------
 contrib/t/parallel-tests-html-recursive.sh |  4 +++-
 contrib/t/parallel-tests-html.sh           |  4 +++-
 3 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/contrib/check-html.am b/contrib/check-html.am
index 2604c5e..ddcb501 100644
--- a/contrib/check-html.am
+++ b/contrib/check-html.am
@@ -21,14 +21,11 @@
 
 TEST_SUITE_HTML = $(TEST_SUITE_LOG:.log=.html)
 
-mostlyclean-local: mostlyclean-check-html
-.PHONY: mostlyclean-check-html
-mostlyclean-check-html:
-## Expand $(TEST_LOGS) only once, to avoid exceeding line length limits.
-       list='$(TEST_LOGS:.log=.html)'; test -z "$$list" || rm -f $$list
-       rm -f $(TEST_SUITE_HTML)
+## This expects MOSTLYCLEANFILES to be pre-defined by the clients (even
+## if just to the empty value).  Not ans unreasonable request.
+MOSTLYCLEANFILES += $(TEST_SUITE_HTML) $(TEST_LOGS:.log=.html)
 
-.log.html:
+%.html: %.log
        @list='$(RST2HTML) rst2html rst2html.py';                       \
        while :; do                                                     \
          for r2h in $$list; do                                         \
@@ -45,12 +42,11 @@ mostlyclean-check-html:
 # Beware of concurrent executions.  Run "check" not "check-TESTS", as
 # check-SCRIPTS and other dependencies are rebuilt by the former only.
 # And expect check to fail.
-check-html recheck-html:
-       @target=`echo $@ | sed 's/-html$$//'`; \
-       rv=0; $(MAKE) $$target || rv=$$?; \
-## The nullification of $(TEST_LOGS) is required to ensure that
+check-html recheck-html: %-html:
+       @rv=0; $(MAKE) $* || rv=$$?; \
+## The nullification of $(TESTS) is required to ensure that
 ## "make recheck-html" do not try to uselessly re-run tests.
-       $(MAKE) $(TEST_SUITE_HTML) TEST_LOGS= || exit 4; \
+       $(MAKE) $(TEST_SUITE_HTML) TESTS= || exit 4; \
        exit $$rv
 
 .PHONY: check-html recheck-html
diff --git a/contrib/t/parallel-tests-html-recursive.sh 
b/contrib/t/parallel-tests-html-recursive.sh
index 12d967e..e58cca9 100755
--- a/contrib/t/parallel-tests-html-recursive.sh
+++ b/contrib/t/parallel-tests-html-recursive.sh
@@ -34,6 +34,9 @@ cp "$am_top_srcdir"/contrib/check-html.am . \
 
 cat >> configure.ac << 'END'
 AM_EXTRA_RECURSIVE_TARGETS([check-html])
+# This variable must be defined in each Makefile.am that includes
+# 'check-html.am'.  It's simpler to do this once here.
+AC_SUBST([MOSTLYCLEANFILES], [])
 AC_CONFIG_FILES([sub/Makefile sub/more/Makefile])
 AC_OUTPUT
 END
@@ -106,7 +109,6 @@ test ! -f test.log
 test -f x.txt
 END
 
-
 cat > sub/more/mu << 'END'
 #!/bin/sh
 exit 99
diff --git a/contrib/t/parallel-tests-html.sh b/contrib/t/parallel-tests-html.sh
index 78cae7a..6e853ab 100755
--- a/contrib/t/parallel-tests-html.sh
+++ b/contrib/t/parallel-tests-html.sh
@@ -45,6 +45,8 @@ check_SCRIPTS = bla
 bla:
        echo bla > $@
 CLEANFILES = bla
+## Initialization of this required by 'check-html.am', below.
+MOSTLYCLEANFILES =
 include $(srcdir)/check-html.am
 END
 
@@ -120,7 +122,7 @@ test ! -e mylog.html
 
 $MAKE clean
 test ! -e mylog.html
-$MAKE check-html TEST_LOGS=foo.log
+$MAKE check-html TESTS=foo
 test -f bla
 test -f foo.log
 test ! -e bar.log
-- 
1.7.12.rc0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]