##// END OF EJS Templates
tests: make test-commandserver.py output readable
Mads Kiilerich -
r15541:3aee6e26 default
parent child Browse files
Show More
@@ -26,6 +26,7 b' def readchannel(server):'
26 26 return channel, server.stdout.read(length)
27 27
28 28 def runcommand(server, args, output=sys.stdout, error=sys.stderr, input=None):
29 print ' runcommand', ' '.join(args)
29 30 server.stdin.write('runcommand\n')
30 31 writeblock(server, '\0'.join(args))
31 32
@@ -52,6 +53,9 b' def runcommand(server, args, output=sys.'
52 53 return
53 54
54 55 def check(func, repopath=None):
56 print
57 print 'testing %s:' % func.__name__
58 print
55 59 server = connect(repopath)
56 60 try:
57 61 return func(server)
@@ -1,6 +1,17 b''
1
2 testing hellomessage:
3
1 4 o, 'capabilities: getencoding runcommand\nencoding: ***'
5 runcommand id
2 6 000000000000 tip
3 7 abort: unknown command unknowncommand
8
9 testing unknowncommand:
10
11
12 testing checkruncommand:
13
14 runcommand
4 15 Mercurial Distributed SCM
5 16
6 17 basic commands:
@@ -24,44 +35,86 b' basic commands:'
24 35 update update working directory (or switch revisions)
25 36
26 37 use "hg help" for the full list of commands or "hg -v" for details
38 runcommand id --quiet
27 39 000000000000
40 runcommand id
28 41 000000000000 tip
42 runcommand id --config ui.quiet=True
29 43 000000000000
44 runcommand id
30 45 000000000000 tip
46
47 testing inputeof:
48
31 49 server exit code = 1
50
51 testing serverinput:
52
53 runcommand import -
32 54 applying patch from stdin
55 runcommand log
33 56 changeset: 0:eff892de26ec
34 57 tag: tip
35 58 user: test
36 59 date: Thu Jan 01 00:00:00 1970 +0000
37 60 summary: 1
38 61
62
63 testing cwd:
64
65 runcommand --cwd foo st bar
39 66 ? bar
67 runcommand st foo/bar
40 68 ? foo/bar
69
70 testing localhgrc:
71
72 runcommand showconfig
41 73 bundle.mainreporoot=$TESTTMP
42 74 defaults.backout=-d "0 0"
43 75 defaults.commit=-d "0 0"
44 76 defaults.tag=-d "0 0"
45 77 ui.slash=True
46 78 ui.foo=bar
79 runcommand init foo
80 runcommand -R foo showconfig
47 81 bundle.mainreporoot=$TESTTMP/foo
48 82 defaults.backout=-d "0 0"
49 83 defaults.commit=-d "0 0"
50 84 defaults.tag=-d "0 0"
51 85 ui.slash=True
86
87 testing hookoutput:
88
89 runcommand --config hooks.pre-identify=python:test-commandserver.hook id
52 90 hook talking
53 91 now try to read something: 'some input'
54 92 eff892de26ec tip
93
94 testing outsidechanges:
95
96 runcommand tip
55 97 changeset: 1:d3a0a68be6de
56 98 tag: tip
57 99 user: test
58 100 date: Thu Jan 01 00:00:00 1970 +0000
59 101 summary: 2
60 102
103
104 testing bookmarks:
105
106 runcommand bookmarks
61 107 no bookmarks set
108 runcommand bookmarks
62 109 bm1 1:d3a0a68be6de
63 110 bm2 1:d3a0a68be6de
111 runcommand bookmarks
64 112 * bm1 1:d3a0a68be6de
65 113 bm2 1:d3a0a68be6de
66 114
115 testing tagscache:
116
117 runcommand id -t -r 0
118
119 runcommand id -t -r 0
67 120 foo
General Comments 0
You need to be logged in to leave comments. Login now