]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
coverage: a TAP result numbered "0" is always out-of-order
authorStefano Lattarini <stefano.lattarini@gmail.com>
Sat, 20 Aug 2011 15:32:29 +0000 (17:32 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Sat, 20 Aug 2011 15:38:39 +0000 (17:38 +0200)
* tests/tap-test-number-0.test: New, checks that a test result
numbered as 0 is to be considered out-of-order; this is
consistent with the behaviour of the `prove' utility.
* tests/Makefile.am (tap_with_common_setup_tests): Update.

ChangeLog
tests/Makefile.am
tests/Makefile.in
tests/tap-test-number-0.test [new file with mode: 0755]

index c64cf6e0a50c531f6832fa9ba13c1956c6596aa8..ec8aa4fa7ca82edca49d4326f7ce4d581f1e5216 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2011-08-20  Stefano Lattarini  <stefano.lattarini@gmail.com>
+
+       coverage: a TAP result numbered "0" is always out-of-order
+       * tests/tap-test-number-0.test: New, checks that a test result
+       numbered as 0 is to be considered out-of-order; this is
+       consistent with the behaviour of the `prove' utility.
+       * tests/Makefile.am (tap_with_common_setup_tests): Update.
+
 2011-08-20  Stefano Lattarini  <stefano.lattarini@gmail.com>
 
        cosmetics: fix botched indentation in perl TAP driver
index e7f8570d4825cfa61b4341091421edc7505636a4..bb79b323a9581d405afc230281df8410702df210 100644 (file)
@@ -1198,6 +1198,7 @@ tap-planskip-badexit.test \
 tap-planskip-bailout.test \
 tap-planskip-later-errors.test \
 tap-realtime.test \
+tap-test-number-0.test \
 tap-recheck-logs.test \
 tap-todo-skip-together.test \
 tap-todo-skip-whitespace.test \
index c6ca93968b6f22b3bc63f237b46c93a8d0e66d1b..f292472c6d895efd30ec3c34d59e469e61341b22 100644 (file)
@@ -1439,6 +1439,7 @@ tap-planskip-badexit.test \
 tap-planskip-bailout.test \
 tap-planskip-later-errors.test \
 tap-realtime.test \
+tap-test-number-0.test \
 tap-recheck-logs.test \
 tap-todo-skip-together.test \
 tap-todo-skip-whitespace.test \
diff --git a/tests/tap-test-number-0.test b/tests/tap-test-number-0.test
new file mode 100755 (executable)
index 0000000..abce60e
--- /dev/null
@@ -0,0 +1,63 @@
+#! /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 result numbered as 0 is to be considered out-of-order
+# This is consistent with the behaviour of the `prove' utility.
+
+parallel_tests=yes
+. ./defs || Exit 1
+
+. "$testsrcdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+
+cat > a.test <<END
+1..1
+ok 0
+END
+
+cat > b.test <<END
+1..1
+not ok 0
+END
+
+cat > c.test <<END
+1..1
+ok 0 foo # SKIP
+END
+
+cat > d.test <<END
+1..1
+not ok 0 bar # TODO
+END
+
+cat > e.test <<END
+1..1
+ok 0 # TODO
+END
+
+TESTS='a.test b.test c.test d.test e.test' $MAKE -e check >stdout \
+  && { cat stdout; Exit 1; }
+cat stdout
+
+count_test_results total=5 pass=0 fail=0 xpass=0 xfail=0 skip=0 error=5
+
+grep '^ERROR: a\.test 0 # OUT-OF-ORDER (expecting 1)$' stdout
+grep '^ERROR: b\.test 0 # OUT-OF-ORDER (expecting 1)$' stdout
+grep '^ERROR: c\.test 0 foo # OUT-OF-ORDER (expecting 1)$' stdout
+grep '^ERROR: d\.test 0 bar # OUT-OF-ORDER (expecting 1)$' stdout
+grep '^ERROR: e\.test 0 # OUT-OF-ORDER (expecting 1)$' stdout
+
+: