annotate tests/test-progress.t @ 21312:986b8a58a6d3

run-tests: move t test parsing into its own function Test parsing is somewhat complicated. This patch extracts it into its own function. The impetus of this patch is folding tsttest() into the TTest class. Subsequent patches will continue this work until tsttest() no longer exists.
author Gregory Szorc <gregory.szorc@gmail.com>
date Sat, 19 Apr 2014 15:19:28 -0700
parents 51e5c793a9f4
children 26d2fb899637
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
10465
5d7e84e7ac6d Add test for progress extension
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
1
12479
2f9ef3657730 tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents: 10891
diff changeset
2 $ cat > loop.py <<EOF
21254
51e5c793a9f4 tests: declare commands using decorator
Gregory Szorc <gregory.szorc@gmail.com>
parents: 19619
diff changeset
3 > from mercurial import cmdutil, commands
19619
4694ccd5d994 progress: stop getting stuck in a nested topic during a long inner step
Augie Fackler <raf@durin42.com>
parents: 19229
diff changeset
4 > import time
21254
51e5c793a9f4 tests: declare commands using decorator
Gregory Szorc <gregory.szorc@gmail.com>
parents: 19619
diff changeset
5 >
51e5c793a9f4 tests: declare commands using decorator
Gregory Szorc <gregory.szorc@gmail.com>
parents: 19619
diff changeset
6 > cmdtable = {}
51e5c793a9f4 tests: declare commands using decorator
Gregory Szorc <gregory.szorc@gmail.com>
parents: 19619
diff changeset
7 > command = cmdutil.command(cmdtable)
51e5c793a9f4 tests: declare commands using decorator
Gregory Szorc <gregory.szorc@gmail.com>
parents: 19619
diff changeset
8 >
19619
4694ccd5d994 progress: stop getting stuck in a nested topic during a long inner step
Augie Fackler <raf@durin42.com>
parents: 19229
diff changeset
9 > class incrementingtime(object):
4694ccd5d994 progress: stop getting stuck in a nested topic during a long inner step
Augie Fackler <raf@durin42.com>
parents: 19229
diff changeset
10 > def __init__(self):
4694ccd5d994 progress: stop getting stuck in a nested topic during a long inner step
Augie Fackler <raf@durin42.com>
parents: 19229
diff changeset
11 > self._time = 0.0
4694ccd5d994 progress: stop getting stuck in a nested topic during a long inner step
Augie Fackler <raf@durin42.com>
parents: 19229
diff changeset
12 > def __call__(self):
4694ccd5d994 progress: stop getting stuck in a nested topic during a long inner step
Augie Fackler <raf@durin42.com>
parents: 19229
diff changeset
13 > self._time += 0.25
4694ccd5d994 progress: stop getting stuck in a nested topic during a long inner step
Augie Fackler <raf@durin42.com>
parents: 19229
diff changeset
14 > return self._time
4694ccd5d994 progress: stop getting stuck in a nested topic during a long inner step
Augie Fackler <raf@durin42.com>
parents: 19229
diff changeset
15 > time.time = incrementingtime()
12479
2f9ef3657730 tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents: 10891
diff changeset
16 >
21254
51e5c793a9f4 tests: declare commands using decorator
Gregory Szorc <gregory.szorc@gmail.com>
parents: 19619
diff changeset
17 > @command('loop',
51e5c793a9f4 tests: declare commands using decorator
Gregory Szorc <gregory.szorc@gmail.com>
parents: 19619
diff changeset
18 > [('', 'total', '', 'override for total'),
51e5c793a9f4 tests: declare commands using decorator
Gregory Szorc <gregory.szorc@gmail.com>
parents: 19619
diff changeset
19 > ('', 'nested', False, 'show nested results'),
51e5c793a9f4 tests: declare commands using decorator
Gregory Szorc <gregory.szorc@gmail.com>
parents: 19619
diff changeset
20 > ('', 'parallel', False, 'show parallel sets of results')],
51e5c793a9f4 tests: declare commands using decorator
Gregory Szorc <gregory.szorc@gmail.com>
parents: 19619
diff changeset
21 > 'hg loop LOOPS')
12479
2f9ef3657730 tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents: 10891
diff changeset
22 > def loop(ui, loops, **opts):
2f9ef3657730 tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents: 10891
diff changeset
23 > loops = int(loops)
2f9ef3657730 tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents: 10891
diff changeset
24 > total = None
2f9ef3657730 tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents: 10891
diff changeset
25 > if loops >= 0:
2f9ef3657730 tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents: 10891
diff changeset
26 > total = loops
2f9ef3657730 tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents: 10891
diff changeset
27 > if opts.get('total', None):
2f9ef3657730 tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents: 10891
diff changeset
28 > total = int(opts.get('total'))
14838
5d261fd00446 progress: add a changedelay to prevent parallel topics from flapping (issue2698)
Augie Fackler <durin42@gmail.com>
parents: 13236
diff changeset
29 > nested = False
5d261fd00446 progress: add a changedelay to prevent parallel topics from flapping (issue2698)
Augie Fackler <durin42@gmail.com>
parents: 13236
diff changeset
30 > if opts.get('nested', None):
5d261fd00446 progress: add a changedelay to prevent parallel topics from flapping (issue2698)
Augie Fackler <durin42@gmail.com>
parents: 13236
diff changeset
31 > nested = True
12479
2f9ef3657730 tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents: 10891
diff changeset
32 > loops = abs(loops)
2f9ef3657730 tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents: 10891
diff changeset
33 >
2f9ef3657730 tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents: 10891
diff changeset
34 > for i in range(loops):
2f9ef3657730 tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents: 10891
diff changeset
35 > ui.progress('loop', i, 'loop.%d' % i, 'loopnum', total)
14838
5d261fd00446 progress: add a changedelay to prevent parallel topics from flapping (issue2698)
Augie Fackler <durin42@gmail.com>
parents: 13236
diff changeset
36 > if opts.get('parallel'):
5d261fd00446 progress: add a changedelay to prevent parallel topics from flapping (issue2698)
Augie Fackler <durin42@gmail.com>
parents: 13236
diff changeset
37 > ui.progress('other', i, 'other.%d' % i, 'othernum', total)
5d261fd00446 progress: add a changedelay to prevent parallel topics from flapping (issue2698)
Augie Fackler <durin42@gmail.com>
parents: 13236
diff changeset
38 > if nested:
19619
4694ccd5d994 progress: stop getting stuck in a nested topic during a long inner step
Augie Fackler <raf@durin42.com>
parents: 19229
diff changeset
39 > nested_steps = 2
4694ccd5d994 progress: stop getting stuck in a nested topic during a long inner step
Augie Fackler <raf@durin42.com>
parents: 19229
diff changeset
40 > if i and i % 4 == 0:
4694ccd5d994 progress: stop getting stuck in a nested topic during a long inner step
Augie Fackler <raf@durin42.com>
parents: 19229
diff changeset
41 > nested_steps = 5
4694ccd5d994 progress: stop getting stuck in a nested topic during a long inner step
Augie Fackler <raf@durin42.com>
parents: 19229
diff changeset
42 > for j in range(nested_steps):
4694ccd5d994 progress: stop getting stuck in a nested topic during a long inner step
Augie Fackler <raf@durin42.com>
parents: 19229
diff changeset
43 > ui.progress(
4694ccd5d994 progress: stop getting stuck in a nested topic during a long inner step
Augie Fackler <raf@durin42.com>
parents: 19229
diff changeset
44 > 'nested', j, 'nested.%d' % j, 'nestnum', nested_steps)
4694ccd5d994 progress: stop getting stuck in a nested topic during a long inner step
Augie Fackler <raf@durin42.com>
parents: 19229
diff changeset
45 > ui.progress(
4694ccd5d994 progress: stop getting stuck in a nested topic during a long inner step
Augie Fackler <raf@durin42.com>
parents: 19229
diff changeset
46 > 'nested', None, 'nested.done', 'nestnum', nested_steps)
12479
2f9ef3657730 tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents: 10891
diff changeset
47 > ui.progress('loop', None, 'loop.done', 'loopnum', total)
2f9ef3657730 tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents: 10891
diff changeset
48 >
2f9ef3657730 tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents: 10891
diff changeset
49 > commands.norepo += " loop"
2f9ef3657730 tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents: 10891
diff changeset
50 > EOF
10465
5d7e84e7ac6d Add test for progress extension
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
51
15372
695ac6aca77f check-code: fix issues with finding patterns in unified tests, fix tests
Matt Mackall <mpm@selenic.com>
parents: 14838
diff changeset
52 $ cp $HGRCPATH $HGRCPATH.orig
12479
2f9ef3657730 tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents: 10891
diff changeset
53 $ echo "[extensions]" >> $HGRCPATH
2f9ef3657730 tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents: 10891
diff changeset
54 $ echo "progress=" >> $HGRCPATH
2f9ef3657730 tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents: 10891
diff changeset
55 $ echo "loop=`pwd`/loop.py" >> $HGRCPATH
2f9ef3657730 tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents: 10891
diff changeset
56 $ echo "[progress]" >> $HGRCPATH
16675
f29f187ee73d test-progress: fix whitespace typo
Martin Geisler <mg@lazybytes.net>
parents: 16350
diff changeset
57 $ echo "format = topic bar number" >> $HGRCPATH
12479
2f9ef3657730 tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents: 10891
diff changeset
58 $ echo "assume-tty=1" >> $HGRCPATH
13142
e9827c85c50b progress: test setting progress.width
Martin Geisler <mg@aragost.com>
parents: 13141
diff changeset
59 $ echo "width=60" >> $HGRCPATH
12479
2f9ef3657730 tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents: 10891
diff changeset
60
2f9ef3657730 tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents: 10891
diff changeset
61 test default params, display nothing because of delay
2f9ef3657730 tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents: 10891
diff changeset
62
17743
6047947afb6b tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents: 16675
diff changeset
63 $ hg -y loop 3
12479
2f9ef3657730 tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents: 10891
diff changeset
64 $ echo "delay=0" >> $HGRCPATH
2f9ef3657730 tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents: 10891
diff changeset
65 $ echo "refresh=0" >> $HGRCPATH
2f9ef3657730 tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents: 10891
diff changeset
66
2f9ef3657730 tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents: 10891
diff changeset
67 test with delay=0, refresh=0
10465
5d7e84e7ac6d Add test for progress extension
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
68
17743
6047947afb6b tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents: 16675
diff changeset
69 $ hg -y loop 3
6047947afb6b tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents: 16675
diff changeset
70 \r (no-eol) (esc)
6047947afb6b tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents: 16675
diff changeset
71 loop [ ] 0/3\r (no-eol) (esc)
6047947afb6b tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents: 16675
diff changeset
72 loop [===============> ] 1/3\r (no-eol) (esc)
6047947afb6b tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents: 16675
diff changeset
73 loop [===============================> ] 2/3\r (no-eol) (esc)
6047947afb6b tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents: 16675
diff changeset
74 \r (no-eol) (esc)
12479
2f9ef3657730 tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents: 10891
diff changeset
75
14838
5d261fd00446 progress: add a changedelay to prevent parallel topics from flapping (issue2698)
Augie Fackler <durin42@gmail.com>
parents: 13236
diff changeset
76
5d261fd00446 progress: add a changedelay to prevent parallel topics from flapping (issue2698)
Augie Fackler <durin42@gmail.com>
parents: 13236
diff changeset
77 test nested short-lived topics (which shouldn't display with nestdelay):
5d261fd00446 progress: add a changedelay to prevent parallel topics from flapping (issue2698)
Augie Fackler <durin42@gmail.com>
parents: 13236
diff changeset
78
17743
6047947afb6b tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents: 16675
diff changeset
79 $ hg -y loop 3 --nested
6047947afb6b tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents: 16675
diff changeset
80 \r (no-eol) (esc)
6047947afb6b tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents: 16675
diff changeset
81 loop [ ] 0/3\r (no-eol) (esc)
6047947afb6b tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents: 16675
diff changeset
82 loop [===============> ] 1/3\r (no-eol) (esc)
6047947afb6b tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents: 16675
diff changeset
83 loop [===============================> ] 2/3\r (no-eol) (esc)
6047947afb6b tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents: 16675
diff changeset
84 \r (no-eol) (esc)
14838
5d261fd00446 progress: add a changedelay to prevent parallel topics from flapping (issue2698)
Augie Fackler <durin42@gmail.com>
parents: 13236
diff changeset
85
19619
4694ccd5d994 progress: stop getting stuck in a nested topic during a long inner step
Augie Fackler <raf@durin42.com>
parents: 19229
diff changeset
86 Test nested long-lived topic which has the same name as a short-lived
4694ccd5d994 progress: stop getting stuck in a nested topic during a long inner step
Augie Fackler <raf@durin42.com>
parents: 19229
diff changeset
87 peer. We shouldn't get stuck showing the short-lived inner steps, and
4694ccd5d994 progress: stop getting stuck in a nested topic during a long inner step
Augie Fackler <raf@durin42.com>
parents: 19229
diff changeset
88 should go back to skipping the inner steps when the slow nested step
4694ccd5d994 progress: stop getting stuck in a nested topic during a long inner step
Augie Fackler <raf@durin42.com>
parents: 19229
diff changeset
89 finishes.
4694ccd5d994 progress: stop getting stuck in a nested topic during a long inner step
Augie Fackler <raf@durin42.com>
parents: 19229
diff changeset
90
4694ccd5d994 progress: stop getting stuck in a nested topic during a long inner step
Augie Fackler <raf@durin42.com>
parents: 19229
diff changeset
91 $ hg -y loop 7 --nested
4694ccd5d994 progress: stop getting stuck in a nested topic during a long inner step
Augie Fackler <raf@durin42.com>
parents: 19229
diff changeset
92 \r (no-eol) (esc)
4694ccd5d994 progress: stop getting stuck in a nested topic during a long inner step
Augie Fackler <raf@durin42.com>
parents: 19229
diff changeset
93 loop [ ] 0/7\r (no-eol) (esc)
4694ccd5d994 progress: stop getting stuck in a nested topic during a long inner step
Augie Fackler <raf@durin42.com>
parents: 19229
diff changeset
94 loop [=====> ] 1/7\r (no-eol) (esc)
4694ccd5d994 progress: stop getting stuck in a nested topic during a long inner step
Augie Fackler <raf@durin42.com>
parents: 19229
diff changeset
95 loop [============> ] 2/7\r (no-eol) (esc)
4694ccd5d994 progress: stop getting stuck in a nested topic during a long inner step
Augie Fackler <raf@durin42.com>
parents: 19229
diff changeset
96 loop [===================> ] 3/7\r (no-eol) (esc)
4694ccd5d994 progress: stop getting stuck in a nested topic during a long inner step
Augie Fackler <raf@durin42.com>
parents: 19229
diff changeset
97 loop [==========================> ] 4/7\r (no-eol) (esc)
4694ccd5d994 progress: stop getting stuck in a nested topic during a long inner step
Augie Fackler <raf@durin42.com>
parents: 19229
diff changeset
98 nested [==========================> ] 3/5\r (no-eol) (esc)
4694ccd5d994 progress: stop getting stuck in a nested topic during a long inner step
Augie Fackler <raf@durin42.com>
parents: 19229
diff changeset
99 nested [===================================> ] 4/5\r (no-eol) (esc)
4694ccd5d994 progress: stop getting stuck in a nested topic during a long inner step
Augie Fackler <raf@durin42.com>
parents: 19229
diff changeset
100 loop [=================================> ] 5/7\r (no-eol) (esc)
4694ccd5d994 progress: stop getting stuck in a nested topic during a long inner step
Augie Fackler <raf@durin42.com>
parents: 19229
diff changeset
101 loop [========================================> ] 6/7\r (no-eol) (esc)
4694ccd5d994 progress: stop getting stuck in a nested topic during a long inner step
Augie Fackler <raf@durin42.com>
parents: 19229
diff changeset
102 \r (no-eol) (esc)
4694ccd5d994 progress: stop getting stuck in a nested topic during a long inner step
Augie Fackler <raf@durin42.com>
parents: 19229
diff changeset
103
14838
5d261fd00446 progress: add a changedelay to prevent parallel topics from flapping (issue2698)
Augie Fackler <durin42@gmail.com>
parents: 13236
diff changeset
104
17743
6047947afb6b tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents: 16675
diff changeset
105 $ hg --config progress.changedelay=0 -y loop 3 --nested
6047947afb6b tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents: 16675
diff changeset
106 \r (no-eol) (esc)
6047947afb6b tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents: 16675
diff changeset
107 loop [ ] 0/3\r (no-eol) (esc)
6047947afb6b tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents: 16675
diff changeset
108 nested [ ] 0/2\r (no-eol) (esc)
6047947afb6b tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents: 16675
diff changeset
109 nested [======================> ] 1/2\r (no-eol) (esc)
6047947afb6b tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents: 16675
diff changeset
110 loop [===============> ] 1/3\r (no-eol) (esc)
6047947afb6b tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents: 16675
diff changeset
111 nested [ ] 0/2\r (no-eol) (esc)
6047947afb6b tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents: 16675
diff changeset
112 nested [======================> ] 1/2\r (no-eol) (esc)
6047947afb6b tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents: 16675
diff changeset
113 loop [===============================> ] 2/3\r (no-eol) (esc)
6047947afb6b tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents: 16675
diff changeset
114 nested [ ] 0/2\r (no-eol) (esc)
6047947afb6b tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents: 16675
diff changeset
115 nested [======================> ] 1/2\r (no-eol) (esc)
6047947afb6b tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents: 16675
diff changeset
116 \r (no-eol) (esc)
14838
5d261fd00446 progress: add a changedelay to prevent parallel topics from flapping (issue2698)
Augie Fackler <durin42@gmail.com>
parents: 13236
diff changeset
117
5d261fd00446 progress: add a changedelay to prevent parallel topics from flapping (issue2698)
Augie Fackler <durin42@gmail.com>
parents: 13236
diff changeset
118
5d261fd00446 progress: add a changedelay to prevent parallel topics from flapping (issue2698)
Augie Fackler <durin42@gmail.com>
parents: 13236
diff changeset
119 test two topics being printed in parallel (as when we're doing a local
5d261fd00446 progress: add a changedelay to prevent parallel topics from flapping (issue2698)
Augie Fackler <durin42@gmail.com>
parents: 13236
diff changeset
120 --pull clone, where you get the unbundle and bundle progress at the
5d261fd00446 progress: add a changedelay to prevent parallel topics from flapping (issue2698)
Augie Fackler <durin42@gmail.com>
parents: 13236
diff changeset
121 same time):
17743
6047947afb6b tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents: 16675
diff changeset
122 $ hg loop 3 --parallel
6047947afb6b tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents: 16675
diff changeset
123 \r (no-eol) (esc)
6047947afb6b tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents: 16675
diff changeset
124 loop [ ] 0/3\r (no-eol) (esc)
6047947afb6b tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents: 16675
diff changeset
125 loop [===============> ] 1/3\r (no-eol) (esc)
6047947afb6b tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents: 16675
diff changeset
126 loop [===============================> ] 2/3\r (no-eol) (esc)
6047947afb6b tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents: 16675
diff changeset
127 \r (no-eol) (esc)
12479
2f9ef3657730 tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents: 10891
diff changeset
128 test refresh is taken in account
10465
5d7e84e7ac6d Add test for progress extension
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
129
17743
6047947afb6b tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents: 16675
diff changeset
130 $ hg -y --config progress.refresh=100 loop 3
12479
2f9ef3657730 tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents: 10891
diff changeset
131
2f9ef3657730 tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents: 10891
diff changeset
132 test format options 1
10465
5d7e84e7ac6d Add test for progress extension
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
133
17743
6047947afb6b tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents: 16675
diff changeset
134 $ hg -y --config 'progress.format=number topic item+2' loop 2
6047947afb6b tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents: 16675
diff changeset
135 \r (no-eol) (esc)
6047947afb6b tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents: 16675
diff changeset
136 0/2 loop lo\r (no-eol) (esc)
6047947afb6b tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents: 16675
diff changeset
137 1/2 loop lo\r (no-eol) (esc)
6047947afb6b tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents: 16675
diff changeset
138 \r (no-eol) (esc)
10465
5d7e84e7ac6d Add test for progress extension
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
139
12479
2f9ef3657730 tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents: 10891
diff changeset
140 test format options 2
10465
5d7e84e7ac6d Add test for progress extension
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
141
17743
6047947afb6b tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents: 16675
diff changeset
142 $ hg -y --config 'progress.format=number item-3 bar' loop 2
6047947afb6b tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents: 16675
diff changeset
143 \r (no-eol) (esc)
6047947afb6b tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents: 16675
diff changeset
144 0/2 p.0 [ ]\r (no-eol) (esc)
6047947afb6b tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents: 16675
diff changeset
145 1/2 p.1 [=======================> ]\r (no-eol) (esc)
6047947afb6b tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents: 16675
diff changeset
146 \r (no-eol) (esc)
10465
5d7e84e7ac6d Add test for progress extension
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
147
12479
2f9ef3657730 tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents: 10891
diff changeset
148 test format options and indeterminate progress
10465
5d7e84e7ac6d Add test for progress extension
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
149
17743
6047947afb6b tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents: 16675
diff changeset
150 $ hg -y --config 'progress.format=number item bar' loop -- -2
6047947afb6b tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents: 16675
diff changeset
151 \r (no-eol) (esc)
6047947afb6b tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents: 16675
diff changeset
152 0 loop.0 [ <=> ]\r (no-eol) (esc)
6047947afb6b tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents: 16675
diff changeset
153 1 loop.1 [ <=> ]\r (no-eol) (esc)
6047947afb6b tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents: 16675
diff changeset
154 \r (no-eol) (esc)
10465
5d7e84e7ac6d Add test for progress extension
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
155
12479
2f9ef3657730 tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents: 10891
diff changeset
156 make sure things don't fall over if count > total
10465
5d7e84e7ac6d Add test for progress extension
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
157
17743
6047947afb6b tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents: 16675
diff changeset
158 $ hg -y loop --total 4 6
6047947afb6b tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents: 16675
diff changeset
159 \r (no-eol) (esc)
6047947afb6b tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents: 16675
diff changeset
160 loop [ ] 0/4\r (no-eol) (esc)
6047947afb6b tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents: 16675
diff changeset
161 loop [===========> ] 1/4\r (no-eol) (esc)
6047947afb6b tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents: 16675
diff changeset
162 loop [=======================> ] 2/4\r (no-eol) (esc)
6047947afb6b tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents: 16675
diff changeset
163 loop [===================================> ] 3/4\r (no-eol) (esc)
6047947afb6b tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents: 16675
diff changeset
164 loop [===============================================>] 4/4\r (no-eol) (esc)
6047947afb6b tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents: 16675
diff changeset
165 loop [ <=> ] 5/4\r (no-eol) (esc)
6047947afb6b tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents: 16675
diff changeset
166 \r (no-eol) (esc)
10891
83af68e38be3 progress: fall back to indeterminate progress if position is >= total
Augie Fackler <durin42@gmail.com>
parents: 10788
diff changeset
167
12479
2f9ef3657730 tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents: 10891
diff changeset
168 test immediate progress completion
2f9ef3657730 tests: unify test-progress
Matt Mackall <mpm@selenic.com>
parents: 10891
diff changeset
169
17743
6047947afb6b tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents: 16675
diff changeset
170 $ hg -y loop 0
13145
ce4cd176634e test-progress: test completion estimates and progress bar delay
Augie Fackler <durin42@gmail.com>
parents: 13142
diff changeset
171
ce4cd176634e test-progress: test completion estimates and progress bar delay
Augie Fackler <durin42@gmail.com>
parents: 13142
diff changeset
172 test delay time estimates
ce4cd176634e test-progress: test completion estimates and progress bar delay
Augie Fackler <durin42@gmail.com>
parents: 13142
diff changeset
173
ce4cd176634e test-progress: test completion estimates and progress bar delay
Augie Fackler <durin42@gmail.com>
parents: 13142
diff changeset
174 $ cat > mocktime.py <<EOF
ce4cd176634e test-progress: test completion estimates and progress bar delay
Augie Fackler <durin42@gmail.com>
parents: 13142
diff changeset
175 > import os
ce4cd176634e test-progress: test completion estimates and progress bar delay
Augie Fackler <durin42@gmail.com>
parents: 13142
diff changeset
176 > import time
ce4cd176634e test-progress: test completion estimates and progress bar delay
Augie Fackler <durin42@gmail.com>
parents: 13142
diff changeset
177 >
ce4cd176634e test-progress: test completion estimates and progress bar delay
Augie Fackler <durin42@gmail.com>
parents: 13142
diff changeset
178 > class mocktime(object):
ce4cd176634e test-progress: test completion estimates and progress bar delay
Augie Fackler <durin42@gmail.com>
parents: 13142
diff changeset
179 > def __init__(self, increment):
ce4cd176634e test-progress: test completion estimates and progress bar delay
Augie Fackler <durin42@gmail.com>
parents: 13142
diff changeset
180 > self.time = 0
ce4cd176634e test-progress: test completion estimates and progress bar delay
Augie Fackler <durin42@gmail.com>
parents: 13142
diff changeset
181 > self.increment = increment
ce4cd176634e test-progress: test completion estimates and progress bar delay
Augie Fackler <durin42@gmail.com>
parents: 13142
diff changeset
182 > def __call__(self):
ce4cd176634e test-progress: test completion estimates and progress bar delay
Augie Fackler <durin42@gmail.com>
parents: 13142
diff changeset
183 > self.time += self.increment
ce4cd176634e test-progress: test completion estimates and progress bar delay
Augie Fackler <durin42@gmail.com>
parents: 13142
diff changeset
184 > return self.time
ce4cd176634e test-progress: test completion estimates and progress bar delay
Augie Fackler <durin42@gmail.com>
parents: 13142
diff changeset
185 >
ce4cd176634e test-progress: test completion estimates and progress bar delay
Augie Fackler <durin42@gmail.com>
parents: 13142
diff changeset
186 > def uisetup(ui):
ce4cd176634e test-progress: test completion estimates and progress bar delay
Augie Fackler <durin42@gmail.com>
parents: 13142
diff changeset
187 > time.time = mocktime(int(os.environ.get('MOCKTIME', '11')))
ce4cd176634e test-progress: test completion estimates and progress bar delay
Augie Fackler <durin42@gmail.com>
parents: 13142
diff changeset
188 > EOF
ce4cd176634e test-progress: test completion estimates and progress bar delay
Augie Fackler <durin42@gmail.com>
parents: 13142
diff changeset
189
15372
695ac6aca77f check-code: fix issues with finding patterns in unified tests, fix tests
Matt Mackall <mpm@selenic.com>
parents: 14838
diff changeset
190 $ cp $HGRCPATH.orig $HGRCPATH
695ac6aca77f check-code: fix issues with finding patterns in unified tests, fix tests
Matt Mackall <mpm@selenic.com>
parents: 14838
diff changeset
191 $ echo "[extensions]" >> $HGRCPATH
13145
ce4cd176634e test-progress: test completion estimates and progress bar delay
Augie Fackler <durin42@gmail.com>
parents: 13142
diff changeset
192 $ echo "mocktime=`pwd`/mocktime.py" >> $HGRCPATH
ce4cd176634e test-progress: test completion estimates and progress bar delay
Augie Fackler <durin42@gmail.com>
parents: 13142
diff changeset
193 $ echo "progress=" >> $HGRCPATH
ce4cd176634e test-progress: test completion estimates and progress bar delay
Augie Fackler <durin42@gmail.com>
parents: 13142
diff changeset
194 $ echo "loop=`pwd`/loop.py" >> $HGRCPATH
ce4cd176634e test-progress: test completion estimates and progress bar delay
Augie Fackler <durin42@gmail.com>
parents: 13142
diff changeset
195 $ echo "[progress]" >> $HGRCPATH
ce4cd176634e test-progress: test completion estimates and progress bar delay
Augie Fackler <durin42@gmail.com>
parents: 13142
diff changeset
196 $ echo "assume-tty=1" >> $HGRCPATH
ce4cd176634e test-progress: test completion estimates and progress bar delay
Augie Fackler <durin42@gmail.com>
parents: 13142
diff changeset
197 $ echo "delay=25" >> $HGRCPATH
ce4cd176634e test-progress: test completion estimates and progress bar delay
Augie Fackler <durin42@gmail.com>
parents: 13142
diff changeset
198 $ echo "width=60" >> $HGRCPATH
ce4cd176634e test-progress: test completion estimates and progress bar delay
Augie Fackler <durin42@gmail.com>
parents: 13142
diff changeset
199
17743
6047947afb6b tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents: 16675
diff changeset
200 $ hg -y loop 8
6047947afb6b tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents: 16675
diff changeset
201 \r (no-eol) (esc)
6047947afb6b tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents: 16675
diff changeset
202 loop [=========> ] 2/8 1m07s\r (no-eol) (esc)
6047947afb6b tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents: 16675
diff changeset
203 loop [===============> ] 3/8 56s\r (no-eol) (esc)
6047947afb6b tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents: 16675
diff changeset
204 loop [=====================> ] 4/8 45s\r (no-eol) (esc)
6047947afb6b tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents: 16675
diff changeset
205 loop [==========================> ] 5/8 34s\r (no-eol) (esc)
6047947afb6b tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents: 16675
diff changeset
206 loop [================================> ] 6/8 23s\r (no-eol) (esc)
6047947afb6b tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents: 16675
diff changeset
207 loop [=====================================> ] 7/8 12s\r (no-eol) (esc)
6047947afb6b tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents: 16675
diff changeset
208 \r (no-eol) (esc)
13145
ce4cd176634e test-progress: test completion estimates and progress bar delay
Augie Fackler <durin42@gmail.com>
parents: 13142
diff changeset
209
17743
6047947afb6b tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents: 16675
diff changeset
210 $ MOCKTIME=10000 hg -y loop 4
6047947afb6b tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents: 16675
diff changeset
211 \r (no-eol) (esc)
6047947afb6b tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents: 16675
diff changeset
212 loop [ ] 0/4\r (no-eol) (esc)
6047947afb6b tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents: 16675
diff changeset
213 loop [=========> ] 1/4 8h21m\r (no-eol) (esc)
6047947afb6b tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents: 16675
diff changeset
214 loop [====================> ] 2/4 5h34m\r (no-eol) (esc)
6047947afb6b tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents: 16675
diff changeset
215 loop [==============================> ] 3/4 2h47m\r (no-eol) (esc)
6047947afb6b tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents: 16675
diff changeset
216 \r (no-eol) (esc)
13145
ce4cd176634e test-progress: test completion estimates and progress bar delay
Augie Fackler <durin42@gmail.com>
parents: 13142
diff changeset
217
17743
6047947afb6b tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents: 16675
diff changeset
218 $ MOCKTIME=1000000 hg -y loop 4
6047947afb6b tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents: 16675
diff changeset
219 \r (no-eol) (esc)
6047947afb6b tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents: 16675
diff changeset
220 loop [ ] 0/4\r (no-eol) (esc)
6047947afb6b tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents: 16675
diff changeset
221 loop [=========> ] 1/4 5w00d\r (no-eol) (esc)
6047947afb6b tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents: 16675
diff changeset
222 loop [====================> ] 2/4 3w03d\r (no-eol) (esc)
6047947afb6b tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents: 16675
diff changeset
223 loop [=============================> ] 3/4 11d14h\r (no-eol) (esc)
6047947afb6b tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents: 16675
diff changeset
224 \r (no-eol) (esc)
13236
3f299f5d9a29 progress: handle days, weeks and years
timeless <timeless@gmail.com>
parents: 13154
diff changeset
225
3f299f5d9a29 progress: handle days, weeks and years
timeless <timeless@gmail.com>
parents: 13154
diff changeset
226
17743
6047947afb6b tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents: 16675
diff changeset
227 $ MOCKTIME=14000000 hg -y loop 4
6047947afb6b tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents: 16675
diff changeset
228 \r (no-eol) (esc)
6047947afb6b tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents: 16675
diff changeset
229 loop [ ] 0/4\r (no-eol) (esc)
6047947afb6b tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents: 16675
diff changeset
230 loop [=========> ] 1/4 1y18w\r (no-eol) (esc)
6047947afb6b tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents: 16675
diff changeset
231 loop [===================> ] 2/4 46w03d\r (no-eol) (esc)
6047947afb6b tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents: 16675
diff changeset
232 loop [=============================> ] 3/4 23w02d\r (no-eol) (esc)
6047947afb6b tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents: 16675
diff changeset
233 \r (no-eol) (esc)
13236
3f299f5d9a29 progress: handle days, weeks and years
timeless <timeless@gmail.com>
parents: 13154
diff changeset
234
13154
e11c14f14491 progress: don't compute estimate without a total
Augie Fackler <durin42@gmail.com>
parents: 13149
diff changeset
235 Time estimates should not fail when there's no end point:
17743
6047947afb6b tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents: 16675
diff changeset
236 $ hg -y loop -- -4
6047947afb6b tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents: 16675
diff changeset
237 \r (no-eol) (esc)
19229
41e39a0299cb blackbox: fix recording exit codes (issue3938)
Durham Goode <durham@fb.com>
parents: 18670
diff changeset
238 loop [ <=> ] 2\r (no-eol) (esc)
41e39a0299cb blackbox: fix recording exit codes (issue3938)
Durham Goode <durham@fb.com>
parents: 18670
diff changeset
239 loop [ <=> ] 3\r (no-eol) (esc)
17743
6047947afb6b tests: drop filtercr.py and use the very explicit '\r (no-eol) (esc)' markup
Mads Kiilerich <mads@kiilerich.com>
parents: 16675
diff changeset
240 \r (no-eol) (esc)