automake-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[FYI] {test-protocols} tap/awk: correctly extract message from SKIP plan


From: Stefano Lattarini
Subject: [FYI] {test-protocols} tap/awk: correctly extract message from SKIP plans
Date: Sun, 21 Aug 2011 23:52:33 +0200

* lib/tap-driver.sh (/^1\.\.0+[ \t]*#/): Add a forgotten `?' to
the regex used to extract the skip message from a "1..0" TAP plan.
* tests/planskip.test: Check for the just-fixed bug.
* tests/tap-planskip-unplanned-corner.test: Don't be too strict
w.r.t. the formatting of the "skip whole test" message, to avoid
failing due to bugs irrelevant for this test (like the one just
fixed).
---
 ChangeLog                                |   11 +++++++++++
 lib/tap-driver.sh                        |    4 ++--
 tests/tap-planskip-unplanned-corner.test |    3 ++-
 tests/tap-planskip.test                  |    4 ++++
 4 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 80889c9..738e10f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,16 @@
 2011-08-21  Stefano Lattarini  <address@hidden>
 
+       tap/awk: correctly extract message from SKIP plans
+       * lib/tap-driver.sh (/^1\.\.0+[ \t]*#/): Add a forgotten `?' to
+       the regex used to extract the skip message from a "1..0" TAP plan.
+       * tests/planskip.test: Check for the just-fixed bug.
+       * tests/tap-planskip-unplanned-corner.test: Don't be too strict
+       w.r.t. the formatting of the "skip whole test" message, to avoid
+       failing due to bugs irrelevant for this test (like the one just
+       fixed).
+
+2011-08-21  Stefano Lattarini  <address@hidden>
+
        tap/awk: support colorized output
        * lib/tap-driver.sh: Pass definition of colors to the BEGIN block
        of the awk script, using ...
diff --git a/lib/tap-driver.sh b/lib/tap-driver.sh
index 28eacb7..dd2b929 100755
--- a/lib/tap-driver.sh
+++ b/lib/tap-driver.sh
@@ -23,7 +23,7 @@
 # bugs to <address@hidden> or send patches to
 # <address@hidden>.
 
-scriptversion=2011-08-21.16; # UTC
+scriptversion=2011-08-21.21; # UTC
 
 # Make unconditional expansion of undefined variables an error.  This
 # helps a lot in preventing typo-related bugs.
@@ -502,7 +502,7 @@ BEGIN {
   # leading and trailing whitespace.  This is a little more tricky in
   # thruth, since we want to also strip a potential leading "SKIP"
   # string from the message.
-  sub("^[^#]*#[ \\t]*(SKIP[: \\t][ \\t]*)", "")
+  sub("^[^#]*#[ \\t]*(SKIP[: \\t][ \\t]*)?", "")
   sub("[ \\t]*$", "");
   handle_tap_plan(0, $0)
   next
diff --git a/tests/tap-planskip-unplanned-corner.test 
b/tests/tap-planskip-unplanned-corner.test
index cf9f49e..4e825d5 100755
--- a/tests/tap-planskip-unplanned-corner.test
+++ b/tests/tap-planskip-unplanned-corner.test
@@ -38,7 +38,8 @@ cat stdout
 
 count_test_results total=5 pass=0 fail=0 xpass=0 xfail=0 skip=2 error=3
 
-grep '^SKIP: foo\.test$' stdout
+# Don't be too strict w.r.t. the format of the "skip whole test" message.
+grep '^SKIP: foo\.test$' stdout || grep '^SKIP: foo\.test [^0-9]' stdout
 grep '^ERROR: foo\.test 1 # UNPLANNED$' stdout
 grep '^ERROR: foo\.test - too many tests run (expected 0, got 1)$' stdout
 grep '^SKIP: bar\.test 1 # SKIP$' stdout
diff --git a/tests/tap-planskip.test b/tests/tap-planskip.test
index 574819b..35f7976 100755
--- a/tests/tap-planskip.test
+++ b/tests/tap-planskip.test
@@ -63,6 +63,10 @@ cat stdout
 
 count_test_results total=6 pass=0 fail=0 xpass=0 xfail=0 skip=6 error=0
 
+# Look for a regression where the "1..0" wasn't being stripped from the
+# SKIP message.
+$FGREP '1..0' stdout && Exit 1
+
 grep '^SKIP: foo\.test$' stdout
 grep '^SKIP: bar\.test$' stdout
 grep '^SKIP: baz\.test' stdout # Deliberately laxer, see above for why.
-- 
1.7.2.3




reply via email to

[Prev in Thread] Current Thread [Next in Thread]