automake-patches
[Top][All Lists]
Advanced

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

[FYI] {master} check: move ".log -> .html" conversion in contrib


From: Stefano Lattarini
Subject: [FYI] {master} check: move ".log -> .html" conversion in contrib
Date: Tue, 17 Jan 2012 15:44:38 +0100

That feature has been deprecated in the 1.11.x series, and marked
for removal from the automake core in the 1.12 release.  Here we
implement such removal.

Reference:
  <http://lists.gnu.org/archive/html/automake/2012-01/msg00005.html>

See also commit 'v1.11-650-g20f2ac9'.

* doc/automake.texi, NEWS: Update.
* lib/am/check.am: Don't include 'check-html.am' anymore.
* lib/am/check-html.am: Move ...
* contrib/check-html.am: ... to this, and adjust comments.
* lib/am/Makefile.am (dist_am_DATA): Update.
* contrib/Makefile.am (EXTRA_DIST): Likewise.
* tests/parallel-tests2.test: Adjust.
* tests/parallel-tests-dryrun.test: Remove checks on the
".log -> .html" conversion.
* tests/test-driver-custom-html.test: Remove as obsolete.
* tests/test-driver-custom-no-html.test: Likewise.
* tests/tap-html.test: Likewise.
* tests/list-of-tests.mk: Don't list removed tests anymore.
---
 NEWS                                  |    5 ++
 contrib/Makefile.am                   |    4 +-
 {lib/am => contrib}/check-html.am     |   10 +--
 doc/automake.texi                     |   33 ++---------
 lib/am/Makefile.am                    |    1 -
 lib/am/check.am                       |    6 --
 tests/list-of-tests.mk                |    3 -
 tests/parallel-tests-dryrun.test      |   16 ++---
 tests/parallel-tests2.test            |   18 +++++-
 tests/tap-html.test                   |   81 -------------------------
 tests/test-driver-custom-html.test    |  104 ---------------------------------
 tests/test-driver-custom-no-html.test |   69 ----------------------
 12 files changed, 41 insertions(+), 309 deletions(-)
 rename {lib/am => contrib}/check-html.am (91%)
 delete mode 100755 tests/tap-html.test
 delete mode 100755 tests/test-driver-custom-html.test
 delete mode 100755 tests/test-driver-custom-no-html.test

diff --git a/NEWS b/NEWS
index 98a1ec0..f2bced6 100644
--- a/NEWS
+++ b/NEWS
@@ -4,6 +4,11 @@ New in 1.11a:
 
   - Support for automatic de-ANSI-fication has been removed.
 
+  - Support for ".log -> .html" conversion and the check-html and
+    recheck-html targets has been removed from Automake core (but
+    remains available in the 'contrib/' directory of the Automake
+    distribution).
+
   - The deprecated `lzma' compression format for distribution archives
     has been removed, in favor of `xz' and `lzip'.
 
diff --git a/contrib/Makefile.am b/contrib/Makefile.am
index b491923..970ef75 100644
--- a/contrib/Makefile.am
+++ b/contrib/Makefile.am
@@ -17,4 +17,6 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-EXTRA_DIST = README
+EXTRA_DIST = \
+  check-html.am \
+  README
diff --git a/lib/am/check-html.am b/contrib/check-html.am
similarity index 91%
rename from lib/am/check-html.am
rename to contrib/check-html.am
index 13f0a47..1526976 100644
--- a/lib/am/check-html.am
+++ b/contrib/check-html.am
@@ -18,13 +18,13 @@
 ## Makefile.am fragment to produce HTML output from RST-formatted
 ## log files produced by the parallel-tests output.
 ## This fragment was part of the automake core in the 1.11.x release
-## series, but is to be moved out in the 1.12 release.
+## series, but has been then moved to contrib.
 
 TEST_SUITE_HTML = $(TEST_SUITE_LOG:.log=.html)
 
-mostlyclean-am: am--mostlyclean-test-html
-.PHONY: am--mostlyclean-test-html
-am--mostlyclean-test-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)
@@ -55,7 +55,5 @@ check-html recheck-html:
        $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_HTML) TEST_LOGS= || exit 4; \
        exit $$rv
 
-AM_RECURSIVE_TARGETS += check-html recheck-html
-
 .PHONY: check-html recheck-html
 .MAKE: check-html recheck-html
diff --git a/doc/automake.texi b/doc/automake.texi
index 2090f38..6be7ac3 100644
--- a/doc/automake.texi
+++ b/doc/automake.texi
@@ -344,7 +344,6 @@ API for Custom Test Drivers
 * Command-line arguments for test drivers::
 * Log files generation and test results recording::
 * Testsuite progress output::
-* HTML generation from testsuite logs::
 
 Changing Automake's Behavior
 
