On Thursday 16 June 2011, Stefano Lattarini wrote: > * doc/automake.texi (Custom Test Drivers): New section and node. > (Overview of Custom Test Drivers Support): New subsection. > (Declaring Custom Test Drivers in @file{Makefile.am}): Likewise. > (APIs for Custom Test Drivers): New subsection, still incomplete, > with sketchy descriptions only written in texinfo comments. > > (Auxiliary Programs): Mention the new `pt-driver' script. > (Optional): Mention `pt-driver' in AC_CONFIG_AUX_DIR. Since we > are at it, break the list of auxiliary script by placing one per > line, to simplify potential future additions of new scripts. > These latest modifications have been moved in the first patch of the series, where they really belong. So I've removed them from this patch.
I've also renamed the test 'test-driver-custom-no-pt-driver.test' to 'test-driver-custom-no-pt-driver.test', and fixed other fallout (e.g., `pt-driver' still mentioned in the ChangeLog, and so on). Attached are the differences between the old commit and the new one. Note that they obviously contain also the differences introduced by the amending of the first commit. Regards, Stefano
diff --git a/ChangeLog b/ChangeLog index cd837dd..e3b706b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,4 @@ -2011-06-15 Stefano Lattarini <stefano.lattar...@gmail.com> +2011-06-17 Stefano Lattarini <stefano.lattar...@gmail.com> parallel-tests: allow custom driver scripts Allow suffix-based definition of custom "driver script" for the @@ -6,15 +6,15 @@ launching the tests (or their corresponding $(LOG_COMPILER), if they have an associated one), interpreting and displaying the test results, and writing the `.log' files. - This new API should allow easy and flexible use of different test - protocols in the future; in particular, we plan to use it will be - used to implement TAP and SubUnit harnesses. + This new API should allow easy and flexible use of different + test protocols in the future; in particular, we plan to use it + to implement TAP and SubUnit harnesses. * automake.in (handle_tests): Define default for $(LOG_DRIVER), and, for any registered text extension `<ext>', define defaults for $(<ext>_LOG_DRIVER). Substitute %DRIVER% using these new - variables, instead of the old internal $(am__pt_wrap). When + variables, instead of the old internal $(am__test_driver). When processing check2.am, also substitute %DRIVER_FLAGS%. - Require auxiliary script `pt-driver' only if no wrapper has been + Require auxiliary script `test-driver' only if no driver has been explicitly defined for the test script kinds. * am/check2.am (?GENERIC?%EXT%$(EXEEXT).log, ?GENERIC?%EXT%.log, ?!GENERIC?%OBJ%): Pass the %DRIVER_FLAGS% to the %DRIVER% call. @@ -23,20 +23,16 @@ (Declaring Custom Test Drivers in @file{Makefile.am}): Likewise. (APIs for Custom Test Drivers): New subsection, still incomplete, with sketchy descriptions only written in texinfo comments. - (Auxiliary Programs): Mention the new `pt-driver' script. - (Optional): Mention `pt-driver' in AC_CONFIG_AUX_DIR. Since we - are at it, break the list of auxiliary script by placing one per - line, to simplify potential future additions of new scripts. - * tests/parallel-tests-no-pt-driver.test: New test. + * tests/parallel-tests-no-extra-driver.test: New test. * tests/test-driver-custom.test: Likewise. * tests/test-driver-custom-xfail-tests.test: Likewise. * tests/test-driver-fail.test: Likewise. * tests/Makefile.am: Update. * NEWS: Update. -2011-06-15 Stefano Lattarini <stefano.lattar...@gmail.com> +2011-06-17 Stefano Lattarini <stefano.lattar...@gmail.com> - parallel-tests: add auxiliary script 'pt-driver', refactor + parallel-tests: add auxiliary script 'test-driver', refactor This refactoring should cause no API of functionality change, and is meant only to simplify the future implementation of TAP and SubUnit testsuite drivers. More precisely, our roadmap is @@ -47,32 +43,38 @@ a framework upon which to implement our new TAP and SubUnit drivers, all in a very unobtrusive way and retaining an high degree of code reuse and backward-compatibility. - * lib/pt-driver: New auxiliary script. + * lib/test-driver: New auxiliary script. * lib/Makefile.am (dist_SCRIPT_DATA): Add it. * automake.in (handle_tests): Require the new auxiliary script - `pt-driver', and define new makefile variable `$(am__pt_driver)', - used to call it. Perform new substitution on `DRIVER' when - processing the `check2.am' file. + `test-driver', and define a new internal makefile variable + `$(am__test_driver)', used to call it. Perform new substitution + on `DRIVER' when processing the `check2.am' file. * lib/check.am (am__tty_colors): Define new shell variable `$am__color_tests'. (am__rst_section): Removed, its role taken over by the new - `pt-driver' script. + `test-driver' script. (am__test_driver_flags): New variable, contains the command - line options passed to `pt-driver'. + line options passed to `test-driver'. (am__check_pre): Do not deal with temporary files and exit - traps anymore, as the `pt-driver' script takes care of that now. - Define shell variable `$am__enable_hard_errors', used by + traps anymore, as the `test-driver' script takes care of that + now. Define shell variable `$am__enable_hard_errors', used by `$(am__test_driver_flags)'. Reorder so that we don't need to save and restore the value of the `TERM' environment variable anymore. Other related adjustments. (am__check_post): Remove, as its role has been completely taken - over by the `pt-driver' script. + over by the `test-driver' script. * am/check2.am (?GENERIC?%EXT%$(EXEEXT).log, ?GENERIC?%EXT%.log, ?!GENERIC?%OBJ%): Call the test script through the Automake substituted `%DRIVER%', and honor the command-line options in `$(am__test_driver_flags)'. Do not call the obsoleted `$(am__check_post)' anymore. + * doc/automake.texi (Auxiliary Programs): Mention the new + `test-driver' script. + (Optional): Mention `test-driver' in AC_CONFIG_AUX_DIR. + Since we are at it, break the list of auxiliary scripts by + placing one per line, to simplify potential future additions + of new scripts. * tests/check.test: Adjust. * tests/check2.test : Likewise. * tests/check3.test : Likewise. @@ -88,8 +90,8 @@ * tests/parallel-tests-interrupt.test: Likewise. * tests/posixsubst-tests.test: Likewise. * tests/repeated-options.test: Likewise. - * tests/check-no-pt-driver.test: New test. - * tests/parallel-tests-pt-driver.test: Likewise. + * tests/check-no-test-driver.test: New test. + * tests/parallel-test-driver-install.test: Likewise. * tests/Makefile.am (TESTS): Update. * NEWS: Update. diff --git a/NEWS b/NEWS index 132482d..004a7bd 100644 --- a/NEWS +++ b/NEWS @@ -15,8 +15,11 @@ New in 1.11a: - The default testsuite driver offered by the 'parallel-tests' option is now implemented (partly at least) with the help of automake-provided - auxiliary scripts (e.g., `pt-driver'), instead of relying entirely on - code in the generated Makefile.in. + auxiliary scripts (e.g., `test-driver'), instead of relying entirely + on code in the generated Makefile.in. + This implies that project using the `parallel-tests' option should + now either run automake with the `--add-missing' option, or manually + copy the required scripts into their tree. - The package authors can now use customary testsuite drivers within the framework provided by the 'parallel-tests' testsuite harness. diff --git a/automake.in b/automake.in index 3477a7b..340d4e3 100644 --- a/automake.in +++ b/automake.in @@ -5037,12 +5037,13 @@ sub handle_tests # The "test driver" program, deputed to handle tests protocol used by # test scripts. By default, it's assumed that no protocol is used, # so we fall back to the old "parallel-tests" behaviour, implemented - # by the `pt-driver' auxiliary script. + # by the `test-driver' auxiliary script. if (! var 'LOG_DRIVER') { - require_conf_file ($parallel_tests->{position}, FOREIGN, 'pt-driver'); + require_conf_file ($parallel_tests->{position}, FOREIGN, + 'test-driver'); define_variable ('LOG_DRIVER', - "\$(SHELL) $am_config_aux_dir/pt-driver", + "\$(SHELL) $am_config_aux_dir/test-driver", INTERNAL); } my $driver = '$(LOG_DRIVER)'; @@ -5089,9 +5090,10 @@ sub handle_tests # See comments about definition of LOG_DRIVER, above. if (! var "${ext}_LOG_DRIVER") { - require_conf_file ($parallel_tests->{position}, FOREIGN, 'pt-driver'); + require_conf_file ($parallel_tests->{position}, FOREIGN, + 'test-driver'); define_variable ("${ext}_LOG_DRIVER", - "\$(SHELL) $am_config_aux_dir/pt-driver", + "\$(SHELL) $am_config_aux_dir/test-driver", INTERNAL); } my $driver = '$(' . $ext . '_LOG_DRIVER)'; diff --git a/doc/automake.texi b/doc/automake.texi index d3a7848..3623dce 100644 --- a/doc/automake.texi +++ b/doc/automake.texi @@ -2302,16 +2302,16 @@ longer installed automatically, and it should be safe to remove it. @item py-compile This is used to byte-compile Python scripts. -@item compile -This implements the default testsuite driver offered by the -@option{parallel-tests} testsuite harness. - @item symlink-tree This program duplicates a tree of directories, using symbolic links instead of copying files. Such an operation is performed when building multilibs (@pxref{Multilibs}). This file is maintained in the GCC tree at @url{http://gcc.gnu.org/svn.html}. +@item test-driver +This implements the default testsuite driver offered by the +@option{parallel-tests} testsuite harness. + @item texinfo.tex Not a program, this file is required for @samp{make dvi}, @samp{make ps} and @samp{make pdf} to work when Texinfo sources are in the @@ -2932,7 +2932,7 @@ Automake will look for various helper scripts, such as @file{missing}, @file{mkinstalldirs}, @file{py-compile}, -@file{pt-driver}, +@file{test-driver}, @file{texinfo.tex}, @file{ylwrap}.) Not all scripts are always searched for; some scripts diff --git a/lib/Automake/tests/Makefile.in b/lib/Automake/tests/Makefile.in index 5bc86bf..b466956 100644 --- a/lib/Automake/tests/Makefile.in +++ b/lib/Automake/tests/Makefile.in @@ -169,7 +169,7 @@ TEST_SUITE_LOG = test-suite.log TEST_SUITE_HTML = $(TEST_SUITE_LOG:.log=.html) am__test_logs1 = $(TESTS:=.log) TEST_LOGS = $(am__test_logs1:.pl.log=.log) -PL_LOG_DRIVER = $(SHELL) $(top_srcdir)/lib/pt-driver +PL_LOG_DRIVER = $(SHELL) $(top_srcdir)/lib/test-driver PL_LOG_COMPILE = $(PL_LOG_COMPILER) $(AM_PL_LOG_FLAGS) $(PL_LOG_FLAGS) TEST_LOGS_TMP = $(TEST_LOGS:.log=.log-t) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) diff --git a/lib/Makefile.am b/lib/Makefile.am index 2354af4..a26d663 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -29,7 +29,7 @@ dist_pkgvdata_DATA = COPYING INSTALL texinfo.tex ansi2knr.c ansi2knr.1 \ scriptdir = $(pkgvdatadir) dist_script_DATA = config.guess config.sub install-sh mdate-sh missing \ mkinstalldirs elisp-comp ylwrap acinstall depcomp compile py-compile \ - symlink-tree ar-lib pt-driver + symlink-tree ar-lib test-driver EXTRA_DIST = gnupload diff --git a/lib/Makefile.in b/lib/Makefile.in index 8147a3d..5f8aa91 100644 --- a/lib/Makefile.in +++ b/lib/Makefile.in @@ -242,7 +242,7 @@ dist_pkgvdata_DATA = COPYING INSTALL texinfo.tex ansi2knr.c ansi2knr.1 \ scriptdir = $(pkgvdatadir) dist_script_DATA = config.guess config.sub install-sh mdate-sh missing \ mkinstalldirs elisp-comp ylwrap acinstall depcomp compile py-compile \ - symlink-tree ar-lib pt-driver + symlink-tree ar-lib test-driver EXTRA_DIST = gnupload all: all-recursive diff --git a/lib/pt-driver b/lib/test-driver similarity index 90% rename from lib/pt-driver rename to lib/test-driver index 78b6d18..b37162b 100755 --- a/lib/pt-driver +++ b/lib/test-driver @@ -1,7 +1,7 @@ #! /bin/sh -# pt-driver - basic driver script for the `parallel-tests' mode. +# test-driver - basic driver script for the `parallel-tests' mode. -scriptversion=2011-06-14.16; # UTC +scriptversion=2011-06-17.09; # UTC # Copyright (C) 2011 Free Software Foundation, Inc. # @@ -48,9 +48,9 @@ print_usage () { cat <<END Usage: - pt-driver [--help|--version] --test-name=NAME --log-file=PATH - [--expect-failure={yes|no}] [--color-tests={yes|no}] - [--enable-hard-errors={yes|no}] [--] TEST-SCRIPT + test-driver [--help|--version] --test-name=NAME --log-file=PATH + [--expect-failure={yes|no}] [--color-tests={yes|no}] + [--enable-hard-errors={yes|no}] [--] TEST-SCRIPT The \`--test-name' and \`--log-file' options are mandatory. END } @@ -68,7 +68,7 @@ enable_hard_errors=yes while test $# -gt 0; do case $1 in --help) print_usage; exit $?;; - --version) echo "pt-driver $scriptversion"; exit $?;; + --version) echo "test-driver $scriptversion"; exit $?;; --test-name) test_name=$2; shift;; --log-file) logfile=$2; shift;; --color-tests) color_tests=$2; shift;; diff --git a/tests/Makefile.am b/tests/Makefile.am index 9fe06aa..1c3c075 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -234,7 +234,7 @@ check12.test \ check-exported-srcdir.test \ check-tests-in-builddir.test \ check-tests_environment.test \ -check-no-pt-driver.test \ +check-no-test-driver.test \ checkall.test \ clean.test \ clean2.test \ @@ -722,8 +722,8 @@ parallel-tests-unreadable-log.test \ parallel-tests-subdir.test \ parallel-tests-interrupt.test \ parallel-tests-reset-term.test \ -parallel-tests-pt-driver.test \ -test-driver-custom-no-pt-driver.test \ +parallel-test-driver-install.test \ +test-driver-custom-no-extra-driver.test \ test-driver-custom.test \ test-driver-custom-xfail-tests.test \ test-driver-fail.test \ diff --git a/tests/Makefile.in b/tests/Makefile.in index 3c66966..d253baa 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -175,7 +175,7 @@ TEST_SUITE_HTML = $(TEST_SUITE_LOG:.log=.html) TEST_EXTENSIONS = .test am__test_logs1 = $(TESTS:=.log) TEST_LOGS = $(am__test_logs1:.test.log=.log) -TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/lib/pt-driver +TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/lib/test-driver TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ $(TEST_LOG_FLAGS) TEST_LOGS_TMP = $(TEST_LOGS:.log=.log-t) @@ -488,7 +488,7 @@ check12.test \ check-exported-srcdir.test \ check-tests-in-builddir.test \ check-tests_environment.test \ -check-no-pt-driver.test \ +check-no-test-driver.test \ checkall.test \ clean.test \ clean2.test \ @@ -976,8 +976,8 @@ parallel-tests-unreadable-log.test \ parallel-tests-subdir.test \ parallel-tests-interrupt.test \ parallel-tests-reset-term.test \ -parallel-tests-pt-driver.test \ -test-driver-custom-no-pt-driver.test \ +parallel-test-driver-install.test \ +test-driver-custom-no-extra-driver.test \ test-driver-custom.test \ test-driver-custom-xfail-tests.test \ test-driver-fail.test \ diff --git a/tests/check-no-pt-driver.test b/tests/check-no-test-driver.test similarity index 78% rename from tests/check-no-pt-driver.test rename to tests/check-no-test-driver.test index 57408e0..fc1e89b 100755 --- a/tests/check-no-pt-driver.test +++ b/tests/check-no-test-driver.test @@ -14,8 +14,9 @@ # 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 auxiliary script 'pt-wrap' doesn't get needlessly installed -# or referenced when the 'parallel-tests' option is not used. +# Check that auxiliary script 'test-driver' doesn't get needlessly +# installed or referenced when the 'parallel-tests' option is not +# used. parallel_tests=no . ./defs || Exit 1 @@ -26,8 +27,8 @@ $ACLOCAL for opts in '' '-a' '--add-missing --copy'; do $AUTOMAKE $opts - $FGREP 'pt-driver' Makefile.in && Exit 1 - find . | $FGREP 'pt-driver' && Exit 1 + $FGREP 'test-driver' Makefile.in && Exit 1 + find . | $FGREP 'test-driver' && Exit 1 done : diff --git a/tests/check.test b/tests/check.test index da30d5e..caacf78 100755 --- a/tests/check.test +++ b/tests/check.test @@ -22,7 +22,7 @@ cat > Makefile.am << 'END' TESTS = frob.test END -test x"$parallel_tests" != x"yes" || : > pt-driver +test x"$parallel_tests" != x"yes" || : > test-driver : > frob.test diff --git a/tests/check10.test b/tests/check10.test index 4705c74..ef79969 100755 --- a/tests/check10.test +++ b/tests/check10.test @@ -48,13 +48,9 @@ cp fail fail2 cp xfail xfail2 cp skip skip2 -if test x"$parallel_tests" = x"yes"; then - cp "$top_testsrcdir"/lib/pt-driver . -fi - $ACLOCAL $AUTOCONF -$AUTOMAKE +$AUTOMAKE -a ./configure ( diff --git a/tests/check2.test b/tests/check2.test index ffccf10..56e2614 100755 --- a/tests/check2.test +++ b/tests/check2.test @@ -44,7 +44,7 @@ CLEANFILES = echo.sh END if test x"$parallel_tests" = x"yes"; then - cp "$top_testsrcdir"/lib/pt-driver . + cp "$top_testsrcdir"/lib/test-driver . fi $ACLOCAL diff --git a/tests/check4.test b/tests/check4.test index 1391033..7c40c0c 100755 --- a/tests/check4.test +++ b/tests/check4.test @@ -46,12 +46,7 @@ chmod +x ok.sh dir/fail.sh $ACLOCAL $AUTOCONF - -if test x"$parallel_tests" = x"yes"; then - $AUTOMAKE --add-missing -else - $AUTOMAKE -fi +$AUTOMAKE --add-missing ./configure --prefix "`pwd`/inst" diff --git a/tests/color.test b/tests/color.test index 2bf5b6d..ecd4f94 100755 --- a/tests/color.test +++ b/tests/color.test @@ -68,12 +68,7 @@ chmod +x pass fail skip xpass xfail $ACLOCAL $AUTOCONF - -if test x"$parallel_tests" = x"yes"; then - $AUTOMAKE --add-missing -else - $AUTOMAKE -fi +$AUTOMAKE --add-missing ./configure diff --git a/tests/comment9.test b/tests/comment9.test index cdb0758..e20b59f 100755 --- a/tests/comment9.test +++ b/tests/comment9.test @@ -30,7 +30,7 @@ TESTS = \ 7.test EOF -: > pt-driver +: > test-driver $ACLOCAL $AUTOMAKE diff --git a/tests/dejagnu.test b/tests/dejagnu.test index 105e53e..fe994b5 100755 --- a/tests/dejagnu.test +++ b/tests/dejagnu.test @@ -25,7 +25,7 @@ AUTOMAKE_OPTIONS = dejagnu TESTS = frob.test END -test x"$parallel_tests" != x"yes" || : > pt-driver +test x"$parallel_tests" != x"yes" || : > test-driver $ACLOCAL $AUTOMAKE diff --git a/tests/parallel-tests-pt-driver.test b/tests/parallel-test-driver-install.test similarity index 83% rename from tests/parallel-tests-pt-driver.test rename to tests/parallel-test-driver-install.test index cc71303..10455fb 100755 --- a/tests/parallel-tests-pt-driver.test +++ b/tests/parallel-test-driver-install.test @@ -14,7 +14,7 @@ # 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 auxiliary script 'pt-driver' gets automatically installed +# Check that auxiliary script 'test-driver' gets automatically installed # in the correct directory by 'parallel-tests' option. parallel_tests=yes @@ -49,11 +49,11 @@ $AUTOMAKE -a 2>stderr || { cat stderr >&2; Exit 1; } cat stderr >&2 ls -l . sub my_aux_dir # For debugging. -test -f my_aux_dir/pt-driver -test ! -r pt-driver -test ! -r sub/pt-driver +test -f my_aux_dir/test-driver +test ! -r test-driver +test ! -r sub/test-driver -grep '^configure\.in:3:.*installing.*my_aux_dir/pt-driver' stderr +grep '^configure\.in:3:.*installing.*my_aux_dir/test-driver' stderr cd .. @@ -84,10 +84,10 @@ $AUTOMAKE --add-missing --copy dir/GNUmakefile 2>stderr \ cat stderr >&2 ls -l . dir build-aux # For debugging. -test -f build-aux/pt-driver -test ! -r pt-driver -test ! -r dir/pt-driver +test -f build-aux/test-driver +test ! -r test-driver +test ! -r dir/test-driver -grep '^dir/GNUmakefile\.am:2:.*installing.*build-aux/pt-driver' stderr +grep '^dir/GNUmakefile\.am:2:.*installing.*build-aux/test-driver' stderr : diff --git a/tests/parallel-tests-interrupt.test b/tests/parallel-tests-interrupt.test index 116a205..1c5d9ce 100755 --- a/tests/parallel-tests-interrupt.test +++ b/tests/parallel-tests-interrupt.test @@ -37,7 +37,7 @@ END # This is hacky and ugly, but has the great advantage of avoiding us a lot # of pain with background processes and related synchronization issues. -cat - "$top_testsrcdir"/lib/pt-driver > pt-driver <<'END' +cat - "$top_testsrcdir"/lib/test-driver > test-driver <<'END' #!/bin/sh echo $$ > pid END diff --git a/tests/repeated-options.test b/tests/repeated-options.test index 5591ffe..13999d9 100755 --- a/tests/repeated-options.test +++ b/tests/repeated-options.test @@ -58,7 +58,7 @@ int main (void) } END -cp "$top_testsrcdir"/lib/compile "$top_testsrcdir"/lib/pt-driver . +cp "$top_testsrcdir"/lib/compile "$top_testsrcdir"/lib/test-driver . $ACLOCAL $AUTOMAKE --foreign --foreign -Wall 2>stderr || { cat stderr >&2; Exit 1; } diff --git a/tests/test-driver-custom-no-pt-driver.test b/tests/test-driver-custom-no-extra-driver.test similarity index 100% rename from tests/test-driver-custom-no-pt-driver.test rename to tests/test-driver-custom-no-extra-driver.test