From a5b9cae78ce16229fd1cdc7459b08be60bdd6c72 Mon Sep 17 00:00:00 2001 From: Stefano Lattarini Date: Thu, 25 Aug 2011 12:55:55 +0200 Subject: [PATCH] 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. --- ChangeLog | 9 +++++++ tests/Makefile.am | 1 + tests/Makefile.in | 1 + tests/tap-escape-directive-2.test | 55 +++++++++++++++++++++++++++++++++++++++ tests/tap-escape-directive.test | 4 +-- 5 files changed, 68 insertions(+), 2 deletions(-) create mode 100755 tests/tap-escape-directive-2.test diff --git a/ChangeLog b/ChangeLog index b30a1c8..7177583 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,14 @@ 2011-08-25 Stefano Lattarini + 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 + 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 diff --git a/tests/Makefile.am b/tests/Makefile.am index 300bd26..bf0e07d 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -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 \ diff --git a/tests/Makefile.in b/tests/Makefile.in index 720771a..b888c3b 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -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 index 0000000..e0dd37b --- /dev/null +++ b/tests/tap-escape-directive-2.test @@ -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 . + +# 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 + +: diff --git a/tests/tap-escape-directive.test b/tests/tap-escape-directive.test index dc03197..194db6a 100755 --- a/tests/tap-escape-directive.test +++ b/tests/tap-escape-directive.test @@ -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 : -- 2.7.4