* tests/tap-skip-whole.test: Rename ...
* tests/tap-planskip.test: ... to this
* tests/tap-skip-whole-badexit.test: Rename ...
* tests/tap-planskip-badexit.test: ... to this.
* tests/tap-skip-whole-bailout.test: Rename ...
* tests/tap-planskip-bailout.test: ... to this.
* tests/tap-skip-whole-bailout.test: Rename ...
* tests/tap-planskip-later-errors.test: ... to this.
* tests/tap-skip-whole-unplanned.test: Rename ...
* tests/tap-planskip-unplanned.test: ... to this.
* tests/tap-skip-whole-whitespace.test: Rename ...
* tests/tap-planskip-whitespace.test: ... to this.
* tests/tap-skip-whole-continue.test: Rename ...
* tests/tap-planskip-and-logging.test: ... to this, extend to try
more cases, and fix heading comments.
* tests/tap-skip-whole-lastline.test: Rename ...
* tests/tap-planskip-late.test: ... to this, fix heading comments,
and remove some checks that are just a duplication of those already
performed in the previous script.
* tests/tap-results-with-planskip.test: Rename to ...
* tests/tap-planskip-unplanned-corner.test: ... this, and improve
hading comments.
* tests/tap-planskip-later-errors.test: New test.
* tests/Makefile.am (tap_with_common_setup_tests): Update.
+2011-08-12 Stefano Lattarini <stefano.lattarini@gmail.com>
+
+ testsuite: reorganize tests on TAP plans
+ * tests/tap-skip-whole.test: Rename ...
+ * tests/tap-planskip.test: ... to this
+ * tests/tap-skip-whole-badexit.test: Rename ...
+ * tests/tap-planskip-badexit.test: ... to this.
+ * tests/tap-skip-whole-bailout.test: Rename ...
+ * tests/tap-planskip-bailout.test: ... to this.
+ * tests/tap-skip-whole-bailout.test: Rename ...
+ * tests/tap-planskip-later-errors.test: ... to this.
+ * tests/tap-skip-whole-unplanned.test: Rename ...
+ * tests/tap-planskip-unplanned.test: ... to this.
+ * tests/tap-skip-whole-whitespace.test: Rename ...
+ * tests/tap-planskip-whitespace.test: ... to this.
+ * tests/tap-skip-whole-continue.test: Rename ...
+ * tests/tap-planskip-and-logging.test: ... to this, extend to try
+ more cases, and fix heading comments.
+ * tests/tap-skip-whole-lastline.test: Rename ...
+ * tests/tap-planskip-late.test: ... to this, fix heading comments,
+ and remove some checks that are just a duplication of those already
+ performed in the previous script.
+ * tests/tap-results-with-planskip.test: Rename to ...
+ * tests/tap-planskip-unplanned-corner.test: ... this, and improve
+ hading comments.
+ * tests/tap-planskip-later-errors.test: New test.
+ * tests/Makefile.am (tap_with_common_setup_tests): Update.
+
2011-08-12 Stefano Lattarini <stefano.lattarini@gmail.com>
coverage: more TAP driver consistency w.r.t. 'prove'
tap-plan-corner.test \
tap-plan-errors.test \
tap-plan-middle.test \
+tap-planskip.test \
+tap-planskip-late.test \
+tap-planskip-and-logging.test \
+tap-planskip-unplanned.test \
+tap-planskip-unplanned-corner.test \
+tap-planskip-whitespace.test \
+tap-planskip-badexit.test \
+tap-planskip-bailout.test \
+tap-planskip-later-errors.test \
tap-realtime.test \
tap-recheck-logs.test \
-tap-skip-whole-whitespace.test \
-tap-skip-whole.test \
-tap-skip-whole-lastline.test \
-tap-skip-whole-badexit.test \
-tap-skip-whole-bailout.test \
-tap-skip-whole-continue.test \
-tap-skip-whole-unplanned.test \
-tap-results-with-planskip.test \
tap-todo-skip-together.test \
tap-todo-skip-whitespace.test \
tap-todo-skip.test \
tap-plan-corner.test \
tap-plan-errors.test \
tap-plan-middle.test \
+tap-planskip.test \
+tap-planskip-late.test \
+tap-planskip-and-logging.test \
+tap-planskip-unplanned.test \
+tap-planskip-unplanned-corner.test \
+tap-planskip-whitespace.test \
+tap-planskip-badexit.test \
+tap-planskip-bailout.test \
+tap-planskip-later-errors.test \
tap-realtime.test \
tap-recheck-logs.test \
-tap-skip-whole-whitespace.test \
-tap-skip-whole.test \
-tap-skip-whole-lastline.test \
-tap-skip-whole-badexit.test \
-tap-skip-whole-bailout.test \
-tap-skip-whole-continue.test \
-tap-skip-whole-unplanned.test \
-tap-results-with-planskip.test \
tap-todo-skip-together.test \
tap-todo-skip-whitespace.test \
tap-todo-skip.test \
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-# Basic TAP test protocol support:
-# - parsing of input TAP stream continue after a "SKIP" plan has
-# been seen.
+# TAP support:
+# - interactions between "TAP plan with SKIP" and logging of earlier or
+# later TAP or non-TAP text
parallel_tests=yes
. ./defs || Exit 1
# a comment
END
+cat > foo2.test <<END
+a non-TAP line 2
+# a comment 2
+1..0
+END
+
cat > bar.test <<END
# an early comment
an early non-TAP line
a later non-TAP line
END
-TESTS='foo.test bar.test' $MAKE -e check >stdout || { cat stdout; Exit 1; }
+TESTS='foo.test foo2.test bar.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=2 error=0
+count_test_results total=3 pass=0 fail=0 xpass=0 xfail=0 skip=3 error=0
grep '^# foo\.test: a comment$' stdout
+grep '^# foo2\.test: a comment 2$' stdout
grep '^# bar\.test: an early comment$' stdout
grep '^# bar\.test: a later comment$' stdout
cat foo.log
+cat foo2.log
cat bar.log
grep '^a non-TAP line$' foo.log
grep '^# a comment$' foo.log
+grep '^a non-TAP line 2$' foo2.log
+grep '^# a comment 2$' foo2.log
grep '^# an early comment' bar.log
grep '^an early non-TAP line$' bar.log
grep '^# a later comment' bar.log
# 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.
+# - the special "plan with SKIP" can also be used "late" in the TAP
+# stream, i.e., preceded by non-TAP output or TAP diagnostic.
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
1..0
END
-st=0
-TESTS='foo.test bar.test' $MAKE -e check >stdout || st=$?
+TESTS='foo.test bar.test' $MAKE -e check >stdout || { cat stdout; Exit 1; }
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 '^# bar\.test: some TAP diagnostic, will go to console$' stdout
-grep '^# some TAP diagnostic, will go to console$' test-suite.log
-grep '^some non-TAP text, will be copied in the global log$' test-suite.log
test `grep -c ': .*\.test' stdout` -eq 2
count_test_results total=2 pass=0 fail=0 xpass=0 xfail=0 skip=2 error=0
--- /dev/null
+#! /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:
+# - TAP errors following a "TAP plan with SKIP" are still diagnosed.
+
+parallel_tests=yes
+. ./defs || Exit 1
+
+. "$testsrcdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+
+cat > all.test <<END
+1..0
+a non-TAP line
+1..3
+1..5
+# a comment
+1..1
+END
+
+$MAKE check >stdout && { cat stdout; Exit 1; }
+cat stdout
+
+count_test_results total=4 pass=0 fail=0 xpass=0 xfail=0 skip=1 error=3
+test `grep -c '^ERROR: all\.test - multiple test plans' stdout` -eq 3
+
+:
# TAP support:
# - test results seen in a TAP stream that has a "plan with SKIP" are
-# flagged as errors.
+# flagged as errors, even if all of them are "SKIP" results.
parallel_tests=yes
. ./defs || Exit 1