cmdserver: include non-zero return code of runcommand in test output
authorYuya Nishihara <yuya@tcha.org>
Mon, 03 Mar 2014 15:50:48 +0900
changeset 20630 0b04ee8e789d
parent 20629 277dc5f27310
child 20631 5d4606bec54c
cmdserver: include non-zero return code of runcommand in test output
tests/test-commandserver.py
tests/test-commandserver.py.out
--- a/tests/test-commandserver.py	Mon Mar 03 19:41:30 2014 +0900
+++ b/tests/test-commandserver.py	Mon Mar 03 15:50:48 2014 +0900
@@ -51,7 +51,10 @@
         elif ch == 'L':
             writeblock(server, input.readline(data))
         elif ch == 'r':
-            return struct.unpack('>i', data)[0]
+            ret, = struct.unpack('>i', data)
+            if ret != 0:
+                print ' [%d]' % ret
+            return ret
         else:
             print "unexpected channel %c: %r" % (ch, data)
             if ch.isupper():
--- a/tests/test-commandserver.py.out	Mon Mar 03 19:41:30 2014 +0900
+++ b/tests/test-commandserver.py.out	Mon Mar 03 15:50:48 2014 +0900
@@ -142,6 +142,7 @@
 
  runcommand phase -r . -p
 no phases changed
+ [1]
  runcommand commit -Am.
  runcommand rollback
 repository tip rolled back to revision 3 (undo commit)