##// END OF EJS Templates
test-progress: test completion estimates and progress bar delay
Augie Fackler -
r13145:ce4cd176 default
parent child Browse files
Show More
@@ -94,3 +94,49 b' test immediate progress completion'
94
94
95 $ hg -y loop 0 2>&1 | $TESTDIR/filtercr.py
95 $ hg -y loop 0 2>&1 | $TESTDIR/filtercr.py
96
96
97
98 test delay time estimates
99
100 $ cat > mocktime.py <<EOF
101 > import os
102 > import time
103 >
104 > class mocktime(object):
105 > def __init__(self, increment):
106 > self.time = 0
107 > self.increment = increment
108 > def __call__(self):
109 > self.time += self.increment
110 > return self.time
111 >
112 > def uisetup(ui):
113 > time.time = mocktime(int(os.environ.get('MOCKTIME', '11')))
114 > EOF
115
116 $ echo "[extensions]" > $HGRCPATH
117 $ echo "mocktime=`pwd`/mocktime.py" >> $HGRCPATH
118 $ echo "progress=" >> $HGRCPATH
119 $ echo "loop=`pwd`/loop.py" >> $HGRCPATH
120 $ echo "[progress]" >> $HGRCPATH
121 $ echo "assume-tty=1" >> $HGRCPATH
122 $ echo "delay=25" >> $HGRCPATH
123 $ echo "width=60" >> $HGRCPATH
124
125 $ hg -y loop 8 2>&1 | python $TESTDIR/filtercr.py
126
127 loop [=========> ] 2/8 1m07s
128 loop [===============> ] 3/8 56s
129 loop [=====================> ] 4/8 45s
130 loop [==========================> ] 5/8 34s
131 loop [================================> ] 6/8 23s
132 loop [=====================================> ] 7/8 12s
133 \r (esc)
134
135 $ MOCKTIME=10000 hg -y loop 4 2>&1 | python $TESTDIR/filtercr.py
136
137 loop [ ] 0/4
138 loop [=========> ] 1/4 8h21m
139 loop [====================> ] 2/4 5h34m
140 loop [==============================> ] 3/4 2h47m
141 \r (esc)
142
General Comments 0
You need to be logged in to leave comments. Login now