Patchwork [4,of,5] run-tests: allow command output to start with "> "

login
register
mail settings
Submitter Danek Duvall
Date Aug. 26, 2013, 8:25 p.m.
Message ID <e8d378497e82e22fe9c0.1377548708@smelly>
Download mbox | patch
Permalink /patch/2270/
State Changes Requested
Headers show

Comments

Danek Duvall - Aug. 26, 2013, 8:25 p.m.
# HG changeset patch
# User Danek Duvall <danek.duvall@oracle.com>
# Date 1377548528 25200
# Node ID e8d378497e82e22fe9c0cff4d2be56635d7057f3
# Parent  e7f80cd7cea36a30b0011c6122b7b5e196107c51
run-tests: allow command output to start with "> "

Patch

diff --git a/tests/run-tests.py b/tests/run-tests.py
--- a/tests/run-tests.py
+++ b/tests/run-tests.py
@@ -738,6 +738,8 @@  def tsttest(test, wd, options, replaceme
             if len(cmd) == 2 and cmd[0] == 'cd':
                 l = '  $ cd %s || exit 1\n' % cmd[1]
             script.append(l[4:])
+        elif l.startswith('  \\> '): # output line starts with ">"
+            expected.setdefault(pos, []).append(l[3:])
         elif l.startswith('  > '): # continuations
             after.setdefault(prepos, []).append(l)
             script.append(l[4:])
@@ -787,6 +789,8 @@  def tsttest(test, wd, options, replaceme
         if lout:
             if not lout.endswith('\n'):
                 lout += ' (no-eol)\n'
+            if lout.startswith('> '):
+                lout = '\\' + lout
 
             # find the expected output at the current position
             el = None