]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
tap: check that also a trailing TAP plan can hold a skip directive
authorStefano Lattarini <stefano.lattarini@gmail.com>
Wed, 3 Aug 2011 18:22:50 +0000 (20:22 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Wed, 3 Aug 2011 18:23:22 +0000 (20:23 +0200)
* tests/tap-skip-whole-lastline.test: New test.
* tests/Makefile.am (tap_with_common_setup_tests): Add it.

ChangeLog
tests/Makefile.am
tests/Makefile.in
tests/tap-skip-whole-lastline.test [new file with mode: 0755]

index 2d51a28f7b69663a074c199220cd429df47ad6b4..bcaa907e01b685df87835435be1db2ceec60bd15 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2011-08-03  Stefano Lattarini  <stefano.lattarini@gmail.com>
+
+       tap: check that also a trailing TAP plan can hold a skip directive
+       * tests/tap-skip-whole-lastline.test: New test.
+       * tests/Makefile.am (tap_with_common_setup_tests): Add it.
+
 2011-08-03  Stefano Lattarini  <stefano.lattarini@gmail.com>
 
        maintcheck: fix more maintainer-check failures
index b9b75ff73fa2b5b52a8441881b58fd1f711322cb..3415310f010459243049463d825524a876bc74e3 100644 (file)
@@ -1175,6 +1175,7 @@ tap-realtime.test \
 tap-recheck-logs.test \
 tap-skip-whole-whitespace.test \
 tap-skip-whole.test \
+tap-skip-whole-lastline.test \
 tap-todo-skip-together.test \
 tap-todo-skip-whitespace.test \
 tap-todo-skip.test \
index b030585c8c881fbb55d0570af7dfd6439d76f931..035c8c76d30071aaa79cefc09e13ade63738b856 100644 (file)
@@ -1411,6 +1411,7 @@ tap-realtime.test \
 tap-recheck-logs.test \
 tap-skip-whole-whitespace.test \
 tap-skip-whole.test \
+tap-skip-whole-lastline.test \
 tap-todo-skip-together.test \
 tap-todo-skip-whitespace.test \
 tap-todo-skip.test \
diff --git a/tests/tap-skip-whole-lastline.test b/tests/tap-skip-whole-lastline.test
new file mode 100755 (executable)
index 0000000..25697e0
--- /dev/null
@@ -0,0 +1,59 @@
+#! /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:
+#  - the special plan format to skip all the tests in a script can also
+#    be used on the last line, even if preceded by non-TAP output, TAP
+#    diagnostic, and even non-failing TAP test results.
+
+parallel_tests=yes
+. ./defs || Exit 1
+
+. "$testsrcdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+
+echo AM_TEST_LOG_DRIVER_FLAGS = --comments >> Makefile
+
+cat > foo.test <<END
+some non-TAP text, will be copied in the global log
+1..0 # SKIP from the last line
+END
+
+cat > bar.test <<END
+# some TAP diagnostic, will go to console
+1..0
+END
+
+cat > baz.test <<END
+ok 1 - seen also if the whole test is skipped!
+1..0 # SKIP
+END
+
+st=0
+TESTS='foo.test bar.test baz.test' $MAKE -e check >stdout || st=$?
+cat stdout
+cat test-suite.log
+test $st -eq 0
+
+grep '^SKIP: foo\.test .* from the last line$' stdout
+grep '^SKIP: bar\.test$' stdout
+grep '^SKIP: baz\.test$' stdout
+grep '^# bar\.test: some TAP diagnostic, will go to console$' stdout
+grep '^some non-TAP text, will be copied in the global log$' test-suite.log
+grep '^PASS: baz\.test 1 - seen also if the whole test is skipped!$' stdout
+test `grep -c ': .*\.test' stdout` -eq 4
+count_test_results total=4 pass=1 fail=0 xpass=0 xfail=0 skip=3 error=0
+
+: