]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
testsuite: improve interface for giving early TAP plan
authorStefano Lattarini <stefano.lattarini@gmail.com>
Mon, 8 Aug 2011 13:43:53 +0000 (15:43 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Mon, 8 Aug 2011 13:43:53 +0000 (15:43 +0200)
Since commit `v1.11-976-g4740f56', an early TAP plan can also be
specified after input lines have already been seen, as long as
no one of them is a TAP result line.  We can now take advantage
of this in our own testsuite, allowing the TAP-based scripts to
specify their earlier plan after having included `./defs'.  In
particular, this offers the benefit of allowing those scripts to
issue a "skip all" plan (e.g., "1..0 # SKIP reason ...") after
the inclusion of `./defs', which wasn't possible with the older
interface (introduced in commit `v1.11-1114-g0286308').

* tests/defs: Don't try to call `plan_' if `$planned' is defined,
the calling scripts can do that directly now.
* tests/ac-output-old.tap: Use `plan_' directly instead of
setting `$planned' before including `./defs'.
* tests/automake-cmdline.tap: Likewise.
* tests/depmod.tap: Likewise.
* tests/instspc.tap: Likewise.
* tests/tap-bad-prog.tap: Likewise.
* tests/add-missing.tap: Don't set `$planned'.

ChangeLog
tests/ac-output-old.tap
tests/add-missing.tap
tests/automake-cmdline.tap
tests/defs
tests/depmod.tap
tests/instspc.tap
tests/tap-bad-prog.tap

index ad1d3f5b450a14a73cc405f2d70df43dd5ae1e7a..b3e9573b069bfe542c77c14df468b2f7479a029c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,25 @@
+2011-08-08  Stefano Lattarini  <stefano.lattarini@gmail.com>
+
+       testsuite: improve interface for giving early TAP plan
+       Since commit `v1.11-976-g4740f56', an early TAP plan can also be
+       specified after input lines have already been seen, as long as
+       no one of them is a TAP result line.  We can now take advantage
+       of this in our own testsuite, allowing the TAP-based scripts to
+       specify their earlier plan after having included `./defs'.  In
+       particular, this offers the benefit of allowing those scripts to
+       issue a "skip all" plan (e.g., "1..0 # SKIP reason ...") after
+       the inclusion of `./defs', which wasn't possible with the older
+       interface (introduced in commit `v1.11-1114-g0286308').
+       * tests/defs: Don't try to call `plan_' if `$planned' is defined,
+       the calling scripts can do that directly now.
+       * tests/ac-output-old.tap: Use `plan_' directly instead of
+       setting `$planned' before including `./defs'.
+       * tests/automake-cmdline.tap: Likewise.
+       * tests/depmod.tap: Likewise.
+       * tests/instspc.tap: Likewise.
+       * tests/tap-bad-prog.tap: Likewise.
+       * tests/add-missing.tap: Don't set `$planned'.
+
 2011-08-08  Stefano Lattarini  <stefano.lattarini@gmail.com>
 
        test defs: fix bug in TAP version of `skip_all_'
index 201e5177b812db047961e7117a65c2bd2f40a9df..ee2d15035286509e48058da5bdd7a022b3e31a57 100755 (executable)
 # line breaking in the use of AC_OUTPUT.  Synthesised by a bunch
 # of older tests (referenced below).
 
-planned=22
 . ./defs || Exit 1
 
+plan_ 22
+
 rm -f configure.in depcomp # Not required.
 
 # -----------------------------------------------------------------------
index cbf6e573d0fee7efddee33f116cab1c00c5afdb4..4c6a6248c3680040cc35c74ad9f1397fca84c07a 100755 (executable)
@@ -19,7 +19,6 @@
 # the files) it's supposed to, and that these files are symlinked by
 # default, but copied if the `--copy' option is used.
 
-planned=unknown # Counting it would be too much data-dependent.
 . ./defs || Exit 1
 
 build_aux=build-aux
index 1c53a6d622b247dec00148726f97208763cf7905..9397900c60a1963887ee8b56452e8005532a6985 100755 (executable)
 
 # Test Automake's command-line options.
 
-planned=17
 . ./defs || Exit 1
 
+plan_ 17
+
 # Usage: bad_cmdline DESCRIPTION REGEX-FOR-STDERR [ARGS-FOR-AUTOMAKE...]
 do_check ()
 {
index d3ae1dd800e447d8a2eb6b2d253465bb842fa289..8db108437830842ec26639b142ec66387e6c3964 100644 (file)
@@ -445,11 +445,6 @@ xsi_shell_code='
 ##  required by them.                                          ##
 ## ----------------------------------------------------------- ##
 
-# The TAP plan must be either the fist or last line of output.
-if test $using_tap = yes && test ${planned-unknown} != unknown; then
-  plan_ "$planned"
-fi
-
 # Print it here, so that the user will see it also if the test
 # will be skipped due to some tool missing in $PATH itself.
 echo "$PATH"
index 85bd9720b374bd7a0adfbe0c21e72938ca58fbbf..82fd844698bab13afe9d25ea6ec065bc0ba04e84 100755 (executable)
 # which caused make to die with an error like:
 #  "sub/.deps/subfoo.Po:3: *** missing separator.  Stop."
 
+required=cc
+. ./defs || Exit 99
+
 # Per each valid depmode three kinds of VPATH, and per each of them
 # a test on "./configure" and one on "make & remake"; so there are
 # 17 * 3 * 2 = 102.
-planned=102
-required=cc
-. ./defs || Exit 99
+plan_ 102
 
 ocwd=`pwd` || fatal_ "cannot get current working directory"
 
index f421fc793c5b72aeffdddf3ae62b4964f00df092..dc52299011be9138e43a217eca9878b28eb56676 100755 (executable)
 # Original report from James Amundson about file names with spaces.
 # Other characters added by Paul Eggert.
 
-planned=94 # Two tests per "problematic string".
 . ./defs || Exit 99
 
+plan_ 94 # Two tests per "problematic string".
+
 # Usage: is_in_list ITEM [LIST...]
 is_in_list ()
 {
index 086b38e3443fa2664e30d01577c223ca7cae87c4..cf475a198e5f1514a8b65f50087b58ae8ccbd539 100755 (executable)
 #  - missing, unreadable, or not-executable test scripts cause proper
 #    error reports
 
-planned=5
 parallel_tests=yes
 . ./defs || Exit 1
 
+plan_ 5
+
 cp "$top_testsrcdir"/lib/tap-driver . \
   || fatal_ "failed to fetch auxiliary script tap-driver"