Patchwork [3,of,3] run-tests: don't drop optional lines after a missing unconditional line

login
register
mail settings
Submitter Matt Harbison
Date July 18, 2017, 12:51 p.m.
Message ID <ad9dc167165e4146e5c8.1500382280@Envy>
Download mbox | patch
Permalink /patch/22483/
State Accepted
Headers show

Comments

Matt Harbison - July 18, 2017, 12:51 p.m.
# HG changeset patch
# User Matt Harbison <matt_harbison@yahoo.com>
# Date 1500353831 14400
#      Tue Jul 18 00:57:11 2017 -0400
# Node ID ad9dc167165e4146e5c8f0efd3767c2422e444ed
# Parent  1308a9294c11061a2bfb6288548102e7bb59f3d3
run-tests: don't drop optional lines after a missing unconditional line

The previous behavior was to bail out when hitting 'awol', so 'missing (?)' was
also dropped.

Patch

diff --git a/tests/run-tests.py b/tests/run-tests.py
--- a/tests/run-tests.py
+++ b/tests/run-tests.py
@@ -1429,7 +1429,7 @@ 
                                     # Don't append as optional line
                                     continue
                             else:
-                                break
+                                continue
                     postout.append(b'  ' + el)
 
             if lcmd:
diff --git a/tests/test-run-tests.t b/tests/test-run-tests.t
--- a/tests/test-run-tests.t
+++ b/tests/test-run-tests.t
@@ -177,6 +177,13 @@ 
   >   b.r (re) (true !)
   >   missing (?)
   >   awol (true !)
+  > 
+  > The "missing" line should stay, even though awol is dropped
+  >   $ echo 'testing'
+  >   test.ng (re) (true !)
+  >   foo.ar (?)
+  >   awol
+  >   missing (?)
   > EOF
   $ rt test-failure.t
   
@@ -194,13 +201,22 @@ 
      foobar*foo (glob) (false !)
      te*ting (glob) (true !)
    
-  @@ -13,6 +11,4 @@
+     foo.ar (re) (false !)
+     missing (?)
+  @@ -13,13 +11,10 @@
      $ echo 'testing'
      test.ng (re) (true !)
      foo.ar (re) (false !)
   -  b.r (re) (true !)
      missing (?)
   -  awol (true !)
+   
+   The "missing" line should stay, even though awol is dropped
+     $ echo 'testing'
+     test.ng (re) (true !)
+     foo.ar (?)
+  -  awol
+     missing (?)
   
   ERROR: test-failure.t output changed
   !