@@ -8997,10 +8996,11 @@ versions.
 @cindex @option{parallel-tests}, Using
 
 The parallel (or concurrent) test harness is enabled by the Automake option
address@hidden .  It features concurrent execution of tests with
address@hidden -j}, allows to specify inter-test dependencies, lazy reruns of
-tests that have not completed in a prior run, summary and verbose output in
address@hidden (reStructuredText) and @samp{HTML} format.
address@hidden  It features automatic collection of the test
+scripts output in @file{.log} files, concurrent execution of tests with
address@hidden -j}, specification of inter-test dependencies, lazy reruns of
+tests that have not completed in a prior run, and hard errors for exceptional
+failures. 
 
 This harness is still somewhat experimental and may undergo changes in
 order to satisfy additional portability requirements.
@@ -9115,15 +9115,6 @@ LOG_COMPILER = $(PERL)
 AM_LOG_FLAGS = -Mstrict -w
 @end example
 
address@hidden check-html
address@hidden RST2HTML
address@hidden TEST_SUITE_HTML
address@hidden
-Previous versions of automake used to provide a @code{check-html} target
-to convert the log files to HTML.  This feature is now deprecated, and
address@hidden be removed} in the next major Automake release, so don't rely
-on it anymore.
-
 By default, the test suite harness will run all tests, but there are
 several ways to limit the set of tests that are run:
 
@@ -9371,7 +9362,6 @@ with the parallel test harness and its default driver.
 * Command-line arguments for test drivers::
 * Log files generation and test results recording::
 * Testsuite progress output::
-* HTML generation from testsuite logs::
 @end menu
 
 @node Command-line arguments for test drivers
@@ -9440,9 +9430,7 @@ program fails or crashes).
 The @file{.log} file should ideally contain all the output produced by the
 tested program, plus optionally other information that might facilitate
 debugging or analysis of bug reports.  Apart from that, its format is
-basically free; the only limitation being that it must parse validly as
-reStructuredText if the @file{.log} -> @file{.html} conversion is to be
-supported.
+basically free.
 
 The @file{.trs} file is used to register some metadata through the use
 of custom reStructuredText fields.  This metadata is expected to be
@@ -9561,15 +9549,6 @@ implementations' output might be a good idea too.
 @c TODO: be implemented either using a driver cmdline flag, or an
 @c TODO: environment variable, or both).
 
address@hidden HTML generation from testsuite logs
address@hidden HTML generation from testsuite logs
-
-If HTML testsuite output (with @code{check-html}) is to be supported,
-the generated @file{.log} files must contain syntactically valid
-reStructuredText.  If this is not the case, the HTML generation will not
-work, although all the other functionalities of the Automake testsuite
-harness should remain untouched, and continue to work correctly.
-
 @node Using the TAP test protocol
 @section Using the TAP test protocol
 
diff --git a/lib/am/Makefile.am b/lib/am/Makefile.am
index 52dbe1a..a174d20 100644
--- a/lib/am/Makefile.am
+++ b/lib/am/Makefile.am
@@ -20,7 +20,6 @@
 
 dist_am_DATA = \
 check.am \
-check-html.am \
 check2.am \
 clean-hdr.am \
 clean.am \
diff --git a/lib/am/check.am b/lib/am/check.am
index 4ed3f7e..fb82137 100644
--- a/lib/am/check.am
+++ b/lib/am/check.am
@@ -376,12 +376,6 @@ AM_RECURSIVE_TARGETS += check recheck
 
 .PHONY: recheck
 
-## ----------------------------------------------- ##
-## Produce HTML.  To be removed in automake 1.12.  ##
-## ----------------------------------------------- ##
-
-include check-html.am
-
 else !%?PARALLEL_TESTS%
 
 check-TESTS: $(TESTS)
diff --git a/tests/list-of-tests.mk b/tests/list-of-tests.mk
index 2df25d1..b6b74d9 100644
--- a/tests/list-of-tests.mk
+++ b/tests/list-of-tests.mk
@@ -723,8 +723,6 @@ test-driver-custom-xfail-tests.test \
 test-driver-custom-multitest.test \
 test-driver-custom-multitest-recheck.test \
 test-driver-custom-multitest-recheck2.test \
-test-driver-custom-html.test \
-test-driver-custom-no-html.test \
 test-driver-create-log-dir.test \
 test-driver-strip-vpath.test \
 test-driver-trs-suffix-registered.test \
@@ -1018,7 +1016,6 @@ tap-fancy.test \
 tap-fancy2.test \
 tap-global-log.test \
 tap-global-result.test \
-tap-html.test \
 tap-log.test \
 tap-msg0-result.test \
 tap-msg0-directive.test \
