automake-patches
[Top][All Lists]
Advanced

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

Re: [PATCH v4 1/3] parallel-tests: add auxiliary script 'pt-driver', ref


From: Stefano Lattarini
Subject: Re: [PATCH v4 1/3] parallel-tests: add auxiliary script 'pt-driver', refactor
Date: Fri, 17 Jun 2011 12:03:40 +0200
User-agent: KMail/1.13.3 (Linux/2.6.30-2-686; KDE/4.4.4; i686; ; )

On Friday 17 June 2011, Ralf Wildenhues wrote:
> * Stefano Lattarini wrote on Thu, Jun 16, 2011 at 10:00:31AM CEST:
> > 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
> > to move most of the "testsuite driving" features out of the
> > Automake-generated Makefiles, and into external scripts with
> > well-defined interfaces.  This will allow the user to define
> > its own personalized testsuite drivers, and will also offer us
> > 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.
> 
> I generally like the direction this is taking.  The point of best
> separation between which code goes into Makefile.in and which into
> the driver scripts can be fine-tuned when we have more than one such
> script.
>
I agree.

> Actually, yes, before deciding on this for real I really do want to see
> a nontrivial other driver script.  There is no point in hardcoding
> too much in several driver scripts if it all needs to be the same
> anyway.
>
But refactoring can be done later, if the need arises (before we publish
our APIs of course).  And it's always nice to see patches that reduce
code size and duplication :-)

> Please measure the time overhead your changes introduce into the current
> code, for a trivial testsuite (say, 50 tests running 'true'), and a
> nontrivial one like Automake's and one with faster tests.  Thanks.
>
Will do soon(ish), and post the results in another mail.

> I've already mentioned that I don't like the name of the script.  ;-)
> (You could basically replace 'pt' everywhere else with 'test', too,
> as the non-parallel test setup stuff does not allow for a driver either,
> but that is not something we announce in all our names either.)
>
OK.

> > * lib/pt-driver: New auxiliary script.
>
Renamed to test-driver.

> > * lib/Makefile.am (dist_SCRIPT_DATA): Add it.
>
Adjusted.

> > * automake.in (handle_tests): Require the new auxiliary script
> > `pt-driver',
>
Adjusted.

> > and define new makefile variable `$(am__pt_driver)',
> 
> So this could just be $(am__test_driver).
>
Done.

> > 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.
> > (am__test_driver_flags): New variable, contains the command
> > line options passed to `pt-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
> > `$(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.
> > * 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.

> > * tests/check.test: Adjust.
> > * tests/check2.test : Likewise.
> > * tests/check3.test : Likewise.
> > * tests/check4.test : Likewise.
> > * tests/check10.test: Likewise.
> > * tests/color.test: Likewise.
> > * tests/color2.test: Likewise.
> > * tests/comment9.test: Likewise.
> > * tests/dejagnu.test: Likewise.
> > * tests/exeext4.test: Likewise.
> > * tests/maken3.test: Likewise.
> > * tests/maken4.test: Likewise.
> > * tests/parallel-tests-interrupt.test: Likewise.
> > * tests/posixsubst-tests.test: Likewise.
> > * tests/repeated-options.test: Likewise.
>
All this tests adjusted to use 'test-driver', not 'pt-driver'.

> > * tests/check-no-pt-driver.test: New test.
>
Renamed to 'check-no-test-driver.test'.

> > * tests/parallel-tests-pt-driver.test: Likewise.
>
Renamed to 'parallel-test-driver-install.test'.

> > * tests/Makefile.am (TESTS): Update.
>
Adjusted.

> > * NEWS: Update.
>
The NEWS entry wasn't truly complete.  Here's what I've squashed in:

  diff --git a/NEWS b/NEWS
  index 584bd1f..7db7096 100644
  --- a/NEWS
  +++ b/NEWS
  @@ -14,8 +14,11 @@ New in 1.11a:
   * Changes to Automake-generated testsuite harnesses:
 
     - The parallel-tests driver is now implemented (partly at least) with
  -    the help of automake-provided auxiliary scripts (e.g., `pt-driver'),
  +    the help of automake-provided 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 wither run automake with the `--add-missing' option, or manually
  +    copy the `test-driver' script into their tree.
 
   * Miscellaneous changes:

I've also mentioned the new 'test-driver' script in the automake manual.

> 
> > index 054c62d..f3116c8 100644
> > --- a/lib/am/check2.am
> > +++ b/lib/am/check2.am
> 
> > @@ -17,7 +17,9 @@
> >  ## From a test file to a log file.
> >  ?GENERIC?%EXT%.log:
> >  ?!GENERIC?%OBJ%: %SOURCE%
> > -   @p='%SOURCE%'; $(am__check_pre) %COMPILE% "$$tst" $(am__check_post)
> > +   @p='%SOURCE%'; $(am__check_pre) \
> > +   %DRIVER% $(am__test_driver_flags) -- \
> > +   %COMPILE% "$$tst"
> 
> Erm, was there not a need to keep post flags for redirection?
>
No, it turned out that adding the redirection at the end of
AM_TESTS_ENVIRONMENT *without a trailing semicolon* is enough
to have them working portably:
 <http://lists.gnu.org/archive/html/bug-coreutils/2011-06/msg00082.html>
I've also added a new testcase to automake master to ensure we don't
break that behaviour.

> I must confess I haven't gone through all gnulib threads from the
> last weeks yet, but I vaguely remember related issues coming up there.
>
Apparently we've managed to work them out successfully :-)
Also, if you still think that post-flags might be useful, they can
be added with a follow-up patch (remember that this patch aims at
introducing as few semantic changes as possible).

> > --- /dev/null
> > +++ b/lib/pt-driver
> > @@ -0,0 +1,129 @@
> > +#! /bin/sh
> > +# pt-driver - basic driver script for the `parallel-tests' mode.
> 
> > +# Make unconditional expansion of undefined variables an error.  This
> > +# helps a lot in preventing typo-related bugs.
> > +set -u
> 
> Not sure how older shells handle this, but for development it should be
> ok.  We haven't used it elsewhere.
>
My hope is that we will use it wherever possible, eventually.  But that's
for other patches, and another time.

> > +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
> > +The \`--test-name' and \`--log-file' options are mandatory.
> > +END
> 
> echo "\
> Usage ...
> 
> "?
>
If I'm not mistaken, cat is "smarter" that echo in determining write
errors, and giving proper error messages.  For example:

  $ bash-2.0 -c 'echo x >/dev/full'; echo $?
  0
  $ bash-3.0 -c 'echo x >/dev/full'; echo $?
  1
  $ dash -c 'echo x >/dev/full'; echo $?
  1
  # Don't have /dev/full on Solaris, so I resort to Heirloom tools
  $ heirloom sh -c 'echo x >/dev/full'; echo $?
  0
  # Newer bash version are better
  $ bash-3.2 -c 'echo x >/dev/full'; echo $?
  bash-3.2: line 0: echo: write error: No space left on device
  1

  $ echo x | cat > /dev/full; echo $?
  cat: write error: No space left on device
  $ echo x | /opt/extra/gnu-coreutils-5.0/bin/cat > /dev/full; echo $?
  /opt/extra/gnu-coreutils-5.0/bin/cat: write error: No space left on device
  1
  echo x | heirloom cat > /dev/full; echo $?
  cat: output error (0/2 characters written)
  No space left on device
  4

> (Old shells will create (and sometimes forget to remove) a temporary
> file for this here-document, even if print_usage is never called.)
>
Ouch.  So I should use echo instead of cat in the end?  I've not done
that for the moment.

> > +# TODO: better error handling in option parsing (in particular, ensure
> > +# TODO: $logfile and $test_name are defined).
> > +test_name= # Used for reporting.
> > +logfile=   # Where to save the result and output of the test script.
> > +expect_failure=no
> > +color_tests=no
> > +enable_hard_errors=yes
> > +while test $# -gt 0; do
> > +  case $1 in
> > +  --help) print_usage; exit $?;;
> > +  --version) echo "pt-driver $scriptversion"; exit $?;;
> > +  --test-name) test_name=$2; shift;;
> > +  --log-file) logfile=$2; shift;;
> > +  --color-tests) color_tests=$2; shift;;
> > +  --expect-failure) expect_failure=$2; shift;;
> > +  --enable-hard-errors) enable_hard_errors=$2; shift;;
> > +  --) shift; break;;
> > +  -*) usage_error "invalid option: '$1'";;
> > +  esac
> > +  shift
> > +done
> > +
> > +if test $color_tests = yes; then
> 
> --color-tests="ka boom"
>
In follow-up patches, we should sanitize the arguments passed to the
various options (in particular, `--color-tests', `--expect-failure'
and `--enable-hard-error' should accept only "yes" or "no"), so this
won't be an issue.  Also, allowing the shell to print error messages
in case something unexpected happens (in this case, an uncorrect
definition of $color_tests) is a good policy IMHO: let's not hide
errors!

> > +tmpfile=$logfile-t
> > +do_exit='rm -f $tmpfile; (exit $st); exit $st'
> > +trap "st=129; $do_exit" 1
> > +trap "st=130; $do_exit" 2
> > +trap "st=141; $do_exit" 13
> > +trap "st=143; $do_exit" 15
> > +rm -f $tmpfile
> > +
> > +# Test script is run here.
> > +"$@" >$tmpfile 2>&1
> 
> This will not print progress output while testing.  Hmm.  No change from
> previous semantics, but I really would like to fix that eventually.
> (I've suggested a similar improvement for Autotest basically.)
>
Yeah, it sucks when a test hangs and its name isn't displayed anywhere
on the screen, and the poor user is left clueless about what the problem
is -- and has to resort to `ps' to find it out (already happened to me,
BTW).  But as you say, that's for a follow-up patch (maybe a bug report
in the category "wishlist" would help to keep the issue more visible?)

> > +estatus=$?
> > +if test $enable_hard_errors = no && test $estatus -eq 99; then
> > +  estatus=1
> > +fi
> > +
> > +case $estatus:$expect_failure in
> > +  0:yes) col=$red; res=XPASS;;
> > +  0:*)   col=$grn; res=PASS ;;
> > +  77:*)  col=$blu; res=SKIP ;;
> > +  99:*)  col=$red; res=FAIL ;;
> > +  *:yes) col=$lgn; res=XFAIL;;
> > +  *:*)   col=$red; res=FAIL ;;
> > +esac
> > +echo "${col}${res}${std}: $test_name"
> > +echo "$res: $test_name (exit: $estatus)" | rst_section > $logfile
> > +cat $tmpfile >> $logfile
> > +rm -f $tmpfile
> 
> > --- a/tests/check4.test
> > +++ b/tests/check4.test
> > @@ -46,8 +46,15 @@ chmod +x ok.sh dir/fail.sh
> >  
> >  $ACLOCAL
> >  $AUTOCONF
> > -$AUTOMAKE
> > +
> > +if test x"$parallel_tests" = x"yes"; then
> > +  $AUTOMAKE --add-missing
> > +else
> > +  $AUTOMAKE
> > +fi
> 
> You can just call $AUTOMAKE --add-missing unconditionally.
> After all, that's what users should do as well.
> Several instances.
>
I've done the above in order not to reduce coverage too much in the cases
where the 'parallel-tests' harness is not in use.  But then, the test
'check-no-test-driver.test' already verifies that the 'test-driver' script
is not installed by `automake -a' if the 'parallel-tests' option is not
used, so I guess it's OK to use "$AUTOMAKE --add-missing" unconditionally
in the test script above (and in other similar).

> >  ./configure --prefix "`pwd`/inst"
> > +
> >  $MAKE check >stdout && { cat stdout; Exit 1; }
> >  cat stdout
> >  grep 'FAIL: fail.sh' stdout
> 
> > --- a/tests/parallel-tests-interrupt.test
> > +++ b/tests/parallel-tests-interrupt.test
> > @@ -28,12 +28,20 @@ END
> >  
> >  cat > Makefile.am << 'END'
> >  TESTS = foo.test
> > -## Ugly, but required by foo.test.  See below.
> > -TEST_LOG_COMPILER = echo $$$$ > pid && exec 9>&2 && $(SHELL) -x
> > +## Provide more debugging info.
> > +TEST_LOG_COMPILER = $(SHELL) -x
> > +## Rut required by foo.test; see below.
> > +AM_TESTS_ENVIRONMENT = 9>&2
> 
> Separate bugfix, separate patch?
>
Isn't that a little overkill, considering that we are going to merge
this changes into master eventually?

> >  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.
> 
> Does the comment still match the code it precedes?
>
Yes: you can't characterize the 'foo.test' script below as "clear" or
"pretty" by any resonable standard IMHO.  It's use is acceptable only
because it *really* saves a lot of pain w.r.t. background processes
and so.

> > +cat - "$top_testsrcdir"/lib/pt-driver > pt-driver <<'END'
> > +#!/bin/sh
> > +echo $$ > pid
> > +END
> > +
> >  cat > foo.test << 'END'
> >  #!/bin/sh
> >  exec 2>&9
> 
> Cheers,
> Ralf
> 

Attached is what I've squashed in.

Regards,
  Stefano
diff --git a/ChangeLog b/ChangeLog
index 88bbf6e..d782bba 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,6 @@
-2011-06-15  Stefano Lattarini  <address@hidden>
+2011-06-17  Stefano Lattarini  <address@hidden>
 
-       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
@@ -11,32 +11,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.
@@ -52,8 +58,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 584bd1f..7db7096 100644
--- a/NEWS
+++ b/NEWS
@@ -14,8 +14,11 @@ New in 1.11a:
 * Changes to Automake-generated testsuite harnesses:
 
   - The parallel-tests driver is now implemented (partly at least) with
-    the help of automake-provided auxiliary scripts (e.g., `pt-driver'),
+    the help of automake-provided 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 wither run automake with the `--add-missing' option, or manually
+    copy the `test-driver' script into their tree.
 
 * Miscellaneous changes:
 
diff --git a/automake.in b/automake.in
index 22c718a..e1c7a92 100644
--- a/automake.in
+++ b/automake.in
@@ -4991,9 +4991,10 @@ sub handle_tests
 
       if (my $parallel_tests = option 'parallel-tests')
         {
-          require_conf_file ($parallel_tests->{position}, FOREIGN, 
'pt-driver');
-          define_variable ('am__pt_driver',
-                           "\$(SHELL) $am_config_aux_dir/pt-driver",
+          require_conf_file ($parallel_tests->{position}, FOREIGN,
+                             'test-driver');
+          define_variable ('am__test_driver',
+                           "\$(SHELL) $am_config_aux_dir/test-driver",
                            INTERNAL);
          define_variable ('TEST_SUITE_LOG', 'test-suite.log', INTERNAL);
          define_variable ('TEST_SUITE_HTML', '$(TEST_SUITE_LOG:.log=.html)', 
INTERNAL);
@@ -5045,7 +5046,7 @@ sub handle_tests
                                                GENERIC => 0,
                                                OBJ => $obj,
                                                SOURCE => $val,
-                                               DRIVER => '$(am__pt_driver)',
+                                               DRIVER => '$(am__test_driver)',
                                                COMPILE =>'$(' . $compile . ')',
                                                EXT => '',
                                                am__EXEEXT => 'FALSE');
@@ -5085,7 +5086,7 @@ sub handle_tests
                                                  GENERIC => 1,
                                                  OBJ => '',
                                                  SOURCE => '$<',
-                                                 DRIVER => '$(am__pt_driver)',
+                                                 DRIVER => 
'$(am__test_driver)',
                                                  COMPILE => '$(' . $compile . 
')',
                                                  EXT => $test_suffix,
                                                  am__EXEEXT => $am_exeext);
diff --git a/doc/automake.texi b/doc/automake.texi
index 7e84fdd..0e2fb9b 100644
--- a/doc/automake.texi
+++ b/doc/automake.texi
@@ -2307,6 +2307,10 @@ 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}.
 
address@hidden test-driver
+This implements the default testsuite driver offered by the
address@hidden 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
@@ -2913,12 +2917,24 @@ The Autoconf Manual}.
 @item AC_CONFIG_AUX_DIR
 Automake will look for various helper scripts, such as
 @file{install-sh}, in the directory named in this macro invocation.
address@hidden This list is accurate relative to version 1.8
-(The full list of scripts is: @file{ar-lib}, @file{config.guess},
address@hidden, @file{depcomp}, @file{elisp-comp}, @file{compile},
address@hidden, @file{ltmain.sh}, @file{mdate-sh}, @file{missing},
address@hidden, @file{py-compile}, @file{texinfo.tex}, and
address@hidden)  Not all scripts are always searched for; some scripts
address@hidden This list is accurate relative to version 1.11
+(The full list of scripts is:
address@hidden,
address@hidden,
address@hidden,
address@hidden,
address@hidden,
address@hidden,
address@hidden,
address@hidden,
address@hidden,
address@hidden,
address@hidden,
address@hidden,
address@hidden,
address@hidden,
address@hidden)
+Not all scripts are always searched for; some scripts
 will only be sought if the generated @file{Makefile.in} requires them.
 
 If @code{AC_CONFIG_AUX_DIR} is not given, the scripts are looked for in
diff --git a/lib/Automake/tests/Makefile.in b/lib/Automake/tests/Makefile.in
index d3ed3dd..cb103b4 100644
--- a/lib/Automake/tests/Makefile.in
+++ b/lib/Automake/tests/Makefile.in
@@ -165,7 +165,7 @@ esac;                                                       
\
 $(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT)
 RECHECK_LOGS = $(TEST_LOGS)
 AM_RECURSIVE_TARGETS = check check-html recheck recheck-html
-am__pt_driver = $(SHELL) $(top_srcdir)/lib/pt-driver
+am__test_driver = $(SHELL) $(top_srcdir)/lib/test-driver
 TEST_SUITE_LOG = test-suite.log
 TEST_SUITE_HTML = $(TEST_SUITE_LOG:.log=.html)
 am__test_logs1 = $(TESTS:=.log)
@@ -462,7 +462,7 @@ recheck recheck-html:
        $(MAKE) $(AM_MAKEFLAGS) $$target AM_MAKEFLAGS='$(AM_MAKEFLAGS) 
TEST_LOGS="'"$$list"'"'
 .pl.log:
        @p='$<'; $(am__check_pre) \
-       $(am__pt_driver) $(am__test_driver_flags) -- \
+       $(am__test_driver) $(am__test_driver_flags) -- \
        $(PL_LOG_COMPILE) "$$tst"
 
 distdir: $(DISTFILES)
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 c46fe6c..67f3f03 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,7 +722,7 @@ parallel-tests-unreadable-log.test \
 parallel-tests-subdir.test \
 parallel-tests-interrupt.test \
 parallel-tests-reset-term.test \
-parallel-tests-pt-driver.test \
+parallel-test-driver-install.test \
 parse.test \
 percent.test \
 percent2.test \
diff --git a/tests/Makefile.in b/tests/Makefile.in
index 1adad76..4ba5dc9 100644
--- a/tests/Makefile.in
+++ b/tests/Makefile.in
@@ -170,7 +170,7 @@ esac;                                                       
\
 $(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT)
 RECHECK_LOGS = $(TEST_LOGS)
 AM_RECURSIVE_TARGETS = check check-html recheck recheck-html
-am__pt_driver = $(SHELL) $(top_srcdir)/lib/pt-driver
+am__test_driver = $(SHELL) $(top_srcdir)/lib/test-driver
 TEST_SUITE_LOG = test-suite.log
 TEST_SUITE_HTML = $(TEST_SUITE_LOG:.log=.html)
 TEST_EXTENSIONS = .test
@@ -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,7 +976,7 @@ parallel-tests-unreadable-log.test \
 parallel-tests-subdir.test \
 parallel-tests-interrupt.test \
 parallel-tests-reset-term.test \
-parallel-tests-pt-driver.test \
+parallel-test-driver-install.test \
 parse.test \
 percent.test \
 percent2.test \
@@ -1491,7 +1491,7 @@ recheck recheck-html:
        $(MAKE) $(AM_MAKEFLAGS) $$target AM_MAKEFLAGS='$(AM_MAKEFLAGS) 
TEST_LOGS="'"$$list"'"'
 .test.log:
        @p='$<'; $(am__check_pre) \
-       $(am__pt_driver) $(am__test_driver_flags) -- \
+       $(am__test_driver) $(am__test_driver_flags) -- \
        $(TEST_LOG_COMPILE) "$$tst"
 
 distdir: $(DISTFILES)
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; }

reply via email to

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