[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Automake-commit] [SCM] GNU Automake branch, test-protocols, updated. v1
From: |
Stefano Lattarini |
Subject: |
[Automake-commit] [SCM] GNU Automake branch, test-protocols, updated. v1.11-1027-gc8b66be |
Date: |
Wed, 17 Aug 2011 17:21:13 +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=c8b66be05a6301e5f82ee7b3b7a87727f5cecd9f
The branch, test-protocols has been updated
via c8b66be05a6301e5f82ee7b3b7a87727f5cecd9f (commit)
via 1410d5c0be4283ebb9aba8b472a4c890263ffff4 (commit)
via be241ce3cc4fea3e9c3297221958cc8a358f091b (commit)
via 081e90a8e51099a7513e77329eb604763f6f4df7 (commit)
via 51f413e99a4254139b40294bc808d614b755a35b (commit)
via fb21ed841b61c61d70ac9c370f53d2cf53231764 (commit)
via 5c210551131a0fc50d0e1af21843b35df46ffdbf (commit)
from f5c5453039bd46bc54023c1f0434c167624aba5b (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 c8b66be05a6301e5f82ee7b3b7a87727f5cecd9f
Author: Stefano Lattarini <address@hidden>
Date: Wed Aug 17 18:30:12 2011 +0200
tap: improve granularity for tests on problematic TAP messages
* tests/tap-message-0.test: Break up into ...
* tests/tap-msg0-result.test, tests/tap-msg0-directive.test,
tests/tap-msg0-planskip.test, tests/tap-msg0-misc.test,
tests/tap-msg0-bailout.test: ... these new tests, and extend
a little.
* tests/Makefile.am (tap_with_common_setup_tests): Update.
commit 1410d5c0be4283ebb9aba8b472a4c890263ffff4
Author: Stefano Lattarini <address@hidden>
Date: Wed Aug 17 17:07:59 2011 +0200
tap: correctly handle string "0" in TAP messages
* lib/tap-driver.pl (is_null_string): New function, can be used
to determine whether a given string variable is empty or undefined.
Useful to avoid pitfalls like:
if ($message) { print "$message\n"; }
which wouldn't print anything if $message is the literal "0".
(handle_tap_test, handle_tap_plan, handle_tap_bailout): Use it,
to avoid missing messages composed only by a literal "0" in TAP
result descriptions and in skip, todo and bailout explanations.
* tests/tap-message-0.test: Enhance.
* tests/Makefile.am (XFAIL_TESTS): Remove it, it passes now.
commit be241ce3cc4fea3e9c3297221958cc8a358f091b
Author: Stefano Lattarini <address@hidden>
Date: Wed Aug 17 16:40:10 2011 +0200
tap: a minor simplification in the perl TAP driver
* lib/tap-driver.pl: The `--disable-hard-errors' option is a
no-op, so just ignore it and its argument.
commit 081e90a8e51099a7513e77329eb604763f6f4df7
Author: Stefano Lattarini <address@hidden>
Date: Wed Aug 17 16:32:48 2011 +0200
parallel-tests: fix help screen for test driver scripts
* lib/tap-driver.pl ($USAGE): The `--trs-file' option is mandatory
too.
* lib/tap-driver.sh (print_usage): Likewise.
* lib/test-driver (print_usage): Likewise.
($scriptversion): Update.
commit 51f413e99a4254139b40294bc808d614b755a35b
Author: Stefano Lattarini <address@hidden>
Date: Wed Aug 17 14:59:19 2011 +0200
tap: add a dummy TAP driver script implemented in shell + awk
The user can also now decide which implementation of the TAP driver
to use in the testsuite by defining the `$am_tap_implementation'
variable to either "perl" or "shell". Future enhancements will
allow the testsuite to automatically run the test scripts on TAP
support with both the TAP driver implementations, to improve
coverage.
* tests/defs (fetch_tap_driver): Honor the `$am_tap_implementation'
variable to decide which implementation of the TAP driver to fetch.
($am_tap_implementation): Default to "perl".
* tests/tap-common-setup.test: Do not fetch the TAP driver, the
code in tap-setup.sh does that already (and respecting runtime
overriding of `$am_tap_implementation').
* lib/tap-driver: Renamed ...
* lib/tap-driver.pl: ... to this, and ...
($ME): ... adjusted this.
* doc/automake.texi: Adjust to the renaming.
* tests/Makefile.am (TAP_LOG_DRIVER): Likewise.
* tests/tap-doc2.test: Likewise.
* lib/tap-driver.sh: New script, still mostly dummy.
* lib/Makefile.am (dist_script_DATA): Update, and since we are at
it, rewrite it to make it easier to add new entries in the future.
commit fb21ed841b61c61d70ac9c370f53d2cf53231764
Author: Stefano Lattarini <address@hidden>
Date: Wed Aug 17 12:06:25 2011 +0200
testsuite: refactor tests on TAP support in view of future changes
* tests/defs (fetch_tap_driver): New subroutine; it fetches the
automake-provided TAP driver from the `lib/' directory into the
current directory, and edits its shebang line so that it will be
run with the perl interpreter determined at configure time.
* tests/tap-setup.sh: Use it.
* tests/tap-common-setup.test: There's no need to AC_SUBST `PERL'
anymore, nor to use it in the Makefile to run the TAP driver.
Also, use the `fetch_tap_driver' function instead of copying the
`tap-driver' auxiliary script directly.
* tests/tap-bad-prog.tap: Likewise.
* tests/tap-diagnostic-custom.test: Likewise.
* tests/tap-doc.test: Likewise.
* tests/tap-merge-stdout-stderr.test: Likewise.
* tests/tap-more.test: Likewise.
* tests/tap-more2.test: Likewise.
* tests/tap-recheck.test: Likewise.
* tests/tap-summary-aux.sh: Likewise.
* tests/tap-basic.test: Likewise, and fix a grammaro in comments
since we are at it.
commit 5c210551131a0fc50d0e1af21843b35df46ffdbf
Author: Stefano Lattarini <address@hidden>
Date: Wed Aug 17 12:07:35 2011 +0200
fix: regenerate tests/Makefile.in
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 87 ++++++++++++++++++++
doc/automake.texi | 12 ++--
lib/Makefile.am | 25 +++++-
lib/Makefile.in | 25 +++++-
lib/{tap-driver => tap-driver.pl} | 39 ++++++----
lib/{test-driver => tap-driver.sh} | 80 +++++++++----------
lib/test-driver | 4 +-
tests/Makefile.am | 9 ++-
tests/Makefile.in | 11 ++-
tests/defs | 24 ++++++
tests/tap-bad-prog.tap | 6 +-
tests/tap-basic.test | 8 +-
tests/tap-common-setup.test | 6 +-
tests/tap-diagnostic-custom.test | 6 +-
tests/tap-doc.test | 6 +-
tests/tap-doc2.test | 7 +-
tests/tap-merge-stdout-stderr.test | 3 +-
tests/tap-more.test | 6 +-
tests/tap-more2.test | 6 +-
...lan-and-bad-exit.test => tap-msg0-bailout.test} | 25 ++----
...ap-not-ok-skip.test => tap-msg0-directive.test} | 20 +++--
tests/{tap-message-0.test => tap-msg0-misc.test} | 68 ++++++++++------
...scape-directive.test => tap-msg0-planskip.test} | 24 ++----
tests/{tap-message-0.test => tap-msg0-result.test} | 37 ++++-----
tests/tap-recheck.test | 6 +-
tests/tap-setup.sh | 3 +-
tests/tap-summary-aux.sh | 6 +-
27 files changed, 347 insertions(+), 212 deletions(-)
rename lib/{tap-driver => tap-driver.pl} (92%)
copy lib/{test-driver => tap-driver.sh} (60%)
copy tests/{tap-missing-plan-and-bad-exit.test => tap-msg0-bailout.test} (67%)
copy tests/{tap-not-ok-skip.test => tap-msg0-directive.test} (73%)
copy tests/{tap-message-0.test => tap-msg0-misc.test} (51%)
copy tests/{tap-escape-directive.test => tap-msg0-planskip.test} (68%)
rename tests/{tap-message-0.test => tap-msg0-result.test} (62%)
diff --git a/ChangeLog b/ChangeLog
index 2cb53d4..4d83efb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,90 @@
+2011-08-17 Stefano Lattarini <address@hidden>
+
+ tap: improve granularity for tests on problematic TAP messages
+ * tests/tap-message-0.test: Break up into ...
+ * tests/tap-msg0-result.test, tests/tap-msg0-directive.test,
+ tests/tap-msg0-planskip.test, tests/tap-msg0-misc.test,
+ tests/tap-msg0-bailout.test: ... these new tests, and extend
+ a little.
+ * tests/Makefile.am (tap_with_common_setup_tests): Update.
+
+2011-08-17 Stefano Lattarini <address@hidden>
+
+ tap: correctly handle string "0" in TAP messages
+ * lib/tap-driver.pl (is_null_string): New function, can be used
+ to determine whether a given string variable is empty or undefined.
+ Useful to avoid pitfalls like:
+ if ($message) { print "$message\n"; }
+ which wouldn't print anything if $message is the literal "0".
+ (handle_tap_test, handle_tap_plan, handle_tap_bailout): Use it,
+ to avoid missing messages composed only by a literal "0" in TAP
+ result descriptions and in skip, todo and bailout explanations.
+ * tests/tap-message-0.test: Enhance.
+ * tests/Makefile.am (XFAIL_TESTS): Remove it, it passes now.
+
+2011-08-17 Stefano Lattarini <address@hidden>
+
+ tap: a minor simplification in the perl TAP driver
+ * lib/tap-driver.pl: The `--disable-hard-errors' option is a
+ no-op, so just ignore it and its argument.
+
+2011-08-17 Stefano Lattarini <address@hidden>
+
+ parallel-tests: fix help screen for test driver scripts
+ * lib/tap-driver.pl ($USAGE): The `--trs-file' option is mandatory
+ too.
+ * lib/tap-driver.sh (print_usage): Likewise.
+ * lib/test-driver (print_usage): Likewise.
+ ($scriptversion): Update.
+
+2011-08-17 Stefano Lattarini <address@hidden>
+
+ tap: add a dummy TAP driver script implemented in shell + awk
+ The user can also now decide which implementation of the TAP driver
+ to use in the testsuite by defining the `$am_tap_implementation'
+ variable to either "perl" or "shell". Future enhancements will
+ allow the testsuite to automatically run the test scripts on TAP
+ support with both the TAP driver implementations, to improve
+ coverage.
+ * tests/defs (fetch_tap_driver): Honor the `$am_tap_implementation'
+ variable to decide which implementation of the TAP driver to fetch.
+ ($am_tap_implementation): Default to "perl".
+ * tests/tap-common-setup.test: Do not fetch the TAP driver, the
+ code in tap-setup.sh does that already (and respecting runtime
+ overriding of `$am_tap_implementation').
+ * lib/tap-driver: Renamed ...
+ * lib/tap-driver.pl: ... to this, and ...
+ ($ME): ... adjusted this.
+ * doc/automake.texi: Adjust to the renaming.
+ * tests/Makefile.am (TAP_LOG_DRIVER): Likewise.
+ * tests/tap-doc2.test: Likewise.
+ * lib/tap-driver.sh: New script, still mostly dummy.
+ * lib/Makefile.am (dist_script_DATA): Update, and since we are at
+ it, rewrite it to make it easier to add new entries in the future.
+
+2011-08-17 Stefano Lattarini <address@hidden>
+
+ testsuite: refactor tests on TAP support in view of future changes
+ * tests/defs (fetch_tap_driver): New subroutine; it fetches the
+ automake-provided TAP driver from the `lib/' directory into the
+ current directory, and edits its shebang line so that it will be
+ run with the perl interpreter determined at configure time.
+ * tests/tap-setup.sh: Use it.
+ * tests/tap-common-setup.test: There's no need to AC_SUBST `PERL'
+ anymore, nor to use it in the Makefile to run the TAP driver.
+ Also, use the `fetch_tap_driver' function instead of copying the
+ `tap-driver' auxiliary script directly.
+ * tests/tap-bad-prog.tap: Likewise.
+ * tests/tap-diagnostic-custom.test: Likewise.
+ * tests/tap-doc.test: Likewise.
+ * tests/tap-merge-stdout-stderr.test: Likewise.
+ * tests/tap-more.test: Likewise.
+ * tests/tap-more2.test: Likewise.
+ * tests/tap-recheck.test: Likewise.
+ * tests/tap-summary-aux.sh: Likewise.
+ * tests/tap-basic.test: Likewise, and fix a grammaro in comments
+ since we are at it.
+
2011-08-14 Stefano Lattarini <address@hidden>
coverage: missing tap plan and non-zero exit status
diff --git a/doc/automake.texi b/doc/automake.texi
index 6be5c2d..ca54999 100644
--- a/doc/automake.texi
+++ b/doc/automake.texi
@@ -9632,16 +9632,16 @@ use TAP in their testsuite.
Currently, the TAP driver that comes with Automake requires a perl
interpreter to work, and requires various by-hand steps on the
developer's part (this should be fixed in future Automake versions).
-You'll have grab the @file{tap-driver} script from the Automake
+You'll have grab the @file{tap-driver.pl} script from the Automake
distribution by hand, copy it in your source tree, add code to
@file{configure.ac} to search a perl interpreter and to define the
@code{$(PERL)} variable accordingly, and use the Automake support
for third-party test drivers to instruct the harness to use the
address@hidden to run your TAP-producing tests. See the example
address@hidden to run your TAP-producing tests. See the example
below for clarification.
Apart from the options common to all the Automake test drivers
-(@pxref{Command-line arguments for test drivers}), the @file{tap-driver}
+(@pxref{Command-line arguments for test drivers}), the @file{tap-driver.pl}
supports the following options, whose names are chosen for enhanced
compatibility with the @command{prove} utility.
@@ -9691,14 +9691,14 @@ AC_INIT([GNU Try Tap], [1.0], [bug-automake@@gnu.org])
AC_CONFIG_AUX_DIR([build-aux])
AM_INIT_AUTOMAKE([foreign parallel-tests -Wall -Werror])
AC_CONFIG_FILES([Makefile])
-AC_REQUIRE_AUX_FILE([tap-driver])
+AC_REQUIRE_AUX_FILE([tap-driver.pl])
AC_PATH_PROG([PERL], [perl])
test -n "$PERL" || AC_MSG_ERROR([perl not found])
$PERL -MTAP::Parser -e 1 || AC_MSG_ERROR([TAP::Parser not found])
AC_OUTPUT
% @kbd{cat Makefile.am}
-TEST_LOG_DRIVER = $(PERL) $(srcdir)/build-aux/tap-driver
+TEST_LOG_DRIVER = $(PERL) $(srcdir)/build-aux/tap-driver.pl
TESTS = foo.test bar.test baz.test
EXTRA_DIST = $(TESTS)
@@ -9726,7 +9726,7 @@ echo ok 1
# Exit with error, even if all the test case has been successful.
exit 7
-% @kbd{cp @var{PREFIX}/share/address@hidden/tap-driver .}
+% @kbd{cp @var{PREFIX}/share/address@hidden/tap-driver.pl .}
% @kbd{autoreconf -vi && ./configure && make check}
...
PASS: foo.test 1 - Swallows fly
diff --git a/lib/Makefile.am b/lib/Makefile.am
index a9467f1..bc234ee 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -2,8 +2,8 @@
## Makefile for Automake lib.
-# Copyright (C) 2001, 2003, 2004, 2009, 2010 Free Software Foundation,
-# Inc.
+# Copyright (C) 2001, 2003, 2004, 2009, 2010, 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
@@ -27,9 +27,24 @@ dist_pkgvdata_DATA = COPYING INSTALL texinfo.tex ansi2knr.c
ansi2knr.1 \
## _SCRIPTS, then the program transform will be applied, which is not
## what we want. So we make them executable by hand.
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 test-driver tap-driver
+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 \
+ test-driver \
+ tap-driver.sh \
+ tap-driver.pl
EXTRA_DIST = gnupload
diff --git a/lib/Makefile.in b/lib/Makefile.in
index b600402..93b693a 100644
--- a/lib/Makefile.in
+++ b/lib/Makefile.in
@@ -15,8 +15,8 @@
@SET_MAKE@
-# Copyright (C) 2001, 2003, 2004, 2009, 2010 Free Software Foundation,
-# Inc.
+# Copyright (C) 2001, 2003, 2004, 2009, 2010, 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
@@ -240,9 +240,24 @@ dist_pkgvdata_DATA = COPYING INSTALL texinfo.tex
ansi2knr.c ansi2knr.1 \
config-ml.in
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 test-driver tap-driver
+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 \
+ test-driver \
+ tap-driver.sh \
+ tap-driver.pl
EXTRA_DIST = gnupload
all: all-recursive
diff --git a/lib/tap-driver b/lib/tap-driver.pl
similarity index 92%
rename from lib/tap-driver
rename to lib/tap-driver.pl
index 95fb78c..7043815 100755
--- a/lib/tap-driver
+++ b/lib/tap-driver.pl
@@ -11,7 +11,7 @@ use strict;
use Getopt::Long ();
use TAP::Parser;
-my $ME = "tap-driver";
+my $ME = "tap-driver.pl";
my $USAGE = <<'END';
Usage:
@@ -20,7 +20,7 @@ Usage:
[--enable-hard-errors={yes|no}] [--ignore-exit]
[--diagnostic-string=STRING] [--merge|--no-merge]
[--comments|--no-comments] [--] TEST-COMMAND
-The `--test-name' and `--log-file' options are mandatory.
+The `--test-name', `--log-file' and `--trs-file' options are mandatory.
END
my $HELP = "$ME: TAP-aware test driver for Automake testsuite harness." .
@@ -63,7 +63,6 @@ my $plan_seen = NO_PLAN;
my %cfg = (
"color-tests" => 0,
"expect-failure" => 0,
- "enable-hard-errors" => 1,
"merge" => 0,
"comments" => 0,
"ignore-exit" => 0,
@@ -82,7 +81,7 @@ Getopt::Long::GetOptions (
'trs-file=s' => \$trs_file,
'color-tests=s' => \&bool_opt,
'expect-failure=s' => \&bool_opt,
- 'enable-hard-errors=s' => \&bool_opt,
+ 'enable-hard-errors=s' => sub {}, # No-op.
'diagnostic-string=s' => \$diag_string,
'comments' => sub { $cfg{"comments"} = 1; },
'no-comments' => sub { $cfg{"comments"} = 0; },
@@ -107,6 +106,7 @@ sub get_test_results ();
sub handle_tap_bailout ($);
sub handle_tap_plan ($);
sub handle_tap_test ($);
+sub is_null_string ($);
sub main (@);
sub must_recheck ();
sub report ($;$);
@@ -137,6 +137,16 @@ sub bool_opt ($$)
}
}
+# If the given string is undefined or empty, return true, otherwise
+# return false. This function is useful to avoid pitfalls like:
+# if ($message) { print "$message\n"; }
+# which wouldn't print anything if $message is the literal "0".
+sub is_null_string ($)
+{
+ my $str = shift;
+ return ! (defined $str and length $str);
+}
+
# Convert a boolean to a "yes"/"no" string.
sub yn ($)
{
@@ -330,10 +340,9 @@ sub handle_tap_test ($)
my $test_result = stringify_test_result $test;
my $string = $test->number;
- if (my $description = $test->description)
- {
- $string .= " $description";
- }
+ my $description = $test->description;
+ $string .= " $description"
+ unless is_null_string $description;
if ($plan_seen == LATE_PLAN)
{
@@ -350,10 +359,9 @@ sub handle_tap_test ($)
elsif (my $directive = $test->directive)
{
$string .= " # $directive";
- if (my $explanation = $test->explanation)
- {
- $string .= " $explanation";
- }
+ my $explanation = $test->explanation;
+ $string .= " $explanation"
+ unless is_null_string $explanation;
}
report $test_result, $string;
@@ -382,8 +390,8 @@ sub handle_tap_plan ($)
# of SKIP result.
if ($plan->directive && $testno == 0)
{
- my $explanation = $plan->explanation ?
- "- " . $plan->explanation : undef;
+ my $explanation = is_null_string ($plan->explanation) ?
+ undef : "- " . $plan->explanation;
report "SKIP", $explanation;
}
}
@@ -392,7 +400,8 @@ sub handle_tap_bailout ($)
{
my ($bailout, $msg) = ($_[0], "Bail out!");
$bailed_out = 1;
- $msg .= " " . $bailout->explanation if $bailout->explanation;
+ $msg .= " " . $bailout->explanation
+ unless is_null_string $bailout->explanation;
testsuite_error $msg;
}
diff --git a/lib/test-driver b/lib/tap-driver.sh
similarity index 60%
copy from lib/test-driver
copy to lib/tap-driver.sh
index 8522a49..322e3c4 100755
--- a/lib/test-driver
+++ b/lib/tap-driver.sh
@@ -1,8 +1,4 @@
#! /bin/sh
-# test-driver - basic driver script for the `parallel-tests' mode.
-
-scriptversion=2011-08-04.22; # UTC
-
# Copyright (C) 2011 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
@@ -27,10 +23,18 @@ scriptversion=2011-08-04.22; # UTC
# bugs to <address@hidden> or send patches to
# <address@hidden>.
+scriptversion=2011-08-17.14; # UTC
+
# Make unconditional expansion of undefined variables an error. This
# helps a lot in preventing typo-related bugs.
set -u
+fatal ()
+{
+ echo "$0: fatal: $*" >&2
+ exit 1
+}
+
usage_error ()
{
echo "$0: $*" >&2
@@ -42,39 +46,56 @@ print_usage ()
{
cat <<END
Usage:
- test-driver --test-name=NAME --log-file=PATH --trs-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.
+ tap-driver --test-name=NAME --log-file=PATH --trs-file=PATH
+ [--expect-failure={yes|no}] [--color-tests={yes|no}]
+ [--enable-hard-errors={yes|no}] [--ignore-exit]
+ [--diagnostic-string=STRING] [--merge|--no-merge]
+ [--comments|--no-comments] [--] TEST-COMMAND
+The \`--test-name', \`--log-file' and \`--trs-file' options are mandatory.
END
}
# TODO: better error handling in option parsing (in particular, ensure
# TODO: $log_file, $trs_file and $test_name are defined).
test_name= # Used for reporting.
-log_file= # Where to save the output of the test script.
+log_file= # Where to save the result and output of the test script.
trs_file= # Where to save the metadata of the test run.
expect_failure=no
color_tests=no
-enable_hard_errors=yes
+merge=no
+ignore_exit=no
+comments=no
+diag_string='#'
while test $# -gt 0; do
case $1 in
--help) print_usage; exit $?;;
- --version) echo "test-driver $scriptversion"; exit $?;;
+ --version) echo "tap-driver $scriptversion"; exit $?;;
--test-name) test_name=$2; shift;;
--log-file) log_file=$2; shift;;
--trs-file) trs_file=$2; shift;;
--color-tests) color_tests=$2; shift;;
--expect-failure) expect_failure=$2; shift;;
- --enable-hard-errors) enable_hard_errors=$2; shift;;
+ --enable-hard-errors) shift;; # No-op.
+ --merge) merge=yes;;
+ --no-merge) merge=no;;
+ --ignore-exit) ignore_exit=yes;;
+ --comments) comments=yes;;
+ --no-comments) comments=no;;
+ --diag-string) diag_string=$2; shift;;
--) shift; break;;
-*) usage_error "invalid option: '$1'";;
esac
shift
done
+test $# -gt 0 || usage_error "missing test command"
+
+case $expect_failure in
+ yes) expect_failure=1;;
+ *) expect_failure=0;;
+esac
+
if test $color_tests = yes; then
- # Keep this in sync with `lib/am/check.am:$(am__tty_colors)'.
red='[0;31m' # Red.
grn='[0;32m' # Green.
lgn='[1;32m' # Light green.
@@ -85,36 +106,11 @@ else
red= grn= lgn= blu= mgn= std=
fi
-do_exit='rm -f $log_file $trs_file; (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
-
-# Test script is run here.
-"$@" >$log_file 2>&1
-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 recheck=yes gcopy=yes;;
- 0:*) col=$grn res=PASS recheck=no gcopy=no;;
- 77:*) col=$blu res=SKIP recheck=no gcopy=yes;;
- 99:*) col=$mgn res=ERROR recheck=yes gcopy=yes;;
- *:yes) col=$lgn res=XFAIL recheck=no gcopy=yes;;
- *:*) col=$red res=FAIL recheck=yes gcopy=yes;;
-esac
-
-# Report outcome to console.
-echo "${col}${res}${std}: $test_name"
+# TODO: test script is run here.
+# "$@" | [our magic awk script]
-# Register the test result, and other relevant metadata.
-echo ":test-result: $res" > $trs_file
-echo ":global-test-result: $res" >> $trs_file
-echo ":recheck: $recheck" >> $trs_file
-echo ":copy-in-global-log: $gcopy" >> $trs_file
+echo "$0: still to be implemented, sorry" >&2
+exit 255
# Local Variables:
# mode: shell-script
diff --git a/lib/test-driver b/lib/test-driver
index 8522a49..b89107c 100755
--- a/lib/test-driver
+++ b/lib/test-driver
@@ -1,7 +1,7 @@
#! /bin/sh
# test-driver - basic driver script for the `parallel-tests' mode.
-scriptversion=2011-08-04.22; # UTC
+scriptversion=2011-08-17.14; # UTC
# Copyright (C) 2011 Free Software Foundation, Inc.
#
@@ -45,7 +45,7 @@ Usage:
test-driver --test-name=NAME --log-file=PATH --trs-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.
+The \`--test-name', \`--log-file' and \`--trs-file' options are mandatory.
END
}
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 59a6d14..853831d 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -17,7 +17,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
TEST_EXTENSIONS = .test .tap
-TAP_LOG_DRIVER = $(PERL) $(top_srcdir)/lib/tap-driver
+TAP_LOG_DRIVER = $(PERL) $(top_srcdir)/lib/tap-driver.pl
TAP_LOG_DRIVER_FLAGS = --merge
MAINTAINERCLEANFILES =
@@ -31,7 +31,6 @@ gcj6.test \
override-conditional-2.test \
pr8365-remake-timing.test \
yacc-dist-nobuild-subdir.test \
-tap-message-0.test \
txinfo5.test
@@ -1162,9 +1161,13 @@ tap-global-log.test \
tap-global-result.test \
tap-html.test \
tap-log.test \
+tap-msg0-result.test \
+tap-msg0-directive.test \
+tap-msg0-planskip.test \
+tap-msg0-bailout.test \
+tap-msg0-misc.test \
tap-merge-stdout-stderr.test \
tap-no-merge-stdout-stderr.test \
-tap-message-0.test \
tap-no-disable-hard-error.test \
tap-no-spurious-summary.test \
tap-no-spurious.test \
diff --git a/tests/Makefile.in b/tests/Makefile.in
index e294596..a1c152f 100644
--- a/tests/Makefile.in
+++ b/tests/Makefile.in
@@ -279,7 +279,7 @@ top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
TEST_EXTENSIONS = .test .tap
-TAP_LOG_DRIVER = $(PERL) $(top_srcdir)/lib/tap-driver
+TAP_LOG_DRIVER = $(PERL) $(top_srcdir)/lib/tap-driver.pl
TAP_LOG_DRIVER_FLAGS = --merge
MAINTAINERCLEANFILES = $(parallel_tests) $(instspc_tests)
EXTRA_DIST = ChangeLog-old gen-parallel-tests instspc-tests.sh \
@@ -288,7 +288,7 @@ EXTRA_DIST = ChangeLog-old gen-parallel-tests
instspc-tests.sh \
extract-testsuite-summary tap-setup.sh tap-summary-aux.sh
XFAIL_TESTS = all.test auxdir2.test cond17.test gcj6.test \
override-conditional-2.test pr8365-remake-timing.test \
- yacc-dist-nobuild-subdir.test tap-message-0.test txinfo5.test \
+ yacc-dist-nobuild-subdir.test txinfo5.test \
$(instspc_xfail_tests)
parallel_tests = backcompat5-p.test check-exported-srcdir-p.test \
check-fd-redirect-p.test check-tests-in-builddir-p.test \
@@ -1402,9 +1402,13 @@ tap-global-log.test \
tap-global-result.test \
tap-html.test \
tap-log.test \
+tap-msg0-result.test \
+tap-msg0-directive.test \
+tap-msg0-planskip.test \
+tap-msg0-bailout.test \
+tap-msg0-misc.test \
tap-merge-stdout-stderr.test \
tap-no-merge-stdout-stderr.test \
-tap-message-0.test \
tap-no-disable-hard-error.test \
tap-no-spurious-summary.test \
tap-no-spurious.test \
@@ -1417,6 +1421,7 @@ tap-plan.test \
tap-plan-corner.test \
tap-plan-errors.test \
tap-plan-middle.test \
+tap-missing-plan-and-bad-exit.test \
tap-planskip.test \
tap-planskip-late.test \
tap-planskip-and-logging.test \
diff --git a/tests/defs b/tests/defs
index afce3cb..4d21a49 100644
--- a/tests/defs
+++ b/tests/defs
@@ -306,6 +306,30 @@ unindent ()
}
sed_unindent_prog="" # Avoid interferences from the environment.
+# fetch_tap_driver
+# ----------------
+# Fetch the Automake-provided TAP driver from the `lib/' directory into
+# the current directory, and edit its shebang line so that it will be
+# run with the perl interpreter determined at configure time.
+fetch_tap_driver ()
+{
+ # TODO: we should devise a way to make the shell TAP driver tested also
+ # TODO: with /bin/sh, for better coverage.
+ case $am_tap_implementation in
+ perl)
+ sed "1s|#!.*|#! $PERL -w|" "$top_testsrcdir"/lib/tap-driver.pl ;;
+ shell)
+ sed "1s|#!.*|#! $SHELL|" "$top_testsrcdir"/lib/tap-driver.sh ;;
+ *)
+ fatal_ "invalid \$am_tap_implementation '$am_tap_implementation'" ;;
+ esac > tap-driver \
+ && chmod a+x tap-driver \
+ || framework_failure_ "couldn't fetch $am_tap_implementation TAP driver"
+ sed 10q tap-driver # For debugging.
+}
+# The shell/awk implementation of the TAP driver is still mostly dummy, so
+# use the perl implementation by default for the moment.
+am_tap_implementation=${am_tap_implementation-perl}
## ----------------------------------------------------------- ##
## Checks for required tools, and additional setups (if any) ##
diff --git a/tests/tap-bad-prog.tap b/tests/tap-bad-prog.tap
index 2dee975..c5d3733 100755
--- a/tests/tap-bad-prog.tap
+++ b/tests/tap-bad-prog.tap
@@ -21,16 +21,14 @@
parallel_tests=yes
. ./defs || Exit 1
-cp "$top_testsrcdir"/lib/tap-driver . \
- || fatal_ "failed to fetch auxiliary script tap-driver"
+fetch_tap_driver
cat >> configure.in <<END
-AC_SUBST([PERL], ['$PERL'])
AC_OUTPUT
END
cat > Makefile.am << 'END'
-TEST_LOG_DRIVER = $(PERL) $(srcdir)/tap-driver
+TEST_LOG_DRIVER = $(srcdir)/tap-driver
TESTS = none.test noread.test noexec.test
none.test:
END
diff --git a/tests/tap-basic.test b/tests/tap-basic.test
index 26a749d..dde65f2 100755
--- a/tests/tap-basic.test
+++ b/tests/tap-basic.test
@@ -27,16 +27,14 @@
parallel_tests=yes
. ./defs || Exit 1
-cp "$top_testsrcdir"/lib/tap-driver . \
- || fatal_ "failed to fetch auxiliary script tap-driver"
+fetch_tap_driver
cat >> configure.in <<END
-AC_SUBST([PERL], ['$PERL'])
AC_OUTPUT
END
cat > Makefile.am << 'END'
-TEST_LOG_DRIVER = $(PERL) $(srcdir)/tap-driver
+TEST_LOG_DRIVER = $(srcdir)/tap-driver
## Defining LOG_COMPILER should work and not intefere with the
## tap-driver script.
TEST_LOG_COMPILER = cat
@@ -145,7 +143,7 @@ test `$FGREP -c ': bail.test' stdout` -eq 1
$FGREP 'success.test' stdout && Exit 1
# Override TEST_LOGS from the command line, making it point to a test
-# (ok.test) that have to be generated at make time.
+# (ok.test) that has to be generated at make time.
rm -f *.log *.test
diff --git a/tests/tap-common-setup.test b/tests/tap-common-setup.test
index de8ff2c..92ae3c4 100755
--- a/tests/tap-common-setup.test
+++ b/tests/tap-common-setup.test
@@ -19,16 +19,12 @@
parallel_tests=yes
. ./defs || Exit 1
-cp "$top_testsrcdir"/lib/tap-driver . \
- || fatal_ "failed to fetch auxiliary script tap-driver"
-
cat >> configure.in << END
-AC_SUBST([PERL], ['$PERL'])
AC_OUTPUT
END
cat > Makefile.am << 'END'
-TEST_LOG_DRIVER = $(PERL) $(srcdir)/tap-driver
+TEST_LOG_DRIVER = $(srcdir)/tap-driver
TEST_LOG_COMPILER = cat
TESTS = all.test
END
diff --git a/tests/tap-diagnostic-custom.test b/tests/tap-diagnostic-custom.test
index d965229..88c859c 100755
--- a/tests/tap-diagnostic-custom.test
+++ b/tests/tap-diagnostic-custom.test
@@ -21,16 +21,14 @@
parallel_tests=yes
. ./defs || Exit 1
-cp "$top_testsrcdir"/lib/tap-driver . \
- || fatal_ "failed to fetch auxiliary script tap-driver"
+fetch_tap_driver
cat >> configure.in <<END
-AC_SUBST([PERL], ['$PERL'])
AC_OUTPUT
END
cat > Makefile.am << 'END'
-my_log_driver = $(PERL) $(srcdir)/tap-driver
+my_log_driver = $(srcdir)/tap-driver
my_log_compiler = cat
TEST_EXTENSIONS =
TESTS =
diff --git a/tests/tap-doc.test b/tests/tap-doc.test
index 2920d4e..8ccd30f 100755
--- a/tests/tap-doc.test
+++ b/tests/tap-doc.test
@@ -20,19 +20,17 @@
parallel_tests=yes
. ./defs || Exit 1
-cp "$top_testsrcdir"/lib/tap-driver . \
- || fatal_ "failed to fetch auxiliary script tap-driver"
+fetch_tap_driver
cat >> configure.in <<END
AC_PROG_CC
-AC_SUBST([PERL], ['$PERL'])
AC_OUTPUT
END
cat > Makefile.am << 'END'
TESTS = foo.sh zardoz.tap bar.sh mu.tap
TEST_EXTENSIONS = .sh .tap
-TAP_LOG_DRIVER = $(PERL) $(srcdir)/tap-driver
+TAP_LOG_DRIVER = $(srcdir)/tap-driver
END
cat > foo.sh <<'END'
diff --git a/tests/tap-doc2.test b/tests/tap-doc2.test
index 63bdc23..1c80294 100755
--- a/tests/tap-doc2.test
+++ b/tests/tap-doc2.test
@@ -27,7 +27,7 @@ test -f ../defs-static && test -f ../defs || Exit 99
rm -f *
cat > Makefile.am <<'END'
-TEST_LOG_DRIVER = $(PERL) $(srcdir)/build-aux/tap-driver
+TEST_LOG_DRIVER = $(PERL) $(srcdir)/build-aux/tap-driver.pl
TESTS = foo.test bar.test baz.test
EXTRA_DIST = $(TESTS)
END
@@ -37,7 +37,7 @@ AC_INIT([GNU Try Tap], [1.0], address@hidden)
AC_CONFIG_AUX_DIR([build-aux])
AM_INIT_AUTOMAKE([foreign parallel-tests -Wall -Werror])
AC_CONFIG_FILES([Makefile])
-AC_REQUIRE_AUX_FILE([tap-driver])
+AC_REQUIRE_AUX_FILE([tap-driver.pl])
AC_PATH_PROG([PERL], [perl])
test -n "$PERL" || AC_MSG_ERROR([perl not found])
$PERL -MTAP::Parser -e 1 || AC_MSG_ERROR([TAP::Parser not found])
@@ -74,7 +74,8 @@ END
chmod a+x *.test
mkdir build-aux
-cp "$top_testsrcdir"/lib/tap-driver build-aux
+cp "$top_testsrcdir"/lib/tap-driver.pl build-aux \
+ || framework_failure_ "fetching the perl TAP driver"
(export AUTOMAKE ACLOCAL AUTOCONF && $AUTORECONF -vi) || Exit 1
diff --git a/tests/tap-merge-stdout-stderr.test
b/tests/tap-merge-stdout-stderr.test
index 787ad51..4da9f38 100755
--- a/tests/tap-merge-stdout-stderr.test
+++ b/tests/tap-merge-stdout-stderr.test
@@ -21,8 +21,7 @@
parallel_tests=yes
. ./defs || Exit 1
-cp "$top_testsrcdir"/lib/tap-driver . \
- || fatal_ "failed to fetch auxiliary script tap-driver"
+fetch_tap_driver
cat > Makefile.am << 'END'
AM_TEST_LOG_DRIVER_FLAGS = --comments --merge
diff --git a/tests/tap-more.test b/tests/tap-more.test
index 7d0bf86..375aa00 100755
--- a/tests/tap-more.test
+++ b/tests/tap-more.test
@@ -27,17 +27,15 @@
parallel_tests=yes
. ./defs || Exit 1
-cp "$top_testsrcdir"/lib/tap-driver . \
- || fatal_ "failed to fetch auxiliary script tap-driver"
+fetch_tap_driver
cat >> configure.in <<END
-AC_SUBST([PERL], ['$PERL'])
AC_SUBST([AM_TEST_LOG_DRIVER_FLAGS], ['--comments'])
AC_OUTPUT
END
cat > Makefile.am << 'END'
-TEST_LOG_DRIVER = $(PERL) $(srcdir)/tap-driver
+TEST_LOG_DRIVER = $(srcdir)/tap-driver
TESTS = 1.test 2.test 3.test
EXTRA_DIST = $(TESTS) tap-driver
END
diff --git a/tests/tap-more2.test b/tests/tap-more2.test
index 810f9b8..f6f1ca1 100755
--- a/tests/tap-more2.test
+++ b/tests/tap-more2.test
@@ -23,19 +23,17 @@ required='cc native'
parallel_tests=yes
. ./defs || Exit 1
-cp "$top_testsrcdir"/lib/tap-driver . \
- || fatal_ "failed to fetch auxiliary script tap-driver"
+fetch_tap_driver
cat >> configure.in <<END
AC_PROG_CC
-AC_SUBST([PERL], ['$PERL'])
AC_OUTPUT
END
cat > Makefile.am << 'END'
TEST_EXTENSIONS = .sh .tap
-tap_driver = $(PERL) $(srcdir)/tap-driver
+tap_driver = $(srcdir)/tap-driver
LOG_DRIVER = $(tap_driver)
SH_LOG_DRIVER = $(tap_driver)
diff --git a/tests/tap-missing-plan-and-bad-exit.test
b/tests/tap-msg0-bailout.test
similarity index 67%
copy from tests/tap-missing-plan-and-bad-exit.test
copy to tests/tap-msg0-bailout.test
index 48c6fcc..6aa6d60 100755
--- a/tests/tap-missing-plan-and-bad-exit.test
+++ b/tests/tap-msg0-bailout.test
@@ -15,29 +15,24 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# TAP support:
-# - if a test script exits with non-zero status before printing the TAP
-# plan, then the driver reports both "missing plan" and "exited with
-# non-zero status" errors.
+# - literal strings "0" and "0.0" as a test description in the message
+# of a "plan with skip" TAP plan
+# generally true!
parallel_tests=yes
. ./defs || Exit 1
-cat > foo.test <<END
-#!/bin/sh
-exit 123
-END
-
-echo TESTS = foo.test > Makefile.am
-
-chmod a+x foo.test
-
. "$testsrcdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
-$MAKE check >stdout && { cat stdout; Exit 1; }
+echo 'Bail out! 0' > a.test
+echo 'Bail out! 0.0' > b.test
+
+TESTS='a.test b.test' $MAKE -e check >stdout && { cat stdout; Exit 1; }
cat stdout
+
count_test_results total=2 pass=0 fail=0 xpass=0 xfail=0 skip=0 error=2
-grep '^ERROR: foo\.test - exited with status 123$' stdout
-grep '^ERROR: foo\.test - missing test plan$' stdout
+grep '^ERROR: a.test - Bail out! 0$' stdout
+grep '^ERROR: b.test - Bail out! 0\.0$' stdout
:
diff --git a/tests/tap-not-ok-skip.test b/tests/tap-msg0-directive.test
similarity index 73%
copy from tests/tap-not-ok-skip.test
copy to tests/tap-msg0-directive.test
index f154d23..6ec63f7 100755
--- a/tests/tap-not-ok-skip.test
+++ b/tests/tap-msg0-directive.test
@@ -15,25 +15,27 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# TAP support:
-# - a "not ok # SKIP" line should count as a failure, for consistency
-# with the prove(1) utility.
+# - literal string "0" as a TODO or SKIP message
parallel_tests=yes
. ./defs || Exit 1
. "$testsrcdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
-cat > all.test <<'END'
-1..4
-not ok # SKIP
-not ok 2 # SKIP
-not ok - foo # SKIP
-not ok 4 - bar # SKIP
+cat > all.test << 'END'
+1..3
+ok 1 # TODO 0
+not ok 2 # TODO 0
+ok 3 # SKIP 0
END
$MAKE check >stdout && { cat stdout; Exit 1; }
cat stdout
-count_test_results total=4 pass=0 fail=4 skip=0 xpass=0 xfail=0 error=0
+count_test_results total=3 pass=0 fail=0 xpass=1 xfail=1 skip=1 error=0
+
+grep '^XPASS: all\.test 1 # TODO 0$' stdout
+grep '^XFAIL: all\.test 2 # TODO 0$' stdout
+grep '^SKIP: all\.test 3 # SKIP 0$' stdout
:
diff --git a/tests/tap-message-0.test b/tests/tap-msg0-misc.test
similarity index 51%
copy from tests/tap-message-0.test
copy to tests/tap-msg0-misc.test
index bce333f..c9399bf 100755
--- a/tests/tap-message-0.test
+++ b/tests/tap-msg0-misc.test
@@ -15,10 +15,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# TAP support:
-# - having "0" as a test description (or TODO or SKIP message) should
-# be supported
-# Note that a bug in some versions of TAP::Parser causes this not to be
-# generally true!
+# - literal "0" and "0.0" in a test description and a TODO/SKIP message
+# at the same time
parallel_tests=yes
. ./defs || Exit 1
@@ -26,35 +24,53 @@ parallel_tests=yes
. "$testsrcdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
cat > all.test << 'END'
-1..10
+1..14
+
ok 1 0
-ok - 0
-not ok 3 0 # TODO
-not ok - 0 # TODO
-ok 5 0 # SKIP
-ok - 0 # SKIP
-not ok 7 # TODO 0
-ok 8 # SKIP 0
-not ok 9 0 # TODO 0
-ok 10 0 # SKIP 0
+ok 2 0.0
+
+ok 3 0 # TODO 0
+ok 4 0.0 # TODO 0
+ok 5 0 # TODO 0.0
+ok 6 0.0 # TODO 0.0
+
+not ok 7 0 # TODO 0
+not ok 8 0.0 # TODO 0
+not ok 9 0 # TODO 0.0
+not ok 10 0.0 # TODO 0.0
+
+ok 11 0 # SKIP 0
+ok 12 0.0 # SKIP 0
+ok 13 0 # SKIP 0.0
+ok 14 0.0 # SKIP 0.0
+
END
-$MAKE check >stdout || { cat stdout; Exit 1; }
+$MAKE check >stdout && { cat stdout; Exit 1; }
cat stdout
-count_test_results total=10 pass=2 fail=0 xpass=0 xfail=4 skip=4 error=0
+count_test_results total=14 pass=2 fail=0 xpass=4 xfail=4 skip=4 error=0
+
+sed '/^ *$/d' > exp << 'END'
-cat > exp << 'END'
PASS: all.test 1 0
-PASS: all.test 2 - 0
-XFAIL: all.test 3 0 # TODO
-XFAIL: all.test 4 - 0 # TODO
-SKIP: all.test 5 0 # SKIP
-SKIP: all.test 6 - 0 # SKIP
-XFAIL: all.test 7 # TODO 0
-SKIP: all.test 8 # SKIP 0
-XFAIL: all.test 9 0 # TODO 0
-SKIP: all.test 10 0 # SKIP 0
+PASS: all.test 2 0.0
+
+XPASS: all.test 3 0 # TODO 0
+XPASS: all.test 4 0.0 # TODO 0
+XPASS: all.test 5 0 # TODO 0.0
+XPASS: all.test 6 0.0 # TODO 0.0
+
+XFAIL: all.test 7 0 # TODO 0
+XFAIL: all.test 8 0.0 # TODO 0
+XFAIL: all.test 9 0 # TODO 0.0
+XFAIL: all.test 10 0.0 # TODO 0.0
+
+SKIP: all.test 11 0 # SKIP 0
+SKIP: all.test 12 0.0 # SKIP 0
+SKIP: all.test 13 0 # SKIP 0.0
+SKIP: all.test 14 0.0 # SKIP 0.0
+
END
$FGREP ': all.test' stdout > got
diff --git a/tests/tap-escape-directive.test b/tests/tap-msg0-planskip.test
similarity index 68%
copy from tests/tap-escape-directive.test
copy to tests/tap-msg0-planskip.test
index 2f8cb73..b8c3d6c 100755
--- a/tests/tap-escape-directive.test
+++ b/tests/tap-msg0-planskip.test
@@ -15,31 +15,23 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# TAP support:
-# - "escape" TODO and SKIP directives (by escaping the "#" character)
+# - literal strings "0" and "0.0" as the reason of the skip in a "TAP
+# plan with skip" (i.e., "1..0 # SKIP ...").
parallel_tests=yes
. ./defs || Exit 1
. "$testsrcdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
-cat > all.test <<'END'
-1..2
-ok \# TODO
-ok \# SKIP
-END
+echo '1..0 # SKIP 0' > a.test
+echo '1..0 # SKIP 0.0' > b.test
-$ACLOCAL
-$AUTOCONF
-$AUTOMAKE
-
-./configure
-
-$MAKE check >stdout || { cat stdout; Exit 1; }
+TESTS='a.test b.test' $MAKE -e check >stdout || { cat stdout; Exit 1; }
cat stdout
-count_test_results total=2 pass=2 fail=0 xpass=0 xfail=0 skip=0 error=0
+count_test_results total=2 pass=0 fail=0 xpass=0 xfail=0 skip=2 error=0
-grep '^PASS: all\.test 1 .*TODO' stdout
-grep '^PASS: all\.test 2 .*SKIP' stdout
+grep '^SKIP: a.test - 0$' stdout
+grep '^SKIP: b.test - 0\.0$' stdout
:
diff --git a/tests/tap-message-0.test b/tests/tap-msg0-result.test
similarity index 62%
rename from tests/tap-message-0.test
rename to tests/tap-msg0-result.test
index bce333f..86259e5 100755
--- a/tests/tap-message-0.test
+++ b/tests/tap-msg0-result.test
@@ -15,10 +15,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# TAP support:
-# - having "0" as a test description (or TODO or SKIP message) should
-# be supported
-# Note that a bug in some versions of TAP::Parser causes this not to be
-# generally true!
+# - the string "0" as a test description
parallel_tests=yes
. ./defs || Exit 1
@@ -29,32 +26,32 @@ cat > all.test << 'END'
1..10
ok 1 0
ok - 0
-not ok 3 0 # TODO
+not ok 3 0
+not ok - 0
+ok 5 0 # TODO
+ok - 0 # TODO
+not ok 7 0 # TODO
not ok - 0 # TODO
-ok 5 0 # SKIP
+ok 9 0 # SKIP
ok - 0 # SKIP
-not ok 7 # TODO 0
-ok 8 # SKIP 0
-not ok 9 0 # TODO 0
-ok 10 0 # SKIP 0
END
-$MAKE check >stdout || { cat stdout; Exit 1; }
+$MAKE check >stdout && { cat stdout; Exit 1; }
cat stdout
-count_test_results total=10 pass=2 fail=0 xpass=0 xfail=4 skip=4 error=0
+count_test_results total=10 pass=2 fail=2 xpass=2 xfail=2 skip=2 error=0
cat > exp << 'END'
PASS: all.test 1 0
PASS: all.test 2 - 0
-XFAIL: all.test 3 0 # TODO
-XFAIL: all.test 4 - 0 # TODO
-SKIP: all.test 5 0 # SKIP
-SKIP: all.test 6 - 0 # SKIP
-XFAIL: all.test 7 # TODO 0
-SKIP: all.test 8 # SKIP 0
-XFAIL: all.test 9 0 # TODO 0
-SKIP: all.test 10 0 # SKIP 0
+FAIL: all.test 3 0
+FAIL: all.test 4 - 0
+XPASS: all.test 5 0 # TODO
+XPASS: all.test 6 - 0 # TODO
+XFAIL: all.test 7 0 # TODO
+XFAIL: all.test 8 - 0 # TODO
+SKIP: all.test 9 0 # SKIP
+SKIP: all.test 10 - 0 # SKIP
END
$FGREP ': all.test' stdout > got
diff --git a/tests/tap-recheck.test b/tests/tap-recheck.test
index 14b02ad..0139b07 100755
--- a/tests/tap-recheck.test
+++ b/tests/tap-recheck.test
@@ -20,16 +20,14 @@
parallel_tests=yes
. ./defs || Exit 1
-cp "$top_testsrcdir"/lib/tap-driver . \
- || fatal_ "failed to fetch auxiliary script tap-driver"
+fetch_tap_driver
cat >> configure.in <<END
-AC_SUBST([PERL], ['$PERL'])
AC_OUTPUT
END
cat > Makefile.am << 'END'
-TEST_LOG_DRIVER = $(PERL) $(srcdir)/tap-driver
+TEST_LOG_DRIVER = $(srcdir)/tap-driver
TESTS = a.test b.test c.test d.test
END
diff --git a/tests/tap-setup.sh b/tests/tap-setup.sh
index 0d1a1e3..00397e0 100755
--- a/tests/tap-setup.sh
+++ b/tests/tap-setup.sh
@@ -31,8 +31,7 @@ test ! -f Makefile.am || mv Makefile.am Makefile.am~ \
test -d ../tap-common-setup.dir && cp -Rp ../tap-common-setup.dir/* . \
|| fatal_ "couldn't get precomputed data files"
-cp "$top_testsrcdir"/lib/tap-driver . \
- || fatal_ "failed to fetch auxiliary script tap-driver"
+fetch_tap_driver
if test -f Makefile.am~; then
mv -f Makefile.am~ Makefile.am \
diff --git a/tests/tap-summary-aux.sh b/tests/tap-summary-aux.sh
index a5cad53..7def11d 100755
--- a/tests/tap-summary-aux.sh
+++ b/tests/tap-summary-aux.sh
@@ -26,19 +26,17 @@ case $use_colors in
*) fatal_ "invalid \$use_colors value '$use_colors'"
esac
-cp "$top_testsrcdir"/lib/tap-driver . \
- || fatal_ "failed to fetch auxiliary script tap-driver"
+fetch_tap_driver
cat > configure.in <<END
AC_INIT([GNU AutoTAP], [5.12], address@hidden)
AM_INIT_AUTOMAKE([parallel-tests])
-AC_SUBST([PERL], ['$PERL'])
AC_CONFIG_FILES([Makefile])
AC_OUTPUT
END
cat > Makefile.am << 'END'
-TEST_LOG_DRIVER = $(PERL) $(srcdir)/tap-driver
+TEST_LOG_DRIVER = $(srcdir)/tap-driver
TEST_LOG_COMPILER = cat
TESTS = all.test
END
hooks/post-receive
--
GNU Automake
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Automake-commit] [SCM] GNU Automake branch, test-protocols, updated. v1.11-1027-gc8b66be,
Stefano Lattarini <=