diff --git a/tests/parallel-tests-dryrun.test b/tests/parallel-tests-dryrun.test
index 532a012..3cec67e 100755
--- a/tests/parallel-tests-dryrun.test
+++ b/tests/parallel-tests-dryrun.test
@@ -38,8 +38,6 @@ $AUTOMAKE -a
 rm -f config.log
 
 log_files='test-suite.log foo.log bar.log'
-html_files='test-suite.html foo.html bar.html'
-the_files="$log_files $html_files"
 
 all_exist ()
 {
@@ -59,17 +57,17 @@ none_exist ()
   test $st -eq 0
 }
 
-for targ in check recheck check-html recheck-html $the_files; do
+for targ in check recheck $log_files; do
   $MAKE -n "$targ"
-  none_exist $the_files
+  none_exist $log_files
 done
 
-touch $the_files
+touch $log_files
 
 $MAKE -n mostlyclean
-all_exist $the_files
+all_exist $log_files
 $MAKE -n clean
-all_exist $the_files
+all_exist $log_files
 
 cat > foo.test <<'END'
 #! /bin/sh
@@ -85,9 +83,9 @@ chmod a+x foo.test bar.test
 
 $MAKE check && Exit 1
 
-for targ in recheck recheck-html clean mostlyclean distclean; do
+for targ in recheck clean mostlyclean distclean; do
   $MAKE -n "$targ"
-  all_exist $the_files
+  all_exist $log_files
 done
 
 :
diff --git a/tests/parallel-tests2.test b/tests/parallel-tests2.test
index 23e1d42..a9ef964 100755
--- a/tests/parallel-tests2.test
+++ b/tests/parallel-tests2.test
@@ -17,12 +17,25 @@
 # Check parallel-tests features:
 #  - check-html
 #  - recheck-html
-# Keep this in sync with sister test `test-driver-custom-html.test'.
+# FIXME: the features tested by this script has been moved in contrib.
+# FIXME: We should move this script accordingly.
 
 am_parallel_tests=yes
-required=rst2html
 . ./defs || Exit 1
 
+# Try the variants that are tried in check-html.am.
+while :; do
+  for r2h in $RST2HTML rst2html rst2html.py; do
+    echo "$me: running $r2h --version"
+    $r2h --version && break 2
+  done
+  skip_all_ "no proper rst2html program found"
+done
+unset r2h
+
+cp "$top_testsrcdir"/contrib/check-html.am . \
+  || fatal_ "cannot fetch 'check-html.am' from contrib"
+
 cat >> configure.in << 'END'
 AC_OUTPUT
 END
@@ -34,6 +47,7 @@ check_SCRIPTS = bla
 bla:
        echo bla > $@
 CLEANFILES = bla
+include $(srcdir)/check-html.am
 END
 
 cat > foo.test <<'END'
