]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
tap/awk: correctly extract message from SKIP plans
authorStefano Lattarini <stefano.lattarini@gmail.com>
Sun, 21 Aug 2011 21:15:45 +0000 (23:15 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Sun, 21 Aug 2011 21:46:52 +0000 (23:46 +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
lib/tap-driver.sh
tests/tap-planskip-unplanned-corner.test
tests/tap-planskip.test

index 80889c9eadfd892dd2a1b3d886c69c1273ff6ceb..738e10ff84f86ecf2ac0644ac71f4a3b91d3eefc 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2011-08-21  Stefano Lattarini  <stefano.lattarini@gmail.com>
+
+       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  <stefano.lattarini@gmail.com>
 
        tap/awk: support colorized output
index 28eacb7bee5dbcdcf4e297b0cc4eec2de8b0923b..dd2b92945f9230dea2222ec906de099556c188b4 100755 (executable)
@@ -23,7 +23,7 @@
 # bugs to <bug-automake@gnu.org> or send patches to
 # <automake-patches@gnu.org>.
 
-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
index cf9f49eb3991892a7e3e1275def0a54bf0debca6..4e825d5b738a73bab8e746359ebb0c011fc28d7e 100755 (executable)
@@ -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
index 574819bb6e843cfec14b31a52128fa99056eb0b2..35f79760368c873ef80b2313d06b950edf53c3bf 100755 (executable)
@@ -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.