[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Automake-commit] [SCM] GNU Automake branch, testsuite-work, updated. v1
From: |
Stefano Lattarini |
Subject: |
[Automake-commit] [SCM] GNU Automake branch, testsuite-work, updated. v1.11-1306-g87fdf3a |
Date: |
Wed, 07 Sep 2011 17:56:50 +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=87fdf3a085980e3e7768909301ca2b711d33e429
The branch, testsuite-work has been updated
via 87fdf3a085980e3e7768909301ca2b711d33e429 (commit)
via 89f4c1c04f55c24daa1e6ff9c029efbc4908010e (commit)
via 55bada2cf9fb9481fbf24f3205fefe6499433c38 (commit)
via 858f4d6803b22c3595eb55c62cf2b3f087a32a48 (commit)
via 3afa5ec6519b96ed601f912418b20c3d2ef13652 (commit)
via 4e276f34ea4256d27d59f78e6d13c45892a6d182 (commit)
via 2663d0adb73e47fad7027b665b69478488de3f0c (commit)
via 78aac33c9a4bcbdb2e8c1ee37c163a548105b258 (commit)
from f7f1a89ca12e1218a44db743f9c5c0852dde1b05 (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 87fdf3a085980e3e7768909301ca2b711d33e429
Author: Stefano Lattarini <address@hidden>
Date: Wed Sep 7 19:06:52 2011 +0200
tests: avoid spurious failure due to bug in older TAP::Parser
Older TAP::Parser versions (e.g., 3.10) erroneously convert a test
number `0' into `1'; do not let this bug cause a spurious failure
in our testsuite.
* tests/tap-test-number-0.test: Skip if the aforementioned
TAP::Parser bug is detected.
commit 89f4c1c04f55c24daa1e6ff9c029efbc4908010e
Merge: 3afa5ec 55bada2
Author: Stefano Lattarini <address@hidden>
Date: Wed Sep 7 18:04:55 2011 +0200
Merge branch 'test-protocols' into testsuite-work
* test-protocols:
tap/perl: be more portable to older perl versions
tap/perl: be more portable to older TAP::Parser versions
commit 3afa5ec6519b96ed601f912418b20c3d2ef13652
Author: Stefano Lattarini <address@hidden>
Date: Wed Sep 7 16:50:09 2011 +0200
tests: fix spurious Cygwin failure of a test on TAP support
* tests/tap-bad-prog.tap (noexec.test): Add forgotten `echo'.
When trying to run it, redirect its output to /dev/null, to
avoid confusing automake's testsuite own TAP driver.
commit 4e276f34ea4256d27d59f78e6d13c45892a6d182
Author: Stefano Lattarini <address@hidden>
Date: Wed Sep 7 16:35:17 2011 +0200
test defs: fix glitch in TAP version of `warn_' function
* tests/tap-functions.sh (warn_): Do not display the warning
message two times.
commit 2663d0adb73e47fad7027b665b69478488de3f0c
Author: Stefano Lattarini <address@hidden>
Date: Wed Sep 7 16:14:15 2011 +0200
tests: fix another spurious failure due to ignored signals
* tests/tap-signal.test: Renamed ...
* tests/tap-signal.tap: ... to this, converted to the use of the
TAP protocol, and improved not to try to use/trap signals that
are ignored by the parent shell (they will be forcibly ignored
by all the child processes too). Extend the test a bit since we
are at it.
* tests/list-of-tests.mk: Update.
commit 78aac33c9a4bcbdb2e8c1ee37c163a548105b258
Author: Stefano Lattarini <address@hidden>
Date: Wed Sep 7 14:55:45 2011 +0200
tests: fix a spurious failure due to lacking Fortran compilers
* tests/silent-many-generic.test (configure.in): Cause the test
to be skipped if `configure' fails to find working C++, Fortran
and Fortran 77 compilers.
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 57 ++++++++++++++++++
lib/tap-driver.pl | 6 +-
tests/Makefile.in | 6 +-
tests/list-of-tests.mk | 2 +-
tests/silent-many-generic.test | 6 ++
tests/tap-bad-prog.tap | 5 +-
tests/tap-functions.sh | 5 +-
tests/tap-signal.tap | 123 ++++++++++++++++++++++++++++++++++++++++
tests/tap-signal.test | 92 ------------------------------
tests/tap-test-number-0.test | 19 ++++++
10 files changed, 219 insertions(+), 102 deletions(-)
create mode 100755 tests/tap-signal.tap
delete mode 100755 tests/tap-signal.test
diff --git a/ChangeLog b/ChangeLog
index 8c1e1cb..dfbb90a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,62 @@
2011-09-07 Stefano Lattarini <address@hidden>
+ tests: avoid spurious failure due to bug in older TAP::Parser
+ Older TAP::Parser versions (e.g., 3.10) erroneously convert a test
+ number `0' into `1'; do not let this bug cause a spurious failure
+ in our testsuite.
+ * tests/tap-test-number-0.test: Skip if the aforementioned
+ TAP::Parser bug is detected.
+
+2011-09-07 Stefano Lattarini <address@hidden>
+
+ tap/perl: be more portable to older perl versions
+ * lib/tap-driver.pl (trap_perl_warnings_and_errors): Do not use
+ the three-args version of the `open' builtin, it is not well
+ supported by older perl versions (at least perl 5.6.2).
+ (start): Add a no-op statement to pacify a "possible typo ... used
+ only once" perl warning.
+
+2011-09-07 Stefano Lattarini <address@hidden>
+
+ tap/perl: be more portable to older TAP::Parser versions
+ * lib/tap-driver.pl (start): Do not call the `ignore_exit' method
+ on our TAP parser: it is not supported in older TAP::Parser
+ versions (e.g., 3.10), and is not really required by our usage of
+ the parser object.
+
+2011-09-07 Stefano Lattarini <address@hidden>
+
+ tests: fix spurious Cygwin failure of a test on TAP support
+ * tests/tap-bad-prog.tap (noexec.test): Add forgotten `echo'.
+ When trying to run it, redirect its output to /dev/null, to
+ avoid confusing automake's testsuite own TAP driver.
+
+2011-09-07 Stefano Lattarini <address@hidden>
+
+ test defs: fix glitch in TAP version of `warn_' function
+ * tests/tap-functions.sh (warn_): Do not display the warning
+ message two times.
+
+2011-09-07 Stefano Lattarini <address@hidden>
+
+ tests: fix another spurious failure due to ignored signals
+ * tests/tap-signal.test: Renamed ...
+ * tests/tap-signal.tap: ... to this, converted to the use of the
+ TAP protocol, and improved not to try to use/trap signals that
+ are ignored by the parent shell (they will be forcibly ignored
+ by all the child processes too). Extend the test a bit since we
+ are at it.
+ * tests/list-of-tests.mk: Update.
+
+2011-09-07 Stefano Lattarini <address@hidden>
+
+ tests: fix a spurious failure due to lacking Fortran compilers
+ * tests/silent-many-generic.test (configure.in): Cause the test
+ to be skipped if `configure' fails to find working C++, Fortran
+ and Fortran 77 compilers.
+
+2011-09-07 Stefano Lattarini <address@hidden>
+
self tests: more use of TAP
* tests/self-check-reexec.test: Renamed ...
* tests/self-check-reexec.tap: ... to this, converted to the
diff --git a/lib/tap-driver.pl b/lib/tap-driver.pl
index 2c328d9..b6566ad 100755
--- a/lib/tap-driver.pl
+++ b/lib/tap-driver.pl
@@ -32,7 +32,7 @@ use strict;
use Getopt::Long ();
use TAP::Parser;
-my $VERSION = '2011-08-25.10'; # UTC
+my $VERSION = '2011-09-07.15'; # UTC
my $ME = "tap-driver.pl";
@@ -239,7 +239,7 @@ sub trap_perl_warnings_and_errors ()
{
# Be sure to send the warning/error message to the original stderr
# (presumably the console), not into the log file.
- open STDERR, ">&", \*OLDERR;
+ open STDERR, ">&OLDERR";
die @_;
}
}
@@ -253,11 +253,11 @@ sub start (@)
open LOG, ">", $log_file or die "$ME: opening $log_file: $!\n";
open OLDOUT, ">&STDOUT" or die "$ME: duplicating stdout: $!\n";
open OLDERR, ">&STDERR" or die "$ME: duplicating stdout: $!\n";
+ *OLDERR = *OLDERR; # To pacify a "used only once" warning.
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}
});
- $parser->ignore_exit(1) if $cfg{"ignore-exit"};
}
sub get_test_exit_message ()
diff --git a/tests/Makefile.in b/tests/Makefile.in
index b2df0e7..fd93782 100644
--- a/tests/Makefile.in
+++ b/tests/Makefile.in
@@ -1377,7 +1377,7 @@ tap-empty.test \
tap-escape-directive.test \
tap-escape-directive-2.test \
tap-exit.test \
-tap-signal.test \
+tap-signal.tap \
tap-fancy.test \
tap-fancy2.test \
tap-global-log.test \
@@ -1512,7 +1512,7 @@ wrap_TESTS = check-concurrency-bug9245-w.test_pt \
tap-planskip-whitespace-w.test_pltap tap-planskip-w.test_pltap \
tap-realtime-w.test_pltap tap-recheck-logs-w.test_pltap \
tap-recheck-w.test_pltap tap-result-comment-w.test_pltap \
- tap-signal-w.test_pltap tap-test-number-0-w.test_pltap \
+ tap-signal-w.tap_pltap tap-test-number-0-w.test_pltap \
tap-todo-skip-together-w.test_pltap \
tap-todo-skip-whitespace-w.test_pltap \
tap-todo-skip-w.test_pltap tap-unplanned-w.test_pltap \
@@ -2142,7 +2142,7 @@ tap-realtime-w.log: tap-realtime.test
tap-recheck-logs-w.log: tap-recheck-logs.test
tap-recheck-w.log: tap-recheck.test
tap-result-comment-w.log: tap-result-comment.test
-tap-signal-w.log: tap-signal.test
+tap-signal-w.log: tap-signal.tap
tap-test-number-0-w.log: tap-test-number-0.test
tap-todo-skip-together-w.log: tap-todo-skip-together.test
tap-todo-skip-whitespace-w.log: tap-todo-skip-whitespace.test
diff --git a/tests/list-of-tests.mk b/tests/list-of-tests.mk
index 988b4f0..5e3fae0 100644
--- a/tests/list-of-tests.mk
+++ b/tests/list-of-tests.mk
@@ -1051,7 +1051,7 @@ tap-empty.test \
tap-escape-directive.test \
tap-escape-directive-2.test \
tap-exit.test \
-tap-signal.test \
+tap-signal.tap \
tap-fancy.test \
tap-fancy2.test \
tap-global-log.test \
diff --git a/tests/silent-many-generic.test b/tests/silent-many-generic.test
index b2c7e89..4ae52de 100755
--- a/tests/silent-many-generic.test
+++ b/tests/silent-many-generic.test
@@ -105,6 +105,12 @@ AC_PROG_LEX
AC_PROG_YACC
AC_PROG_CXX
+# FIXME: remove this hack once the requirements c++, fortran and fortran77
+# are implemented correctly.
+test -n "`echo $CXX`" || AC_MSG_ERROR([C++ compiler not found], [77])
+test -n "`echo $FC`" || AC_MSG_ERROR([Fortran compiler not found], [77])
+test -n "`echo $F77`" || AC_MSG_ERROR([Fortran 77 compiler not found], [77])
+
# The SunStudio C++ compiler is unfortunately named `CC' (yuck!),
# and this can cause problems with our grepping checks on the
# output from make. Avoid these problems by invoking a wrapper
diff --git a/tests/tap-bad-prog.tap b/tests/tap-bad-prog.tap
index 1ced399..3cc5e21 100755
--- a/tests/tap-bad-prog.tap
+++ b/tests/tap-bad-prog.tap
@@ -38,7 +38,7 @@ END
cat > noexec.test <<'END'
#!/bin/sh
echo 1..1
-ok 1
+echo ok 1
END
cp noexec.test noread.test
@@ -60,7 +60,8 @@ command_ok_ "non-existent test is reported" \
grep '^ERROR: none\.test' stdout
desc="non-executable test is reported"
-if ./noexec.test; then
+# Redirect output to avoid confusing automake's testsuite own TAP driver.
+if ./noexec.test >/dev/null; then
skip_ -r "any file is executable" "$desc"
else
command_ok_ "$desc" -- grep '^ERROR: noexec\.test' stdout
diff --git a/tests/tap-functions.sh b/tests/tap-functions.sh
index ea88887..eb27ba6 100644
--- a/tests/tap-functions.sh
+++ b/tests/tap-functions.sh
@@ -97,7 +97,10 @@ diag_string_="#"
# Give a warning (using TAP diagnostic).
warn_ ()
{
- diag_ "WARNING:" ${1-"(unknown warning)"} ${1+"$@"}
+ case $# in
+ 0) diag_ "WARNING: (unknown warning)";;
+ *) diag_ "WARNING: $*";;
+ esac
}
# result_ RESULT [-D DIRECTIVE] [-r REASON] [--] [DESCRIPTION...]
diff --git a/tests/tap-signal.tap b/tests/tap-signal.tap
new file mode 100755
index 0000000..31793d4
--- /dev/null
+++ b/tests/tap-signal.tap
@@ -0,0 +1,123 @@
+#! /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:
+# - a test script terminated by a signal causes an hard error
+
+parallel_tests=yes
+. ./defs || Exit 1
+
+plan_ 10
+
+echo TESTS = > Makefile.am
+
+all_signals='1 2 3 9 13 15'
+blocked_signals=''
+for sig in $all_signals; do
+ # Ignore blocked signals
+ if is_blocked_signal $sig; then
+ blocked_signals="$blocked_signals $sig"
+ continue
+ fi
+ unindent > signal-$sig.test <<END
+ #!/bin/sh
+ echo 1..1
+ echo ok 1
+ kill -$sig \$\$
+ echo "Bail out! \$0 not killed?"
+END
+ echo TESTS += signal-$sig.test >> Makefile.am
+done
+results_count=`ls *.test | wc -l | tr -d "$tab$sp"`
+
+chmod a+x *.test
+
+. "$testsrcdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+
+# Solaris /bin/sh, when killed with a SIGTERM, SIGQUIT or SIGINT signal,
+# can end up exiting with exit status 208, instead of leaving the correct
+# wide exit status to the parent. See:
+# <http://dbaspot.com/shell/396118-bourne-shell-exit-code-term.html>
+# We need to detect and work around this incompatibility.
+
+have_solaris_bug=no
+for sig in 2 3 15; do
+ if /bin/sh -c "kill -$sig \$\$"; then
+ warn_ "/bin/sh cannot kill itself with signal $sig"
+ elif test $? -eq 208; then
+ warn_ "/bin/sh exits with status 208 upon some signals (Solaris?)"
+ warn_ "we will try to work around this bug"
+ have_solaris_bug=yes
+ break
+ fi
+done
+
+signal_caught ()
+{
+ numeric=$1
+ case $numeric in
+ 1) symbolic=HUP;;
+ 2) symbolic=INT;;
+ 3) symbolic=QUIT;;
+ 9) symbolic=KILL;;
+ 13) symbolic=PIPE;;
+ 15) symbolic=TERM;;
+ *) fatal_ "unexpected signal number '$numeric'"
+ esac
+ sig_re="((SIG)?$symbolic|$numeric)"
+ wbound_re="($|[^a-zA-Z0-9_-])"
+ pfx_re="^ERROR: signal-$numeric\\.test"
+ case $am_tap_implementation in
+ perl) rx="$pfx_re - terminated by signal $sig_re$";;
+ shell) rx="$pfx_re .*terminated by signal $sig_re$wbound_re";;
+ *) fatal_ "invalid \$am_tap_implementation '$am_tap_implementation'";;
+ esac
+ directive='' reason=''
+ case $have_solaris_bug,$symbolic in
+ yes,INT|yes,TERM|yes,QUIT) directive=TODO reason="Solaris /bin/sh bug";;
+ esac
+ case " $blocked_signals " in
+ *" $numeric "*)
+ reason="SIG$symbolic is blocked" directive=SKIP result=ok;;
+ *)
+ LC_ALL=C $EGREP "$rx" stdout && result='ok' || result='not ok';;
+ esac
+ result_ "$result" -D "$directive" -r "$reason" \
+ "TAP driver catch test termination by signal SIG$symbolic"
+}
+
+command_ok_ '"make check" fails' eval 'not $MAKE check >stdout'
+cat stdout # For debugging.
+
+command_ok_ "count of test results" count_test_results \
+ total=`expr $results_count '*' 2` \
+ pass=$results_count error=$results_count \
+ fail=0 xpass=0 xfail=0 skip=0
+
+for sig in $all_signals; do
+ signal_caught $sig
+done
+
+echo 'TEST_LOG_DRIVER_FLAGS = --ignore-exit' >> Makefile
+
+command_ok_ '"make check" passes [--ignore-exit]' eval '$MAKE check >stdout'
+cat stdout # For debugging.
+
+command_ok_ "count of test results [--ignore-exit]" count_test_results \
+ total=$results_count pass=$results_count \
+ fail=0 xpass=0 xfail=0 skip=0 error=0
+
+:
diff --git a/tests/tap-signal.test b/tests/tap-signal.test
deleted file mode 100755
index 7821a2a..0000000
--- a/tests/tap-signal.test
+++ /dev/null
@@ -1,92 +0,0 @@
-#! /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:
-# - a test script terminated by a signal causes an hard error
-
-parallel_tests=yes
-. ./defs || Exit 1
-
-echo TESTS = > Makefile.am
-for sig in 1 2 13 15; do
- unindent > signal-$sig.test <<END
- #!/bin/sh
- echo 1..1
- echo ok 1
- kill -$sig \$\$
- echo "Bail out! \$0 not killed?"
-END
- echo TESTS += signal-$sig.test >> Makefile.am
-done
-
-chmod a+x *.test
-
-. "$testsrcdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
-
-# Solaris /bin/sh, when killed with a SIGTERM or SIGINT signal, can end up
-# exiting with exit status 208, instead of leaving the correct wide exit
-# status to the parent. See:
-# <http://dbaspot.com/shell/396118-bourne-shell-exit-code-term.html>
-# We need to detect and work around this incompatibility.
-
-if /bin/sh -c 'kill -2 $$'; then
- fatal_ "/bin/sh cannot kill itself"
-elif test $? -eq 208; then
- have_solaris_bug=yes
-else
- have_solaris_bug=no
-fi
-
-signal_caught ()
-{
- numeric=$1
- symbolic=$2
- sig_re="((SIG)?$symbolic|$numeric)"
- wbound_re="($|[^a-zA-Z0-9_-])"
- pfx_re="^ERROR: signal-$numeric\\.test"
- case $am_tap_implementation in
- perl) rx="$pfx_re - terminated by signal $sig_re$";;
- shell) rx="$pfx_re .*terminated by signal $sig_re$wbound_re";;
- *) fatal_ "invalid \$am_tap_implementation '$am_tap_implementation'";;
- esac
- LC_ALL=C $EGREP "$rx" stdout && return 0
- case $have_solaris_bug,$symbolic in
- yes,INT|yes,TERM)
- $EGREP "$pfx_re - exited with status 208( |$)" stdout && return 0;;
- esac
- return 1
-}
-
-all_signals_caught ()
-{
- # These are the only signals that are portably trappable.
- signal_caught 1 HUP
- signal_caught 2 INT
- signal_caught 13 PIPE
- signal_caught 15 TERM
-}
-
-$MAKE check >stdout && { cat stdout; Exit 1; }
-cat stdout
-count_test_results total=8 pass=4 fail=0 xpass=0 xfail=0 skip=0 error=4
-all_signals_caught
-
-echo 'TEST_LOG_DRIVER_FLAGS = --ignore-exit' >> Makefile
-$MAKE check >stdout || { cat stdout; Exit 1; }
-cat stdout
-count_test_results total=4 pass=4 fail=0 xpass=0 xfail=0 skip=0 error=0
-
-:
diff --git a/tests/tap-test-number-0.test b/tests/tap-test-number-0.test
index abce60e..1f7681f 100755
--- a/tests/tap-test-number-0.test
+++ b/tests/tap-test-number-0.test
@@ -21,6 +21,25 @@
parallel_tests=yes
. ./defs || Exit 1
+if $PERL -w -e '
+ use warnings FATAL => "all"; use strict;
+ use TAP::Parser;
+ my $parser = TAP::Parser->new({tap => "1..1\n" . "ok 0\n"});
+ my $result = $parser->next;
+ $result->is_plan or die "first line is not TAP plan";
+ $result = $parser->next;
+ $result->is_test or die "second line is not TAP test result";
+ my $testno = $result->number;
+ $parser->next and die "unexpected further TAP stream";
+ exit ($testno == 0 ? 0 : 77);
+'; then
+ : # Nothing to do.
+elif test $? -eq 77; then
+ skip_ 'TAP::Parser bug: test number 0 gets relabelled as 1'
+else
+ fatal_ "error analyzing TAP::Parser module for bugs"
+fi
+
. "$testsrcdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
cat > a.test <<END
hooks/post-receive
--
GNU Automake
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Automake-commit] [SCM] GNU Automake branch, testsuite-work, updated. v1.11-1306-g87fdf3a,
Stefano Lattarini <=