##// END OF EJS Templates
test-run-test: unset run-test specific environment variables...
Pierre-Yves David -
r24960:65e8dac7 stable
parent child Browse files
Show More
@@ -1,507 +1,514 b''
1 This file tests the behavior of run-tests.py itself.
1 This file tests the behavior of run-tests.py itself.
2
2
3 Avoid interference from actual test env:
4
5 $ unset HGTEST_JOBS
6 $ unset HGTEST_TIMEOUT
7 $ unset HGTEST_PORT
8 $ unset HGTEST_SHELL
9
3 Smoke test
10 Smoke test
4 ============
11 ============
5
12
6 $ $TESTDIR/run-tests.py $HGTEST_RUN_TESTS_PURE
13 $ $TESTDIR/run-tests.py $HGTEST_RUN_TESTS_PURE
7
14
8 # Ran 0 tests, 0 skipped, 0 warned, 0 failed.
15 # Ran 0 tests, 0 skipped, 0 warned, 0 failed.
9
16
10 a succesful test
17 a succesful test
11 =======================
18 =======================
12
19
13 $ cat > test-success.t << EOF
20 $ cat > test-success.t << EOF
14 > $ echo babar
21 > $ echo babar
15 > babar
22 > babar
16 > $ echo xyzzy
23 > $ echo xyzzy
17 > xyzzy
24 > xyzzy
18 > EOF
25 > EOF
19
26
20 $ $TESTDIR/run-tests.py --with-hg=`which hg`
27 $ $TESTDIR/run-tests.py --with-hg=`which hg`
21 .
28 .
22 # Ran 1 tests, 0 skipped, 0 warned, 0 failed.
29 # Ran 1 tests, 0 skipped, 0 warned, 0 failed.
23
30
24 failing test
31 failing test
25 ==================
32 ==================
26
33
27 $ cat > test-failure.t << EOF
34 $ cat > test-failure.t << EOF
28 > $ echo babar
35 > $ echo babar
29 > rataxes
36 > rataxes
30 > This is a noop statement so that
37 > This is a noop statement so that
31 > this test is still more bytes than success.
38 > this test is still more bytes than success.
32 > EOF
39 > EOF
33
40
34 >>> fh = open('test-failure-unicode.t', 'wb')
41 >>> fh = open('test-failure-unicode.t', 'wb')
35 >>> fh.write(u' $ echo babar\u03b1\n'.encode('utf-8'))
42 >>> fh.write(u' $ echo babar\u03b1\n'.encode('utf-8'))
36 >>> fh.write(u' l\u03b5\u03b5t\n'.encode('utf-8'))
43 >>> fh.write(u' l\u03b5\u03b5t\n'.encode('utf-8'))
37
44
38 $ $TESTDIR/run-tests.py --with-hg=`which hg`
45 $ $TESTDIR/run-tests.py --with-hg=`which hg`
39
46
40 --- $TESTTMP/test-failure.t
47 --- $TESTTMP/test-failure.t
41 +++ $TESTTMP/test-failure.t.err
48 +++ $TESTTMP/test-failure.t.err
42 @@ -1,4 +1,4 @@
49 @@ -1,4 +1,4 @@
43 $ echo babar
50 $ echo babar
44 - rataxes
51 - rataxes
45 + babar
52 + babar
46 This is a noop statement so that
53 This is a noop statement so that
47 this test is still more bytes than success.
54 this test is still more bytes than success.
48
55
49 ERROR: test-failure.t output changed
56 ERROR: test-failure.t output changed
50 !.
57 !.
51 --- $TESTTMP/test-failure-unicode.t
58 --- $TESTTMP/test-failure-unicode.t
52 +++ $TESTTMP/test-failure-unicode.t.err
59 +++ $TESTTMP/test-failure-unicode.t.err
53 @@ -1,2 +1,2 @@
60 @@ -1,2 +1,2 @@
54 $ echo babar\xce\xb1 (esc)
61 $ echo babar\xce\xb1 (esc)
55 - l\xce\xb5\xce\xb5t (esc)
62 - l\xce\xb5\xce\xb5t (esc)
56 + babar\xce\xb1 (esc)
63 + babar\xce\xb1 (esc)
57
64
58 ERROR: test-failure-unicode.t output changed
65 ERROR: test-failure-unicode.t output changed
59 !
66 !
60 Failed test-failure.t: output changed
67 Failed test-failure.t: output changed
61 Failed test-failure-unicode.t: output changed
68 Failed test-failure-unicode.t: output changed
62 # Ran 3 tests, 0 skipped, 0 warned, 2 failed.
69 # Ran 3 tests, 0 skipped, 0 warned, 2 failed.
63 python hash seed: * (glob)
70 python hash seed: * (glob)
64 [1]
71 [1]
65
72
66 test --xunit support
73 test --xunit support
67 $ $TESTDIR/run-tests.py --with-hg=`which hg` --xunit=xunit.xml
74 $ $TESTDIR/run-tests.py --with-hg=`which hg` --xunit=xunit.xml
68
75
69 --- $TESTTMP/test-failure.t
76 --- $TESTTMP/test-failure.t
70 +++ $TESTTMP/test-failure.t.err
77 +++ $TESTTMP/test-failure.t.err
71 @@ -1,4 +1,4 @@
78 @@ -1,4 +1,4 @@
72 $ echo babar
79 $ echo babar
73 - rataxes
80 - rataxes
74 + babar
81 + babar
75 This is a noop statement so that
82 This is a noop statement so that
76 this test is still more bytes than success.
83 this test is still more bytes than success.
77
84
78 ERROR: test-failure.t output changed
85 ERROR: test-failure.t output changed
79 !.
86 !.
80 --- $TESTTMP/test-failure-unicode.t
87 --- $TESTTMP/test-failure-unicode.t
81 +++ $TESTTMP/test-failure-unicode.t.err
88 +++ $TESTTMP/test-failure-unicode.t.err
82 @@ -1,2 +1,2 @@
89 @@ -1,2 +1,2 @@
83 $ echo babar\xce\xb1 (esc)
90 $ echo babar\xce\xb1 (esc)
84 - l\xce\xb5\xce\xb5t (esc)
91 - l\xce\xb5\xce\xb5t (esc)
85 + babar\xce\xb1 (esc)
92 + babar\xce\xb1 (esc)
86
93
87 ERROR: test-failure-unicode.t output changed
94 ERROR: test-failure-unicode.t output changed
88 !
95 !
89 Failed test-failure.t: output changed
96 Failed test-failure.t: output changed
90 Failed test-failure-unicode.t: output changed
97 Failed test-failure-unicode.t: output changed
91 # Ran 3 tests, 0 skipped, 0 warned, 2 failed.
98 # Ran 3 tests, 0 skipped, 0 warned, 2 failed.
92 python hash seed: * (glob)
99 python hash seed: * (glob)
93 [1]
100 [1]
94 $ cat xunit.xml
101 $ cat xunit.xml
95 <?xml version="1.0" encoding="utf-8"?>
102 <?xml version="1.0" encoding="utf-8"?>
96 <testsuite errors="0" failures="2" name="run-tests" skipped="0" tests="3">
103 <testsuite errors="0" failures="2" name="run-tests" skipped="0" tests="3">
97 <testcase name="test-success.t" time="*"/> (glob)
104 <testcase name="test-success.t" time="*"/> (glob)
98 <testcase name="test-failure-unicode.t" time="*"> (glob)
105 <testcase name="test-failure-unicode.t" time="*"> (glob)
99 <![CDATA[--- $TESTTMP/test-failure-unicode.t
106 <![CDATA[--- $TESTTMP/test-failure-unicode.t
100 +++ $TESTTMP/test-failure-unicode.t.err
107 +++ $TESTTMP/test-failure-unicode.t.err
101 @@ -1,2 +1,2 @@
108 @@ -1,2 +1,2 @@
102 $ echo babar\xce\xb1 (esc)
109 $ echo babar\xce\xb1 (esc)
103 - l\xce\xb5\xce\xb5t (esc)
110 - l\xce\xb5\xce\xb5t (esc)
104 + babar\xce\xb1 (esc)
111 + babar\xce\xb1 (esc)
105 ]]> </testcase>
112 ]]> </testcase>
106 <testcase name="test-failure.t" time="*"> (glob)
113 <testcase name="test-failure.t" time="*"> (glob)
107 <![CDATA[--- $TESTTMP/test-failure.t
114 <![CDATA[--- $TESTTMP/test-failure.t
108 +++ $TESTTMP/test-failure.t.err
115 +++ $TESTTMP/test-failure.t.err
109 @@ -1,4 +1,4 @@
116 @@ -1,4 +1,4 @@
110 $ echo babar
117 $ echo babar
111 - rataxes
118 - rataxes
112 + babar
119 + babar
113 This is a noop statement so that
120 This is a noop statement so that
114 this test is still more bytes than success.
121 this test is still more bytes than success.
115 ]]> </testcase>
122 ]]> </testcase>
116 </testsuite>
123 </testsuite>
117
124
118 $ rm test-failure-unicode.t
125 $ rm test-failure-unicode.t
119
126
120 test for --retest
127 test for --retest
121 ====================
128 ====================
122
129
123 $ $TESTDIR/run-tests.py --with-hg=`which hg` --retest
130 $ $TESTDIR/run-tests.py --with-hg=`which hg` --retest
124
131
125 --- $TESTTMP/test-failure.t
132 --- $TESTTMP/test-failure.t
126 +++ $TESTTMP/test-failure.t.err
133 +++ $TESTTMP/test-failure.t.err
127 @@ -1,4 +1,4 @@
134 @@ -1,4 +1,4 @@
128 $ echo babar
135 $ echo babar
129 - rataxes
136 - rataxes
130 + babar
137 + babar
131 This is a noop statement so that
138 This is a noop statement so that
132 this test is still more bytes than success.
139 this test is still more bytes than success.
133
140
134 ERROR: test-failure.t output changed
141 ERROR: test-failure.t output changed
135 !
142 !
136 Failed test-failure.t: output changed
143 Failed test-failure.t: output changed
137 # Ran 2 tests, 1 skipped, 0 warned, 1 failed.
144 # Ran 2 tests, 1 skipped, 0 warned, 1 failed.
138 python hash seed: * (glob)
145 python hash seed: * (glob)
139 [1]
146 [1]
140
147
141 Selecting Tests To Run
148 Selecting Tests To Run
142 ======================
149 ======================
143
150
144 successful
151 successful
145
152
146 $ $TESTDIR/run-tests.py --with-hg=`which hg` test-success.t
153 $ $TESTDIR/run-tests.py --with-hg=`which hg` test-success.t
147 .
154 .
148 # Ran 1 tests, 0 skipped, 0 warned, 0 failed.
155 # Ran 1 tests, 0 skipped, 0 warned, 0 failed.
149
156
150 success w/ keyword
157 success w/ keyword
151 $ $TESTDIR/run-tests.py --with-hg=`which hg` -k xyzzy
158 $ $TESTDIR/run-tests.py --with-hg=`which hg` -k xyzzy
152 .
159 .
153 # Ran 2 tests, 1 skipped, 0 warned, 0 failed.
160 # Ran 2 tests, 1 skipped, 0 warned, 0 failed.
154
161
155 failed
162 failed
156
163
157 $ $TESTDIR/run-tests.py --with-hg=`which hg` test-failure.t
164 $ $TESTDIR/run-tests.py --with-hg=`which hg` test-failure.t
158
165
159 --- $TESTTMP/test-failure.t
166 --- $TESTTMP/test-failure.t
160 +++ $TESTTMP/test-failure.t.err
167 +++ $TESTTMP/test-failure.t.err
161 @@ -1,4 +1,4 @@
168 @@ -1,4 +1,4 @@
162 $ echo babar
169 $ echo babar
163 - rataxes
170 - rataxes
164 + babar
171 + babar
165 This is a noop statement so that
172 This is a noop statement so that
166 this test is still more bytes than success.
173 this test is still more bytes than success.
167
174
168 ERROR: test-failure.t output changed
175 ERROR: test-failure.t output changed
169 !
176 !
170 Failed test-failure.t: output changed
177 Failed test-failure.t: output changed
171 # Ran 1 tests, 0 skipped, 0 warned, 1 failed.
178 # Ran 1 tests, 0 skipped, 0 warned, 1 failed.
172 python hash seed: * (glob)
179 python hash seed: * (glob)
173 [1]
180 [1]
174
181
175 failure w/ keyword
182 failure w/ keyword
176 $ $TESTDIR/run-tests.py --with-hg=`which hg` -k rataxes
183 $ $TESTDIR/run-tests.py --with-hg=`which hg` -k rataxes
177
184
178 --- $TESTTMP/test-failure.t
185 --- $TESTTMP/test-failure.t
179 +++ $TESTTMP/test-failure.t.err
186 +++ $TESTTMP/test-failure.t.err
180 @@ -1,4 +1,4 @@
187 @@ -1,4 +1,4 @@
181 $ echo babar
188 $ echo babar
182 - rataxes
189 - rataxes
183 + babar
190 + babar
184 This is a noop statement so that
191 This is a noop statement so that
185 this test is still more bytes than success.
192 this test is still more bytes than success.
186
193
187 ERROR: test-failure.t output changed
194 ERROR: test-failure.t output changed
188 !
195 !
189 Failed test-failure.t: output changed
196 Failed test-failure.t: output changed
190 # Ran 2 tests, 1 skipped, 0 warned, 1 failed.
197 # Ran 2 tests, 1 skipped, 0 warned, 1 failed.
191 python hash seed: * (glob)
198 python hash seed: * (glob)
192 [1]
199 [1]
193
200
194 Verify that when a process fails to start we show a useful message
201 Verify that when a process fails to start we show a useful message
195 ==================================================================
202 ==================================================================
196 NOTE: there is currently a bug where this shows "2 failed" even though
203 NOTE: there is currently a bug where this shows "2 failed" even though
197 it's actually the same test being reported for failure twice.
204 it's actually the same test being reported for failure twice.
198
205
199 $ cat > test-serve-fail.t <<EOF
206 $ cat > test-serve-fail.t <<EOF
200 > $ echo 'abort: child process failed to start blah'
207 > $ echo 'abort: child process failed to start blah'
201 > EOF
208 > EOF
202 $ $TESTDIR/run-tests.py --with-hg=`which hg` test-serve-fail.t
209 $ $TESTDIR/run-tests.py --with-hg=`which hg` test-serve-fail.t
203
210
204 ERROR: test-serve-fail.t output changed
211 ERROR: test-serve-fail.t output changed
205 !
212 !
206 ERROR: test-serve-fail.t output changed
213 ERROR: test-serve-fail.t output changed
207 !
214 !
208 Failed test-serve-fail.t: server failed to start (HGPORT=*) (glob)
215 Failed test-serve-fail.t: server failed to start (HGPORT=*) (glob)
209 Failed test-serve-fail.t: output changed
216 Failed test-serve-fail.t: output changed
210 # Ran 1 tests, 0 skipped, 0 warned, 2 failed.
217 # Ran 1 tests, 0 skipped, 0 warned, 2 failed.
211 python hash seed: * (glob)
218 python hash seed: * (glob)
212 [1]
219 [1]
213 $ rm test-serve-fail.t
220 $ rm test-serve-fail.t
214
221
215 Running In Debug Mode
222 Running In Debug Mode
216 ======================
223 ======================
217
224
218 $ $TESTDIR/run-tests.py --with-hg=`which hg` --debug 2>&1 | grep -v pwd
225 $ $TESTDIR/run-tests.py --with-hg=`which hg` --debug 2>&1 | grep -v pwd
219 + echo *SALT* 0 0 (glob)
226 + echo *SALT* 0 0 (glob)
220 *SALT* 0 0 (glob)
227 *SALT* 0 0 (glob)
221 + echo babar
228 + echo babar
222 babar
229 babar
223 + echo *SALT* 4 0 (glob)
230 + echo *SALT* 4 0 (glob)
224 *SALT* 4 0 (glob)
231 *SALT* 4 0 (glob)
225 .+ echo *SALT* 0 0 (glob)
232 .+ echo *SALT* 0 0 (glob)
226 *SALT* 0 0 (glob)
233 *SALT* 0 0 (glob)
227 + echo babar
234 + echo babar
228 babar
235 babar
229 + echo *SALT* 2 0 (glob)
236 + echo *SALT* 2 0 (glob)
230 *SALT* 2 0 (glob)
237 *SALT* 2 0 (glob)
231 + echo xyzzy
238 + echo xyzzy
232 xyzzy
239 xyzzy
233 + echo *SALT* 4 0 (glob)
240 + echo *SALT* 4 0 (glob)
234 *SALT* 4 0 (glob)
241 *SALT* 4 0 (glob)
235 .
242 .
236 # Ran 2 tests, 0 skipped, 0 warned, 0 failed.
243 # Ran 2 tests, 0 skipped, 0 warned, 0 failed.
237
244
238 Parallel runs
245 Parallel runs
239 ==============
246 ==============
240
247
241 (duplicate the failing test to get predictable output)
248 (duplicate the failing test to get predictable output)
242 $ cp test-failure.t test-failure-copy.t
249 $ cp test-failure.t test-failure-copy.t
243
250
244 $ $TESTDIR/run-tests.py --with-hg=`which hg` --jobs 2 test-failure*.t -n
251 $ $TESTDIR/run-tests.py --with-hg=`which hg` --jobs 2 test-failure*.t -n
245 !!
252 !!
246 Failed test-failure*.t: output changed (glob)
253 Failed test-failure*.t: output changed (glob)
247 Failed test-failure*.t: output changed (glob)
254 Failed test-failure*.t: output changed (glob)
248 # Ran 2 tests, 0 skipped, 0 warned, 2 failed.
255 # Ran 2 tests, 0 skipped, 0 warned, 2 failed.
249 python hash seed: * (glob)
256 python hash seed: * (glob)
250 [1]
257 [1]
251
258
252 failures in parallel with --first should only print one failure
259 failures in parallel with --first should only print one failure
253 >>> f = open('test-nothing.t', 'w')
260 >>> f = open('test-nothing.t', 'w')
254 >>> f.write('foo\n' * 1024)
261 >>> f.write('foo\n' * 1024)
255 >>> f.write(' $ sleep 1')
262 >>> f.write(' $ sleep 1')
256 $ $TESTDIR/run-tests.py --with-hg=`which hg` --jobs 2 --first
263 $ $TESTDIR/run-tests.py --with-hg=`which hg` --jobs 2 --first
257
264
258 --- $TESTTMP/test-failure*.t (glob)
265 --- $TESTTMP/test-failure*.t (glob)
259 +++ $TESTTMP/test-failure*.t.err (glob)
266 +++ $TESTTMP/test-failure*.t.err (glob)
260 @@ -1,4 +1,4 @@
267 @@ -1,4 +1,4 @@
261 $ echo babar
268 $ echo babar
262 - rataxes
269 - rataxes
263 + babar
270 + babar
264 This is a noop statement so that
271 This is a noop statement so that
265 this test is still more bytes than success.
272 this test is still more bytes than success.
266
273
267 Failed test-failure*.t: output changed (glob)
274 Failed test-failure*.t: output changed (glob)
268 Failed test-nothing.t: output changed
275 Failed test-nothing.t: output changed
269 # Ran 2 tests, 0 skipped, 0 warned, 2 failed.
276 # Ran 2 tests, 0 skipped, 0 warned, 2 failed.
270 python hash seed: * (glob)
277 python hash seed: * (glob)
271 [1]
278 [1]
272
279
273
280
274 (delete the duplicated test file)
281 (delete the duplicated test file)
275 $ rm test-failure-copy.t test-nothing.t
282 $ rm test-failure-copy.t test-nothing.t
276
283
277
284
278 Interactive run
285 Interactive run
279 ===============
286 ===============
280
287
281 (backup the failing test)
288 (backup the failing test)
282 $ cp test-failure.t backup
289 $ cp test-failure.t backup
283
290
284 Refuse the fix
291 Refuse the fix
285
292
286 $ echo 'n' | $TESTDIR/run-tests.py --with-hg=`which hg` -i
293 $ echo 'n' | $TESTDIR/run-tests.py --with-hg=`which hg` -i
287
294
288 --- $TESTTMP/test-failure.t
295 --- $TESTTMP/test-failure.t
289 +++ $TESTTMP/test-failure.t.err
296 +++ $TESTTMP/test-failure.t.err
290 @@ -1,4 +1,4 @@
297 @@ -1,4 +1,4 @@
291 $ echo babar
298 $ echo babar
292 - rataxes
299 - rataxes
293 + babar
300 + babar
294 This is a noop statement so that
301 This is a noop statement so that
295 this test is still more bytes than success.
302 this test is still more bytes than success.
296 Accept this change? [n]
303 Accept this change? [n]
297 ERROR: test-failure.t output changed
304 ERROR: test-failure.t output changed
298 !.
305 !.
299 Failed test-failure.t: output changed
306 Failed test-failure.t: output changed
300 # Ran 2 tests, 0 skipped, 0 warned, 1 failed.
307 # Ran 2 tests, 0 skipped, 0 warned, 1 failed.
301 python hash seed: * (glob)
308 python hash seed: * (glob)
302 [1]
309 [1]
303
310
304 $ cat test-failure.t
311 $ cat test-failure.t
305 $ echo babar
312 $ echo babar
306 rataxes
313 rataxes
307 This is a noop statement so that
314 This is a noop statement so that
308 this test is still more bytes than success.
315 this test is still more bytes than success.
309
316
310 Interactive with custom view
317 Interactive with custom view
311
318
312 $ echo 'n' | $TESTDIR/run-tests.py --with-hg=`which hg` -i --view echo
319 $ echo 'n' | $TESTDIR/run-tests.py --with-hg=`which hg` -i --view echo
313 $TESTTMP/test-failure.t $TESTTMP/test-failure.t.err (glob)
320 $TESTTMP/test-failure.t $TESTTMP/test-failure.t.err (glob)
314 Accept this change? [n]* (glob)
321 Accept this change? [n]* (glob)
315 ERROR: test-failure.t output changed
322 ERROR: test-failure.t output changed
316 !.
323 !.
317 Failed test-failure.t: output changed
324 Failed test-failure.t: output changed
318 # Ran 2 tests, 0 skipped, 0 warned, 1 failed.
325 # Ran 2 tests, 0 skipped, 0 warned, 1 failed.
319 python hash seed: * (glob)
326 python hash seed: * (glob)
320 [1]
327 [1]
321
328
322 View the fix
329 View the fix
323
330
324 $ echo 'y' | $TESTDIR/run-tests.py --with-hg=`which hg` --view echo
331 $ echo 'y' | $TESTDIR/run-tests.py --with-hg=`which hg` --view echo
325 $TESTTMP/test-failure.t $TESTTMP/test-failure.t.err (glob)
332 $TESTTMP/test-failure.t $TESTTMP/test-failure.t.err (glob)
326
333
327 ERROR: test-failure.t output changed
334 ERROR: test-failure.t output changed
328 !.
335 !.
329 Failed test-failure.t: output changed
336 Failed test-failure.t: output changed
330 # Ran 2 tests, 0 skipped, 0 warned, 1 failed.
337 # Ran 2 tests, 0 skipped, 0 warned, 1 failed.
331 python hash seed: * (glob)
338 python hash seed: * (glob)
332 [1]
339 [1]
333
340
334 Accept the fix
341 Accept the fix
335
342
336 $ echo " $ echo 'saved backup bundle to \$TESTTMP/foo.hg'" >> test-failure.t
343 $ echo " $ echo 'saved backup bundle to \$TESTTMP/foo.hg'" >> test-failure.t
337 $ echo " saved backup bundle to \$TESTTMP/foo.hg" >> test-failure.t
344 $ echo " saved backup bundle to \$TESTTMP/foo.hg" >> test-failure.t
338 $ echo " $ echo 'saved backup bundle to \$TESTTMP/foo.hg'" >> test-failure.t
345 $ echo " $ echo 'saved backup bundle to \$TESTTMP/foo.hg'" >> test-failure.t
339 $ echo " saved backup bundle to \$TESTTMP/foo.hg (glob)" >> test-failure.t
346 $ echo " saved backup bundle to \$TESTTMP/foo.hg (glob)" >> test-failure.t
340 $ echo " $ echo 'saved backup bundle to \$TESTTMP/foo.hg'" >> test-failure.t
347 $ echo " $ echo 'saved backup bundle to \$TESTTMP/foo.hg'" >> test-failure.t
341 $ echo " saved backup bundle to \$TESTTMP/*.hg (glob)" >> test-failure.t
348 $ echo " saved backup bundle to \$TESTTMP/*.hg (glob)" >> test-failure.t
342 $ echo 'y' | $TESTDIR/run-tests.py --with-hg=`which hg` -i 2>&1 | \
349 $ echo 'y' | $TESTDIR/run-tests.py --with-hg=`which hg` -i 2>&1 | \
343 > sed -e 's,(glob)$,&<,g'
350 > sed -e 's,(glob)$,&<,g'
344
351
345 --- $TESTTMP/test-failure.t
352 --- $TESTTMP/test-failure.t
346 +++ $TESTTMP/test-failure.t.err
353 +++ $TESTTMP/test-failure.t.err
347 @@ -1,9 +1,9 @@
354 @@ -1,9 +1,9 @@
348 $ echo babar
355 $ echo babar
349 - rataxes
356 - rataxes
350 + babar
357 + babar
351 This is a noop statement so that
358 This is a noop statement so that
352 this test is still more bytes than success.
359 this test is still more bytes than success.
353 $ echo 'saved backup bundle to $TESTTMP/foo.hg'
360 $ echo 'saved backup bundle to $TESTTMP/foo.hg'
354 - saved backup bundle to $TESTTMP/foo.hg
361 - saved backup bundle to $TESTTMP/foo.hg
355 + saved backup bundle to $TESTTMP/foo.hg (glob)<
362 + saved backup bundle to $TESTTMP/foo.hg (glob)<
356 $ echo 'saved backup bundle to $TESTTMP/foo.hg'
363 $ echo 'saved backup bundle to $TESTTMP/foo.hg'
357 saved backup bundle to $TESTTMP/foo.hg (glob)<
364 saved backup bundle to $TESTTMP/foo.hg (glob)<
358 $ echo 'saved backup bundle to $TESTTMP/foo.hg'
365 $ echo 'saved backup bundle to $TESTTMP/foo.hg'
359 Accept this change? [n] ..
366 Accept this change? [n] ..
360 # Ran 2 tests, 0 skipped, 0 warned, 0 failed.
367 # Ran 2 tests, 0 skipped, 0 warned, 0 failed.
361
368
362 $ sed -e 's,(glob)$,&<,g' test-failure.t
369 $ sed -e 's,(glob)$,&<,g' test-failure.t
363 $ echo babar
370 $ echo babar
364 babar
371 babar
365 This is a noop statement so that
372 This is a noop statement so that
366 this test is still more bytes than success.
373 this test is still more bytes than success.
367 $ echo 'saved backup bundle to $TESTTMP/foo.hg'
374 $ echo 'saved backup bundle to $TESTTMP/foo.hg'
368 saved backup bundle to $TESTTMP/foo.hg (glob)<
375 saved backup bundle to $TESTTMP/foo.hg (glob)<
369 $ echo 'saved backup bundle to $TESTTMP/foo.hg'
376 $ echo 'saved backup bundle to $TESTTMP/foo.hg'
370 saved backup bundle to $TESTTMP/foo.hg (glob)<
377 saved backup bundle to $TESTTMP/foo.hg (glob)<
371 $ echo 'saved backup bundle to $TESTTMP/foo.hg'
378 $ echo 'saved backup bundle to $TESTTMP/foo.hg'
372 saved backup bundle to $TESTTMP/*.hg (glob)<
379 saved backup bundle to $TESTTMP/*.hg (glob)<
373
380
374 (reinstall)
381 (reinstall)
375 $ mv backup test-failure.t
382 $ mv backup test-failure.t
376
383
377 No Diff
384 No Diff
378 ===============
385 ===============
379
386
380 $ $TESTDIR/run-tests.py --with-hg=`which hg` --nodiff
387 $ $TESTDIR/run-tests.py --with-hg=`which hg` --nodiff
381 !.
388 !.
382 Failed test-failure.t: output changed
389 Failed test-failure.t: output changed
383 # Ran 2 tests, 0 skipped, 0 warned, 1 failed.
390 # Ran 2 tests, 0 skipped, 0 warned, 1 failed.
384 python hash seed: * (glob)
391 python hash seed: * (glob)
385 [1]
392 [1]
386
393
387 test for --time
394 test for --time
388 ==================
395 ==================
389
396
390 $ $TESTDIR/run-tests.py --with-hg=`which hg` test-success.t --time
397 $ $TESTDIR/run-tests.py --with-hg=`which hg` test-success.t --time
391 .
398 .
392 # Ran 1 tests, 0 skipped, 0 warned, 0 failed.
399 # Ran 1 tests, 0 skipped, 0 warned, 0 failed.
393 # Producing time report
400 # Producing time report
394 cuser csys real Test
401 cuser csys real Test
395 \s*[\d\.]{5} \s*[\d\.]{5} \s*[\d\.]{5} test-success.t (re)
402 \s*[\d\.]{5} \s*[\d\.]{5} \s*[\d\.]{5} test-success.t (re)
396
403
397 test for --time with --job enabled
404 test for --time with --job enabled
398 ====================================
405 ====================================
399
406
400 $ $TESTDIR/run-tests.py --with-hg=`which hg` test-success.t --time --jobs 2
407 $ $TESTDIR/run-tests.py --with-hg=`which hg` test-success.t --time --jobs 2
401 .
408 .
402 # Ran 1 tests, 0 skipped, 0 warned, 0 failed.
409 # Ran 1 tests, 0 skipped, 0 warned, 0 failed.
403 # Producing time report
410 # Producing time report
404 cuser csys real Test
411 cuser csys real Test
405 \s*[\d\.]{5} \s*[\d\.]{5} \s*[\d\.]{5} test-success.t (re)
412 \s*[\d\.]{5} \s*[\d\.]{5} \s*[\d\.]{5} test-success.t (re)
406
413
407 Skips
414 Skips
408 ================
415 ================
409 $ cat > test-skip.t <<EOF
416 $ cat > test-skip.t <<EOF
410 > $ echo xyzzy
417 > $ echo xyzzy
411 > #require false
418 > #require false
412 > EOF
419 > EOF
413 $ $TESTDIR/run-tests.py --with-hg=`which hg` --nodiff
420 $ $TESTDIR/run-tests.py --with-hg=`which hg` --nodiff
414 !.s
421 !.s
415 Skipped test-skip.t: skipped
422 Skipped test-skip.t: skipped
416 Failed test-failure.t: output changed
423 Failed test-failure.t: output changed
417 # Ran 2 tests, 1 skipped, 0 warned, 1 failed.
424 # Ran 2 tests, 1 skipped, 0 warned, 1 failed.
418 python hash seed: * (glob)
425 python hash seed: * (glob)
419 [1]
426 [1]
420
427
421 $ $TESTDIR/run-tests.py --with-hg=`which hg` --keyword xyzzy
428 $ $TESTDIR/run-tests.py --with-hg=`which hg` --keyword xyzzy
422 .s
429 .s
423 Skipped test-skip.t: skipped
430 Skipped test-skip.t: skipped
424 # Ran 2 tests, 2 skipped, 0 warned, 0 failed.
431 # Ran 2 tests, 2 skipped, 0 warned, 0 failed.
425
432
426 Skips with xml
433 Skips with xml
427 $ $TESTDIR/run-tests.py --with-hg=`which hg` --keyword xyzzy \
434 $ $TESTDIR/run-tests.py --with-hg=`which hg` --keyword xyzzy \
428 > --xunit=xunit.xml
435 > --xunit=xunit.xml
429 .s
436 .s
430 Skipped test-skip.t: skipped
437 Skipped test-skip.t: skipped
431 # Ran 2 tests, 2 skipped, 0 warned, 0 failed.
438 # Ran 2 tests, 2 skipped, 0 warned, 0 failed.
432 $ cat xunit.xml
439 $ cat xunit.xml
433 <?xml version="1.0" encoding="utf-8"?>
440 <?xml version="1.0" encoding="utf-8"?>
434 <testsuite errors="0" failures="0" name="run-tests" skipped="2" tests="2">
441 <testsuite errors="0" failures="0" name="run-tests" skipped="2" tests="2">
435 <testcase name="test-success.t" time="*"/> (glob)
442 <testcase name="test-success.t" time="*"/> (glob)
436 </testsuite>
443 </testsuite>
437
444
438 Missing skips or blacklisted skips don't count as executed:
445 Missing skips or blacklisted skips don't count as executed:
439 $ echo test-failure.t > blacklist
446 $ echo test-failure.t > blacklist
440 $ $TESTDIR/run-tests.py --with-hg=`which hg` --blacklist=blacklist \
447 $ $TESTDIR/run-tests.py --with-hg=`which hg` --blacklist=blacklist \
441 > test-failure.t test-bogus.t
448 > test-failure.t test-bogus.t
442 ss
449 ss
443 Skipped test-bogus.t: Doesn't exist
450 Skipped test-bogus.t: Doesn't exist
444 Skipped test-failure.t: blacklisted
451 Skipped test-failure.t: blacklisted
445 # Ran 0 tests, 2 skipped, 0 warned, 0 failed.
452 # Ran 0 tests, 2 skipped, 0 warned, 0 failed.
446
453
447 #if json
454 #if json
448
455
449 test for --json
456 test for --json
450 ==================
457 ==================
451
458
452 $ $TESTDIR/run-tests.py --with-hg=`which hg` --json
459 $ $TESTDIR/run-tests.py --with-hg=`which hg` --json
453
460
454 --- $TESTTMP/test-failure.t
461 --- $TESTTMP/test-failure.t
455 +++ $TESTTMP/test-failure.t.err
462 +++ $TESTTMP/test-failure.t.err
456 @@ -1,4 +1,4 @@
463 @@ -1,4 +1,4 @@
457 $ echo babar
464 $ echo babar
458 - rataxes
465 - rataxes
459 + babar
466 + babar
460 This is a noop statement so that
467 This is a noop statement so that
461 this test is still more bytes than success.
468 this test is still more bytes than success.
462
469
463 ERROR: test-failure.t output changed
470 ERROR: test-failure.t output changed
464 !.s
471 !.s
465 Skipped test-skip.t: skipped
472 Skipped test-skip.t: skipped
466 Failed test-failure.t: output changed
473 Failed test-failure.t: output changed
467 # Ran 2 tests, 1 skipped, 0 warned, 1 failed.
474 # Ran 2 tests, 1 skipped, 0 warned, 1 failed.
468 python hash seed: * (glob)
475 python hash seed: * (glob)
469 [1]
476 [1]
470
477
471 $ cat report.json
478 $ cat report.json
472 testreport ={
479 testreport ={
473 "test-failure.t": [\{] (re)
480 "test-failure.t": [\{] (re)
474 "csys": "\s*[\d\.]{4,5}", ? (re)
481 "csys": "\s*[\d\.]{4,5}", ? (re)
475 "cuser": "\s*[\d\.]{4,5}", ? (re)
482 "cuser": "\s*[\d\.]{4,5}", ? (re)
476 "result": "failure", ? (re)
483 "result": "failure", ? (re)
477 "time": "\s*[\d\.]{4,5}" (re)
484 "time": "\s*[\d\.]{4,5}" (re)
478 }, ? (re)
485 }, ? (re)
479 "test-skip.t": {
486 "test-skip.t": {
480 "csys": "\s*[\d\.]{4,5}", ? (re)
487 "csys": "\s*[\d\.]{4,5}", ? (re)
481 "cuser": "\s*[\d\.]{4,5}", ? (re)
488 "cuser": "\s*[\d\.]{4,5}", ? (re)
482 "result": "skip", ? (re)
489 "result": "skip", ? (re)
483 "time": "\s*[\d\.]{4,5}" (re)
490 "time": "\s*[\d\.]{4,5}" (re)
484 }, ? (re)
491 }, ? (re)
485 "test-success.t": [\{] (re)
492 "test-success.t": [\{] (re)
486 "csys": "\s*[\d\.]{4,5}", ? (re)
493 "csys": "\s*[\d\.]{4,5}", ? (re)
487 "cuser": "\s*[\d\.]{4,5}", ? (re)
494 "cuser": "\s*[\d\.]{4,5}", ? (re)
488 "result": "success", ? (re)
495 "result": "success", ? (re)
489 "time": "\s*[\d\.]{4,5}" (re)
496 "time": "\s*[\d\.]{4,5}" (re)
490 }
497 }
491 } (no-eol)
498 } (no-eol)
492
499
493 #endif
500 #endif
494
501
495 backslash on end of line with glob matching is handled properly
502 backslash on end of line with glob matching is handled properly
496
503
497 $ cat > test-glob-backslash.t << EOF
504 $ cat > test-glob-backslash.t << EOF
498 > $ echo 'foo bar \\'
505 > $ echo 'foo bar \\'
499 > foo * \ (glob)
506 > foo * \ (glob)
500 > EOF
507 > EOF
501
508
502 $ $TESTDIR/run-tests.py --with-hg=`which hg` test-glob-backslash.t
509 $ $TESTDIR/run-tests.py --with-hg=`which hg` test-glob-backslash.t
503 .
510 .
504 # Ran 1 tests, 0 skipped, 0 warned, 0 failed.
511 # Ran 1 tests, 0 skipped, 0 warned, 0 failed.
505
512
506 $ rm -f test-glob-backslash.t
513 $ rm -f test-glob-backslash.t
507
514
General Comments 0
You need to be logged in to leave comments. Login now