diff --git a/tests/tap-html.test b/tests/tap-html.test
deleted file mode 100755
index ca0ffd0..0000000
--- a/tests/tap-html.test
+++ /dev/null
@@ -1,81 +0,0 @@
-#! /bin/sh
-# Copyright (C) 2011 Free Software Foundation, Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-# TAP support:
-#  - "check-html" and "recheck-html" targets
-#  - reStructuredText -> HTML conversion
-
-am_parallel_tests=yes
-required=rst2html
-. ./defs || Exit 1
-
-cat > Makefile.am << 'END'
-TEST_LOG_COMPILER = cat
-TESTS = ok.test ko.test
-END
-
-. "$testsrcdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
-
-cat > ok.test << 'END'
-1..3
-ok 1 - expected success
-not ok 2 - expectred failure # TODO
-ok 3 - skipped test # SKIP
-END
-
-cat > ko.test << 'END'
-1..2
-not ok 1 - unexpected failure
-ok 2 - spurious success # TODO
-Bail out! hard error
-END
-
-no_rst2html_error ()
-{
-  $EGREP '(test-suite\.log:[0-9]|WARNING|SEVERE)' output && Exit 1
-  :
-}
-
-# Overriding TESTS should work with check-html.
-TESTS=ok.test $MAKE -e check-html >output 2>&1 || { cat output; Exit 1; }
-cat output
-no_rst2html_error
-test -f test-suite.html
-
-mv output stdout
-count_test_results total=3 pass=1 fail=0 xpass=0 xfail=1 skip=1 error=0
-
-: > older
-$sleep
-$MAKE check-html >output 2>&1 && { cat output; Exit 1; }
-cat output
-no_rst2html_error
-# test-suite.html should be remake if if it was up-to-date.
-test -f test-suite.html
-is_newest test-suite.html older
-
-mv output stdout
-count_test_results total=6 pass=1 fail=1 xpass=1 xfail=1 skip=1 error=1
-
-rm -f ok.test
-$MAKE recheck-html >output 2>&1 && { cat output; Exit 1; }
-cat output
-no_rst2html_error
-
-mv output stdout
-count_test_results total=3 pass=0 fail=1 xpass=1 xfail=0 skip=0 error=1
-
-:
diff --git a/tests/test-driver-custom-html.test 
b/tests/test-driver-custom-html.test
deleted file mode 100755
index e9f60d7..0000000
--- a/tests/test-driver-custom-html.test
+++ /dev/null
@@ -1,104 +0,0 @@
-#! /bin/sh
-# Copyright (C) 2011 Free Software Foundation, Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-# Custom test drivers features:
-#  - check-html
-#  - recheck-html
-# Keep this in sync with sister test `parallel-tests2.test'.
-
-am_parallel_tests=yes
-required=rst2html
-. ./defs || Exit 1
-
-cp "$testsrcdir"/trivial-test-driver . \
-  || fatal_ "failed to fetch auxiliary script trivial-test-driver"
-
-cat >> configure.in << 'END'
-AC_OUTPUT
-END
-
-cat > Makefile.am << 'END'
-TEST_LOG_DRIVER = $(SHELL) ./trivial-test-driver
-TEST_SUITE_LOG = mylog.log
-TESTS = foo.test bar.test baz.test
-check_SCRIPTS = bla
-bla:
-       echo bla > $@
-CLEANFILES = bla
-END
-
-cat > foo.test <<'END'
-#! /bin/sh
-if test -f bla; the
-  echo "PASS: this is $0"
-else
-  echo "FAIL: this is $0"
-fi
-END
-
-cat > bar.test <<'END'
-#! /bin/sh
-echo "FAIL: this is $0"
-END
-
-cat > baz.test <<'END'
-#! /bin/sh
-echo "FAIL: this is $0"
-END
-
-chmod a+x foo.test bar.test baz.test
-
-$ACLOCAL
-$AUTOCONF
-$AUTOMAKE
-
-./configure
-
-$MAKE check-html && Exit 1
-test -f mylog.html
-# check-html should cause check_SCRIPTS to be created.
-test -f bla
-
-# "make clean" should remove HTML files.
-$MAKE clean
-test ! -f mylog.html
-test ! -f bla
-
-# Always create the HTML output, even if there were no failures.
-rm -f mylog.html
-env TESTS=foo.test $MAKE -e check-html
-test -f mylog.html
-
-# Create summarizing HTML output also with recheck-html.
-rm -f mylog.html
-env TESTS=foo.test $MAKE -e recheck-html
-test -f mylog.html
-
-# check-html should cause check_SCRIPTS to be created.
-$MAKE clean
-env TEST_LOGS=foo.log $MAKE -e check-html
-test -f bla
-test -f foo.log
-test -f mylog.html
-# recheck-html should cause check_SCRIPTS to be created, and should rerun
-# no tests if it appears that check has not been run.
-$MAKE clean
-env TESTS=foo.test $MAKE -e recheck-html
-test -f bla
-test ! -f foo.log
-test -f mylog.html
-
-:
diff --git a/tests/test-driver-custom-no-html.test 
b/tests/test-driver-custom-no-html.test
deleted file mode 100755
index 970cf62..0000000
--- a/tests/test-driver-custom-no-html.test
+++ /dev/null
@@ -1,69 +0,0 @@
-#! /bin/sh
-# Copyright (C) 2011 Free Software Foundation, Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-# Check that custom test drivers does not need to produce sensible
-# reStructuredText output in the test logs.  This might be legitimate
-# for drivers that are not interested to support the .log -> HTML
-# conversion offered by Automake.
-
-am_parallel_tests=yes
-. ./defs || Exit 1
-
-cat >> configure.in << 'END'
-AC_OUTPUT
-END
-
-cat > Makefile.am << 'END'
-TEST_LOG_DRIVER = ./no-rst
-TESTS = foo.test
-END
-
-: > foo.test
-
-cat > no-rst <<'END'
-#! /bin/sh
-echo ':test-result: SKIP' > foo.trs
-echo ':copy-in-global-log: yes' >> foo.trs
-# The genereted log file is deliberately syntactically invalid
-# reStructuredText.
-cat > foo.log <<'EOF'
-SKIP: FooBar
-=============
-
---------------
- dummy title
-EOF
-END
-chmod a+x no-rst
-
-$ACLOCAL
-$AUTOCONF
-$AUTOMAKE
-
-./configure
-VERBOSE=yes $MAKE check
-cat foo.log
-cat test-suite.log
-$FGREP 'dummy title' test-suite.log
-
-# Sanity check: trying to produce HTML output should fail.
-$MAKE check-html >output 2>&1 && { cat output; Exit 1; }
-cat output
-# The second grep is to avoid spurious failures on systems without
-# a working `rst2html' program.
-$FGREP SEVERE output || $FGREP 'cannot find rst2html' output
-
-:
-- 
1.7.7.3




reply via email to

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