coverage: more about escaping of TAP directives
authorStefano Lattarini <stefano.lattarini@gmail.com>
Thu, 25 Aug 2011 10:55:55 +0000 (12:55 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Thu, 25 Aug 2011 11:56:14 +0000 (13:56 +0200)
* tests/tap-escape-directive.test: Make grepping of testsuite
progress output slightly stricter.
* tests/tap-escape-directive-2.test: New test (failing with the
awk implementation of the TAP driver).
* tests/Makefile.am (tap_with_common_setup_tests): Update.

ChangeLog
tests/Makefile.am
tests/Makefile.in
tests/tap-escape-directive-2.test [new file with mode: 0755]
tests/tap-escape-directive.test

index b30a1c8..7177583 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 2011-08-25  Stefano Lattarini  <stefano.lattarini@gmail.com>
 
+       coverage: more about escaping of TAP directives
+       * tests/tap-escape-directive.test: Make grepping of testsuite
+       progress output slightly stricter.
+       * tests/tap-escape-directive-2.test: New test (failing with the
+       awk implementation of the TAP driver).
+       * tests/Makefile.am (tap_with_common_setup_tests): Update.
+
+2011-08-25  Stefano Lattarini  <stefano.lattarini@gmail.com>
+
        tap: improve syncing between awk+shell and perl implementations
        * lib/tap-driver.pl (stringify_test_result): Renamed ...
        (stringify_result_obj): ... to this.  Break up a clause in the
index 300bd26..bf0e07d 100644 (file)
@@ -1155,6 +1155,7 @@ tap-diagnostic.test \
 tap-empty-diagnostic.test \
 tap-empty.test \
 tap-escape-directive.test \
+tap-escape-directive-2.test \
 tap-exit.test \
 tap-signal.test \
 tap-fancy.test \
index 720771a..b888c3b 100644 (file)
@@ -1396,6 +1396,7 @@ tap-diagnostic.test \
 tap-empty-diagnostic.test \
 tap-empty.test \
 tap-escape-directive.test \
+tap-escape-directive-2.test \
 tap-exit.test \
 tap-signal.test \
 tap-fancy.test \
diff --git a/tests/tap-escape-directive-2.test b/tests/tap-escape-directive-2.test
new file mode 100755 (executable)
index 0000000..e0dd37b
--- /dev/null
@@ -0,0 +1,55 @@
+#! /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:
+#  - "escape" TODO and SKIP directives (by escaping the "#" character)
+
+parallel_tests=yes
+. ./defs || Exit 1
+
+. "$testsrcdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+
+cat > all.test <<'END'
+1..8
+
+not ok \ # TODO
+ok \ # SKIP
+
+not ok \\# TODO
+ok \\# SKIP
+
+ok \\\# TODO
+ok \\\# SKIP
+
+not ok \\\\\\\\\\# TODO
+ok     \\\\\\\\\\# SKIP
+END
+
+$MAKE check >stdout || { cat stdout; Exit 1; }
+cat stdout
+
+count_test_results total=8 pass=2 fail=0 xpass=0 xfail=3 skip=3 error=0
+
+grep '^XFAIL: all\.test 1 .*# TODO' stdout
+grep '^SKIP: all\.test 2 .*# SKIP' stdout
+grep '^XFAIL: all\.test 3 .*# TODO' stdout
+grep '^SKIP: all\.test 4 .*# SKIP' stdout
+grep '^PASS: all\.test 5 .*# TODO' stdout
+grep '^PASS: all\.test 6 .*# SKIP' stdout
+grep '^XFAIL: all\.test 7 .*# TODO' stdout
+grep '^SKIP: all\.test 8 .*# SKIP' stdout
+
+:
index dc03197..194db6a 100755 (executable)
@@ -33,7 +33,7 @@ cat stdout
 
 count_test_results total=2 pass=2 fail=0 xpass=0 xfail=0 skip=0 error=0
 
-grep '^PASS: all\.test 1 .*TODO' stdout
-grep '^PASS: all\.test 2 .*SKIP' stdout
+grep '^PASS: all\.test 1 .*TODO' stdout
+grep '^PASS: all\.test 2 .*SKIP' stdout
 
 :