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-1688


From: Stefano Lattarini
Subject: [Automake-commit] [SCM] GNU Automake branch, master, updated. v1.11-1688-gb190798
Date: Mon, 02 Jan 2012 21:31:04 +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=b190798a1585327e4aa59ddf9af22f160b987c74

The branch, master has been updated
       via  b190798a1585327e4aa59ddf9af22f160b987c74 (commit)
      from  34b2d5646829ac93ccc78acaaacbd7a4558dea3c (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 b190798a1585327e4aa59ddf9af22f160b987c74
Author: Stefano Lattarini <address@hidden>
Date:   Sun Jan 1 21:45:52 2012 +0100

    tests: fix spurious failure due to I/O buffering
    
    * tests/parallel-tests-interrupt.tap: Ensure the dummy test script
    `foo.test' flushes its standard output before starting to grep the
    log file where such output is being redirected by the parallel test
    harness.  Since we are at it, improve this same dummy script to
    better catch unexpected behaviours and results.
    
    Reported by Jim Meyering in automake bug#10418.

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

Summary of changes:
 tests/parallel-tests-interrupt.tap |   50 ++++++++++++++++++++++++-----------
 1 files changed, 34 insertions(+), 16 deletions(-)

diff --git a/tests/parallel-tests-interrupt.tap 
b/tests/parallel-tests-interrupt.tap
index ffe4074..74b418d 100755
--- a/tests/parallel-tests-interrupt.tap
+++ b/tests/parallel-tests-interrupt.tap
@@ -1,5 +1,5 @@
 #! /bin/sh
-# 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
@@ -45,27 +45,45 @@ echo $$ > pid
 END
 
 cat > foo.test << 'END'
-#!/bin/sh
-
-echo "foo is starting to run"
-
-ls -l >&9 || exit 99
-
-test $sig -gt 0 || {
-  echo "Bailout! \$sig not exported to test script" >&9
-  exit 99
+#!/bin/sh -e
+
+# We expect the test driver to be terminated by a signal, and so
+# to exit with non-zero status, thus causing "make check" to fail.
+# Exiting with status 0 from this test script is thus a good way to
+# make unexpected behaviours more evident, since this will likely
+# cause and unexpected success in "make check".
+trap 'exit 0' 0;
+stop_test () { exit 0; }
+
+# We need the "foo is starting to run" string flushed to standard output
+# ASAP, because we are soon going to grep for that string in the log file
+# where the test driver is redirecting this script's stdout.  The safest
+# way force this flushing portably is to rely on perl I/O capabilities.
+$PERL -e 'BEGIN { $| = 1 }; print "foo is starting to run\n"' || stop_test
+
+ls -l >&9 || stop_test
+
+bailout ()
+{
+  # Print this to the original stdout (saved in the fd 9), so that the
+  # emitted "Bail out!" directive will be interpreted by the test driver
+  # running the Automake testsuite.
+  echo "Bail out! $*" >&9
+  stop_test
 }
 
+test $sig -gt 0 || bailout "\$sig not exported to test script"
+
 res=ok; cat foo.log >&9 || res="not ok"
 echo "$res - logfile created and readable [SIG $sig]" >&9
 
-res=ok; grep '^foo is starting to run$' foo.log >&2 || res='not ok'
+res=ok; grep '^foo is starting to run$' foo.log >&9 || res='not ok'
 echo "$res - logfile contains output from test script [SIG $sig]" >&9
 
-cat pid >&9 \
-  || echo "Bailout! cannot get PID of test driver" >&9
-kill -$sig `cat pid` \
-  || echo "Bailout! cannot send signal $sig to test driver" >&9
+cat pid >&9 || bailout "cannot get PID of test driver"
+kill -$sig `cat pid` || bailout "cannot send signal $sig to test driver"
+
+stop_test
 END
 chmod a+x foo.test
 
@@ -85,7 +103,7 @@ for sig in $trapped_signals; do
     continue
   fi
   rm -f pid fail *.log
-  r=ok; env sig=$sig $MAKE check && r='not ok'
+  r=ok; env PERL="$PERL" sig="$sig" $MAKE check && r='not ok'
   echo "$r - signal $sig to test driver causes \"make check\" to fail"
   ls -l
   # These files shouldn't exist, but in case they do, their content might


hooks/post-receive
-- 
GNU Automake



reply via email to

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