automake-commit
[Top][All Lists]
Advanced

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

[Automake-commit] [SCM] GNU Automake branch, master, updated. v1.11-1817


From: Stefano Lattarini
Subject: [Automake-commit] [SCM] GNU Automake branch, master, updated. v1.11-1817-g6b81918
Date: Thu, 02 Feb 2012 20:39:47 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Automake".

http://git.sv.gnu.org/gitweb/?p=automake.git;a=commitdiff;h=6b819187e01cfa365a5bf3b122074c7da28fb8e1

The branch, master has been updated
       via  6b819187e01cfa365a5bf3b122074c7da28fb8e1 (commit)
       via  87f2058a5d83a1f256eaf95a9e345dd61ff959d9 (commit)
       via  2077a04427bae2945635bf870817b3e21aae5f4d (commit)
      from  dde91c5484e045882198d656fcfda7e9c11d7858 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 6b819187e01cfa365a5bf3b122074c7da28fb8e1
Author: Stefano Lattarini <address@hidden>
Date:   Thu Feb 2 20:14:30 2012 +0100

    cosmetics: fix indentation and typos in perl TAP driver
    
    * lib/tap-driver.pl (get_test_exit_message): Fix botched
    indentation.  Fix typo in error message: s/ststus/status/.

commit 87f2058a5d83a1f256eaf95a9e345dd61ff959d9
Author: Stefano Lattarini <address@hidden>
Date:   Thu Feb 2 19:07:51 2012 +0100

    test defs: fix typo in variable name ($AM_TESTSUITE_PERL)
    
    * tests/defs-static.in: Fix typo: it's '$AM_TESTSUITE_PERL',
    not '$AM_TESTUITE_PERL'.

commit 2077a04427bae2945635bf870817b3e21aae5f4d
Author: Stefano Lattarini <address@hidden>
Date:   Thu Feb 2 14:51:59 2012 +0100

    tap/perl: handle missing or non-executable scripts better
    
    This change improves how our Perl-based TAP driver handles
    non-runnable test scripts (meaning they might be not executable,
    or not readable, or even not exist).  In particular, it makes the
    driver deterministically display a clear "ERROR" result instead
    of possibly dying with diagnostic from 'TAP::Parser' internals,
    and prevents it from displaying spurious "missing TAP plan" errors.
    
    Moreover, with this change, some testsuite failures present only
    with newer perl versions (e.g., 5.14) are fixed.  See automake
    bug#10418.
    
    * tests/tap-bad-prog.tap: When testing the perl implementation of
    the TAP driver, and when the perl interpreter offers a good-enough
    'IPC::Open3::open3' function, expect it not to display spurious
    "missing TAP plan" diagnostic if the error is actually due to a
    non-runnable test script.
    * lib/tap-driver.pl (start): Removed, broken up into ...
    (setup_io): ... this ...
    (setup_parser): ... and this, which now tries to catch and report
    errors in launching the test scripts.
    (finish): New, used by both 'main' and 'setup_parser'.
    (main): Adjust.

-----------------------------------------------------------------------

Summary of changes:
 lib/tap-driver.pl      |   57 ++++++++++++++++++++++++++++++++---------------
 tests/defs-static.in   |    2 +-
 tests/tap-bad-prog.tap |   35 ++++++++++++++++++++++++++---
 3 files changed, 71 insertions(+), 23 deletions(-)

diff --git a/lib/tap-driver.pl b/lib/tap-driver.pl
index b6566ad..9ce1a31 100755
--- a/lib/tap-driver.pl
+++ b/lib/tap-driver.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright (C) 2011 Free Software Foundation, Inc.
+# Copyright (C) 2011, 2012 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
@@ -32,7 +32,7 @@ use strict;
 use Getopt::Long ();
 use TAP::Parser;
 
-my $VERSION = '2011-09-07.15'; # UTC
+my $VERSION = '2012-02-01.19'; # UTC
 
 my $ME = "tap-driver.pl";
 
@@ -122,6 +122,7 @@ sub colored ($$);
 sub copy_in_global_log ();
 sub decorate_result ($);
 sub extract_tap_comment ($);
+sub finish ();
 sub get_global_test_result ();
 sub get_test_exit_message ();
 sub get_test_results ();
@@ -132,7 +133,8 @@ sub is_null_string ($);
 sub main (@);
 sub must_recheck ();
 sub report ($;$);
-sub start (@);
+sub setup_io ();
+sub setup_parser (@);
 sub stringify_result_obj ($);
 sub testsuite_error ($);
 sub trap_perl_warnings_and_errors ();
@@ -244,7 +246,7 @@ sub trap_perl_warnings_and_errors ()
     }
 }
 
-sub start (@)
+sub setup_io ()
 {
   # Redirect stderr and stdout to a temporary log file.  Save the
   # original stdout stream, since we need it to print testsuite
@@ -257,14 +259,27 @@ sub start (@)
   trap_perl_warnings_and_errors;
   open STDOUT, ">&LOG" or die "$ME: redirecting stdout: $!\n";
   open STDERR, ">&LOG" or die "$ME: redirecting stderr: $!\n";
-  $parser = TAP::Parser->new ({ exec => address@hidden, merge => $cfg{merge} 
});
+}
+
+sub setup_parser (@)
+{
+  local $@ = '';
+  eval { $parser = TAP::Parser->new ({exec => address@hidden, merge => 
$cfg{merge}}) };
+  if ($@ ne '')
+    {
+      # Don't use the error message in $@ as set by TAP::Parser, since
+      # currently it's both too generic (at the point of being basically
+      # useless) and quite long.
+      report "ERROR", "- couldn't execute test script";
+      finish;
+    }
 }
 
 sub get_test_exit_message ()
 {
   my $wstatus = $parser->wait;
   # Watch out for possible internal errors.
-  die "$ME: couldn't get the exit ststus of the TAP producer"
+  die "$ME: couldn't get the exit status of the TAP producer"
     unless defined $wstatus;
   # Return an undefined value if the producer exited with success.
   return unless $wstatus;
@@ -272,17 +287,17 @@ sub get_test_exit_message ()
   # by a signal.
   use POSIX qw (WIFEXITED WEXITSTATUS WIFSIGNALED WTERMSIG);
   if (WIFEXITED ($wstatus))
-       {
-      return sprintf "exited with status %d", WEXITSTATUS ($wstatus);
-       }
+  {
+    return sprintf "exited with status %d", WEXITSTATUS ($wstatus);
+  }
   elsif (WIFSIGNALED ($wstatus))
-       {
+    {
       return sprintf "terminated by signal %d", WTERMSIG ($wstatus);
-       }
+    }
   else
-       {
-         return "terminated abnormally";
-       }
+    {
+      return "terminated abnormally";
+    }
 }
 
 sub stringify_result_obj ($)
@@ -460,9 +475,17 @@ sub extract_tap_comment ($)
   return "";
 }
 
+sub finish ()
+{
+  write_test_results;
+  close LOG or die "$ME: closing $log_file: $!\n";
+  exit 0;
+}
+
 sub main (@)
 {
-  start @_;
+  setup_io;
+  setup_parser @_;
 
   while (defined (my $cur = $parser->next))
     {
@@ -510,9 +533,7 @@ sub main (@)
           testsuite_error $msg if $msg;
         }
     }
-  write_test_results;
-  close LOG or die "$ME: closing $log_file: $!\n";
-  exit 0;
+  finish;
 }
 
 # ----------- #
diff --git a/tests/defs-static.in b/tests/defs-static.in
index b79e399..79484a9 100644
--- a/tests/defs-static.in
+++ b/tests/defs-static.in
@@ -144,7 +144,7 @@ SHELL=${AM_TESTSUITE_SHELL-'@SHELL@'}; export SHELL
 
 # User can override various tools used.  Prefer overriding specific for
 # that automake testsuite, if they are available.
-PERL=${AM_TESTUITE_PERL-${PERL-'@PERL@'}}
+PERL=${AM_TESTSUITE_PERL-${PERL-'@PERL@'}}
 MAKE=${AM_TESTSUITE_MAKE-${MAKE-'make'}}
 AUTOCONF=${AM_TESTSUITE_AUTOCONF-${AUTOCONF-'@am_AUTOCONF@'}}
 AUTOM4TE=${AM_TESTSUITE_AUTOM4TE-${AUTOM4TE-'@am_AUTOM4TE@'}}
diff --git a/tests/tap-bad-prog.tap b/tests/tap-bad-prog.tap
index 212633f..b02e51a 100755
--- a/tests/tap-bad-prog.tap
+++ b/tests/tap-bad-prog.tap
@@ -23,7 +23,7 @@ am_parallel_tests=yes
 
 fetch_tap_driver
 
-plan_ 5
+plan_ 6
 
 cat >> configure.in <<END
 AC_OUTPUT
@@ -78,9 +78,36 @@ else
   command_ok_ "$desc" -- grep '^ERROR: noread\.test' stdout
 fi
 
-# Check that no spurious test results is reported.  This is lower-priority
-# (and in fact the check currently fails.
-command_ok_ 'no spurious results' -D TODO -r 'still get "missing plan"' \
+# Check that no spurious test result is reported.  This is lower-priority
+# (and in fact the check currently fails for our awk-based driver).
+directive=
+if test $am_tap_implementation = shell; then
+  directive=TODO
+else
+  # Older versions of IPC::Open3 (e.g., version 1.05 on perl 5.12.4 or
+  # version 1.0103 on perl 5.6.2) fail to properly trap errors in exec(2)
+  # calls in the child process; hence, the TAP driver cannot be properly
+  # informed of such error.
+  if $PERL -w -e '
+    use IPC::Open3 qw/open3/;
+    $@ = "";
+    eval { open3(*STDIN, *STDOUT, *STDERR, "am--no-such-command") };
+    $@ =~ m/\bopen3:.*am--no-such-command/
+      or die "Bad \$@ value: \"address@hidden"\n";
+  '; then
+    : # OK. IPC::Open3 should be good enough.
+  else
+    for s in '"missing plan" message' 'results'; do
+      skip_ -r "IPC::Open3 not good enough" "no spurious $s"
+    done
+    Exit 0
+  fi
+fi
+
+command_ok_ 'no spurious "missing plan" message' \
+    -D "$directive" -- not grep 'missing.* plan' stdout
+command_ok_ 'no spurious results' \
+  -D "$directive" -r 'still get "missing plan"' \
   count_test_results total=3 pass=0 fail=0 xpass=0 xfail=0 skip=0 error=3
 
 :


hooks/post-receive
-- 
GNU Automake



reply via email to

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