tests: make test-commandserver.py output readable
authorMads Kiilerich <mads@kiilerich.com>
Mon, 21 Nov 2011 00:39:32 +0100
changeset 15541 3aee6e26b28b
parent 15540 ad2c5561cada
child 15542 e19302598df8
tests: make test-commandserver.py output readable
tests/test-commandserver.py
tests/test-commandserver.py.out
--- a/tests/test-commandserver.py	Mon Nov 21 00:39:32 2011 +0100
+++ b/tests/test-commandserver.py	Mon Nov 21 00:39:32 2011 +0100
@@ -26,6 +26,7 @@
         return channel, server.stdout.read(length)
 
 def runcommand(server, args, output=sys.stdout, error=sys.stderr, input=None):
+    print ' runcommand', ' '.join(args)
     server.stdin.write('runcommand\n')
     writeblock(server, '\0'.join(args))
 
@@ -52,6 +53,9 @@
                 return
 
 def check(func, repopath=None):
+    print
+    print 'testing %s:' % func.__name__
+    print
     server = connect(repopath)
     try:
         return func(server)
--- a/tests/test-commandserver.py.out	Mon Nov 21 00:39:32 2011 +0100
+++ b/tests/test-commandserver.py.out	Mon Nov 21 00:39:32 2011 +0100
@@ -1,6 +1,17 @@
+
+testing hellomessage:
+
 o, 'capabilities: getencoding runcommand\nencoding: ***'
+ runcommand id
 000000000000 tip
 abort: unknown command unknowncommand
+
+testing unknowncommand:
+
+
+testing checkruncommand:
+
+ runcommand 
 Mercurial Distributed SCM
 
 basic commands:
@@ -24,44 +35,86 @@
  update     update working directory (or switch revisions)
 
 use "hg help" for the full list of commands or "hg -v" for details
+ runcommand id --quiet
 000000000000
+ runcommand id
 000000000000 tip
+ runcommand id --config ui.quiet=True
 000000000000
+ runcommand id
 000000000000 tip
+
+testing inputeof:
+
 server exit code = 1
+
+testing serverinput:
+
+ runcommand import -
 applying patch from stdin
+ runcommand log
 changeset:   0:eff892de26ec
 tag:         tip
 user:        test
 date:        Thu Jan 01 00:00:00 1970 +0000
 summary:     1
 
+
+testing cwd:
+
+ runcommand --cwd foo st bar
 ? bar
+ runcommand st foo/bar
 ? foo/bar
+
+testing localhgrc:
+
+ runcommand showconfig
 bundle.mainreporoot=$TESTTMP
 defaults.backout=-d "0 0"
 defaults.commit=-d "0 0"
 defaults.tag=-d "0 0"
 ui.slash=True
 ui.foo=bar
+ runcommand init foo
+ runcommand -R foo showconfig
 bundle.mainreporoot=$TESTTMP/foo
 defaults.backout=-d "0 0"
 defaults.commit=-d "0 0"
 defaults.tag=-d "0 0"
 ui.slash=True
+
+testing hookoutput:
+
+ runcommand --config hooks.pre-identify=python:test-commandserver.hook id
 hook talking
 now try to read something: 'some input'
 eff892de26ec tip
+
+testing outsidechanges:
+
+ runcommand tip
 changeset:   1:d3a0a68be6de
 tag:         tip
 user:        test
 date:        Thu Jan 01 00:00:00 1970 +0000
 summary:     2
 
+
+testing bookmarks:
+
+ runcommand bookmarks
 no bookmarks set
+ runcommand bookmarks
    bm1                       1:d3a0a68be6de
    bm2                       1:d3a0a68be6de
+ runcommand bookmarks
  * bm1                       1:d3a0a68be6de
    bm2                       1:d3a0a68be6de
 
+testing tagscache:
+
+ runcommand id -t -r 0
+
+ runcommand id -t -r 0
 foo