- 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'.
# 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
## 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)
$(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
* 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
@cindex @option{parallel-tests}, Using
The parallel (or concurrent) test harness is enabled by the Automake option
-@option{parallel-tests} . It features concurrent execution of tests with
-@code{make -j}, allows to specify inter-test dependencies, lazy reruns of
-tests that have not completed in a prior run, summary and verbose output in
-@samp{RST} (reStructuredText) and @samp{HTML} format.
+@option{parallel-tests}. It features automatic collection of the test
+scripts output in @file{.log} files, concurrent execution of tests with
+@code{make -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.
AM_LOG_FLAGS = -Mstrict -w
@end example
-@trindex check-html
-@vindex RST2HTML
-@vindex TEST_SUITE_HTML
-@noindent
-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
-@emph{will 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:
* 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
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
@c TODO: be implemented either using a driver cmdline flag, or an
@c TODO: environment variable, or both).
-@node HTML generation from testsuite logs
-@subsubsection 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
dist_am_DATA = \
check.am \
-check-html.am \
check2.am \
clean-hdr.am \
clean.am \
.PHONY: recheck
-## ----------------------------------------------- ##
-## Produce HTML. To be removed in automake 1.12. ##
-## ----------------------------------------------- ##
-
-include check-html.am
-
else !%?PARALLEL_TESTS%
check-TESTS: $(TESTS)
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 \
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 \
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 ()
{
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
$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
:
# 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
bla:
echo bla > $@
CLEANFILES = bla
+include $(srcdir)/check-html.am
END
cat > foo.test <<'END'
+++ /dev/null
-#! /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
-
-:
+++ /dev/null
-#! /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
-
-:
+++ /dev/null
-#! /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
-
-: