##// END OF EJS Templates
test-run-tests: test --view
Matt Mackall -
r22108:ccae572c default
parent child Browse files
Show More
@@ -1,347 +1,359 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 Smoke test
3 Smoke test
4 ============
4 ============
5
5
6 $ $TESTDIR/run-tests.py
6 $ $TESTDIR/run-tests.py
7
7
8 # Ran 0 tests, 0 skipped, 0 warned, 0 failed.
8 # Ran 0 tests, 0 skipped, 0 warned, 0 failed.
9
9
10 a succesful test
10 a succesful test
11 =======================
11 =======================
12
12
13 $ cat > test-success.t << EOF
13 $ cat > test-success.t << EOF
14 > $ echo babar
14 > $ echo babar
15 > babar
15 > babar
16 > $ echo xyzzy
16 > $ echo xyzzy
17 > xyzzy
17 > xyzzy
18 > EOF
18 > EOF
19
19
20 $ $TESTDIR/run-tests.py --with-hg=`which hg`
20 $ $TESTDIR/run-tests.py --with-hg=`which hg`
21 .
21 .
22 # Ran 1 tests, 0 skipped, 0 warned, 0 failed.
22 # Ran 1 tests, 0 skipped, 0 warned, 0 failed.
23
23
24 failing test
24 failing test
25 ==================
25 ==================
26
26
27 $ cat > test-failure.t << EOF
27 $ cat > test-failure.t << EOF
28 > $ echo babar
28 > $ echo babar
29 > rataxes
29 > rataxes
30 > This is a noop statement so that
30 > This is a noop statement so that
31 > this test is still more bytes than success.
31 > this test is still more bytes than success.
32 > EOF
32 > EOF
33
33
34 $ $TESTDIR/run-tests.py --with-hg=`which hg`
34 $ $TESTDIR/run-tests.py --with-hg=`which hg`
35
35
36 --- $TESTTMP/test-failure.t
36 --- $TESTTMP/test-failure.t
37 +++ $TESTTMP/test-failure.t.err
37 +++ $TESTTMP/test-failure.t.err
38 @@ -1,4 +1,4 @@
38 @@ -1,4 +1,4 @@
39 $ echo babar
39 $ echo babar
40 - rataxes
40 - rataxes
41 + babar
41 + babar
42 This is a noop statement so that
42 This is a noop statement so that
43 this test is still more bytes than success.
43 this test is still more bytes than success.
44
44
45 ERROR: test-failure.t output changed
45 ERROR: test-failure.t output changed
46 !.
46 !.
47 Failed test-failure.t: output changed
47 Failed test-failure.t: output changed
48 # Ran 2 tests, 0 skipped, 0 warned, 1 failed.
48 # Ran 2 tests, 0 skipped, 0 warned, 1 failed.
49 python hash seed: * (glob)
49 python hash seed: * (glob)
50 [1]
50 [1]
51 test --xunit support
51 test --xunit support
52 $ $TESTDIR/run-tests.py --with-hg=`which hg` --xunit=xunit.xml
52 $ $TESTDIR/run-tests.py --with-hg=`which hg` --xunit=xunit.xml
53
53
54 --- $TESTTMP/test-failure.t
54 --- $TESTTMP/test-failure.t
55 +++ $TESTTMP/test-failure.t.err
55 +++ $TESTTMP/test-failure.t.err
56 @@ -1,4 +1,4 @@
56 @@ -1,4 +1,4 @@
57 $ echo babar
57 $ echo babar
58 - rataxes
58 - rataxes
59 + babar
59 + babar
60 This is a noop statement so that
60 This is a noop statement so that
61 this test is still more bytes than success.
61 this test is still more bytes than success.
62
62
63 ERROR: test-failure.t output changed
63 ERROR: test-failure.t output changed
64 !.
64 !.
65 Failed test-failure.t: output changed
65 Failed test-failure.t: output changed
66 # Ran 2 tests, 0 skipped, 0 warned, 1 failed.
66 # Ran 2 tests, 0 skipped, 0 warned, 1 failed.
67 python hash seed: * (glob)
67 python hash seed: * (glob)
68 [1]
68 [1]
69 $ cat xunit.xml
69 $ cat xunit.xml
70 <?xml version="1.0" encoding="utf-8"?>
70 <?xml version="1.0" encoding="utf-8"?>
71 <testsuite errors="0" failures="1" name="run-tests" skipped="0" tests="2">
71 <testsuite errors="0" failures="1" name="run-tests" skipped="0" tests="2">
72 <testcase name="test-success.t" time="*"/> (glob)
72 <testcase name="test-success.t" time="*"/> (glob)
73 <testcase name="test-failure.t" time="*"> (glob)
73 <testcase name="test-failure.t" time="*"> (glob)
74 <![CDATA[--- $TESTTMP/test-failure.t
74 <![CDATA[--- $TESTTMP/test-failure.t
75 +++ $TESTTMP/test-failure.t.err
75 +++ $TESTTMP/test-failure.t.err
76 @@ -1,4 +1,4 @@
76 @@ -1,4 +1,4 @@
77 $ echo babar
77 $ echo babar
78 - rataxes
78 - rataxes
79 + babar
79 + babar
80 This is a noop statement so that
80 This is a noop statement so that
81 this test is still more bytes than success.
81 this test is still more bytes than success.
82 ]]> </testcase>
82 ]]> </testcase>
83 </testsuite>
83 </testsuite>
84
84
85 test for --retest
85 test for --retest
86 ====================
86 ====================
87
87
88 $ $TESTDIR/run-tests.py --with-hg=`which hg` --retest
88 $ $TESTDIR/run-tests.py --with-hg=`which hg` --retest
89
89
90 --- $TESTTMP/test-failure.t
90 --- $TESTTMP/test-failure.t
91 +++ $TESTTMP/test-failure.t.err
91 +++ $TESTTMP/test-failure.t.err
92 @@ -1,4 +1,4 @@
92 @@ -1,4 +1,4 @@
93 $ echo babar
93 $ echo babar
94 - rataxes
94 - rataxes
95 + babar
95 + babar
96 This is a noop statement so that
96 This is a noop statement so that
97 this test is still more bytes than success.
97 this test is still more bytes than success.
98
98
99 ERROR: test-failure.t output changed
99 ERROR: test-failure.t output changed
100 !
100 !
101 Failed test-failure.t: output changed
101 Failed test-failure.t: output changed
102 # Ran 2 tests, 1 skipped, 0 warned, 1 failed.
102 # Ran 2 tests, 1 skipped, 0 warned, 1 failed.
103 python hash seed: * (glob)
103 python hash seed: * (glob)
104 [1]
104 [1]
105
105
106 Selecting Tests To Run
106 Selecting Tests To Run
107 ======================
107 ======================
108
108
109 successful
109 successful
110
110
111 $ $TESTDIR/run-tests.py --with-hg=`which hg` test-success.t
111 $ $TESTDIR/run-tests.py --with-hg=`which hg` test-success.t
112 .
112 .
113 # Ran 1 tests, 0 skipped, 0 warned, 0 failed.
113 # Ran 1 tests, 0 skipped, 0 warned, 0 failed.
114
114
115 success w/ keyword
115 success w/ keyword
116 $ $TESTDIR/run-tests.py --with-hg=`which hg` -k xyzzy
116 $ $TESTDIR/run-tests.py --with-hg=`which hg` -k xyzzy
117 .
117 .
118 # Ran 2 tests, 1 skipped, 0 warned, 0 failed.
118 # Ran 2 tests, 1 skipped, 0 warned, 0 failed.
119
119
120 failed
120 failed
121
121
122 $ $TESTDIR/run-tests.py --with-hg=`which hg` test-failure.t
122 $ $TESTDIR/run-tests.py --with-hg=`which hg` test-failure.t
123
123
124 --- $TESTTMP/test-failure.t
124 --- $TESTTMP/test-failure.t
125 +++ $TESTTMP/test-failure.t.err
125 +++ $TESTTMP/test-failure.t.err
126 @@ -1,4 +1,4 @@
126 @@ -1,4 +1,4 @@
127 $ echo babar
127 $ echo babar
128 - rataxes
128 - rataxes
129 + babar
129 + babar
130 This is a noop statement so that
130 This is a noop statement so that
131 this test is still more bytes than success.
131 this test is still more bytes than success.
132
132
133 ERROR: test-failure.t output changed
133 ERROR: test-failure.t output changed
134 !
134 !
135 Failed test-failure.t: output changed
135 Failed test-failure.t: output changed
136 # Ran 1 tests, 0 skipped, 0 warned, 1 failed.
136 # Ran 1 tests, 0 skipped, 0 warned, 1 failed.
137 python hash seed: * (glob)
137 python hash seed: * (glob)
138 [1]
138 [1]
139
139
140 failure w/ keyword
140 failure w/ keyword
141 $ $TESTDIR/run-tests.py --with-hg=`which hg` -k rataxes
141 $ $TESTDIR/run-tests.py --with-hg=`which hg` -k rataxes
142
142
143 --- $TESTTMP/test-failure.t
143 --- $TESTTMP/test-failure.t
144 +++ $TESTTMP/test-failure.t.err
144 +++ $TESTTMP/test-failure.t.err
145 @@ -1,4 +1,4 @@
145 @@ -1,4 +1,4 @@
146 $ echo babar
146 $ echo babar
147 - rataxes
147 - rataxes
148 + babar
148 + babar
149 This is a noop statement so that
149 This is a noop statement so that
150 this test is still more bytes than success.
150 this test is still more bytes than success.
151
151
152 ERROR: test-failure.t output changed
152 ERROR: test-failure.t output changed
153 !
153 !
154 Failed test-failure.t: output changed
154 Failed test-failure.t: output changed
155 # Ran 2 tests, 1 skipped, 0 warned, 1 failed.
155 # Ran 2 tests, 1 skipped, 0 warned, 1 failed.
156 python hash seed: * (glob)
156 python hash seed: * (glob)
157 [1]
157 [1]
158
158
159 Running In Debug Mode
159 Running In Debug Mode
160 ======================
160 ======================
161
161
162 $ $TESTDIR/run-tests.py --with-hg=`which hg` --debug
162 $ $TESTDIR/run-tests.py --with-hg=`which hg` --debug
163 + echo SALT* 0 0 (glob)
163 + echo SALT* 0 0 (glob)
164 SALT* 0 0 (glob)
164 SALT* 0 0 (glob)
165 + echo babar
165 + echo babar
166 babar
166 babar
167 + echo SALT* 4 0 (glob)
167 + echo SALT* 4 0 (glob)
168 SALT* 4 0 (glob)
168 SALT* 4 0 (glob)
169 .+ echo SALT* 0 0 (glob)
169 .+ echo SALT* 0 0 (glob)
170 SALT* 0 0 (glob)
170 SALT* 0 0 (glob)
171 + echo babar
171 + echo babar
172 babar
172 babar
173 + echo SALT* 2 0 (glob)
173 + echo SALT* 2 0 (glob)
174 SALT* 2 0 (glob)
174 SALT* 2 0 (glob)
175 + echo xyzzy
175 + echo xyzzy
176 xyzzy
176 xyzzy
177 + echo SALT* 4 0 (glob)
177 + echo SALT* 4 0 (glob)
178 SALT* 4 0 (glob)
178 SALT* 4 0 (glob)
179 .
179 .
180 # Ran 2 tests, 0 skipped, 0 warned, 0 failed.
180 # Ran 2 tests, 0 skipped, 0 warned, 0 failed.
181
181
182 Parallel runs
182 Parallel runs
183 ==============
183 ==============
184
184
185 (duplicate the failing test to get predictable output)
185 (duplicate the failing test to get predictable output)
186 $ cp test-failure.t test-failure-copy.t
186 $ cp test-failure.t test-failure-copy.t
187
187
188 $ $TESTDIR/run-tests.py --with-hg=`which hg` --jobs 2 test-failure*.t
188 $ $TESTDIR/run-tests.py --with-hg=`which hg` --jobs 2 test-failure*.t
189
189
190 --- $TESTTMP/test-failure*.t (glob)
190 --- $TESTTMP/test-failure*.t (glob)
191 +++ $TESTTMP/test-failure*.t.err (glob)
191 +++ $TESTTMP/test-failure*.t.err (glob)
192 @@ -1,4 +1,4 @@
192 @@ -1,4 +1,4 @@
193 $ echo babar
193 $ echo babar
194 - rataxes
194 - rataxes
195 + babar
195 + babar
196 This is a noop statement so that
196 This is a noop statement so that
197 this test is still more bytes than success.
197 this test is still more bytes than success.
198
198
199 ERROR: test-failure*.t output changed (glob)
199 ERROR: test-failure*.t output changed (glob)
200 !
200 !
201 --- $TESTTMP/test-failure*.t (glob)
201 --- $TESTTMP/test-failure*.t (glob)
202 +++ $TESTTMP/test-failure*.t.err (glob)
202 +++ $TESTTMP/test-failure*.t.err (glob)
203 @@ -1,4 +1,4 @@
203 @@ -1,4 +1,4 @@
204 $ echo babar
204 $ echo babar
205 - rataxes
205 - rataxes
206 + babar
206 + babar
207 This is a noop statement so that
207 This is a noop statement so that
208 this test is still more bytes than success.
208 this test is still more bytes than success.
209
209
210 ERROR: test-failure*.t output changed (glob)
210 ERROR: test-failure*.t output changed (glob)
211 !
211 !
212 Failed test-failure*.t: output changed (glob)
212 Failed test-failure*.t: output changed (glob)
213 Failed test-failure*.t: output changed (glob)
213 Failed test-failure*.t: output changed (glob)
214 # Ran 2 tests, 0 skipped, 0 warned, 2 failed.
214 # Ran 2 tests, 0 skipped, 0 warned, 2 failed.
215 python hash seed: * (glob)
215 python hash seed: * (glob)
216 [1]
216 [1]
217
217
218 (delete the duplicated test file)
218 (delete the duplicated test file)
219 $ rm test-failure-copy.t
219 $ rm test-failure-copy.t
220
220
221
221
222 Interactive run
222 Interactive run
223 ===============
223 ===============
224
224
225 (backup the failing test)
225 (backup the failing test)
226 $ cp test-failure.t backup
226 $ cp test-failure.t backup
227
227
228 Refuse the fix
228 Refuse the fix
229
229
230 $ echo 'n' | $TESTDIR/run-tests.py --with-hg=`which hg` -i
230 $ echo 'n' | $TESTDIR/run-tests.py --with-hg=`which hg` -i
231
231
232 --- $TESTTMP/test-failure.t
232 --- $TESTTMP/test-failure.t
233 +++ $TESTTMP/test-failure.t.err
233 +++ $TESTTMP/test-failure.t.err
234 @@ -1,4 +1,4 @@
234 @@ -1,4 +1,4 @@
235 $ echo babar
235 $ echo babar
236 - rataxes
236 - rataxes
237 + babar
237 + babar
238 This is a noop statement so that
238 This is a noop statement so that
239 this test is still more bytes than success.
239 this test is still more bytes than success.
240 Accept this change? [n]
240 Accept this change? [n]
241 ERROR: test-failure.t output changed
241 ERROR: test-failure.t output changed
242 !.
242 !.
243 Failed test-failure.t: output changed
243 Failed test-failure.t: output changed
244 # Ran 2 tests, 0 skipped, 0 warned, 1 failed.
244 # Ran 2 tests, 0 skipped, 0 warned, 1 failed.
245 python hash seed: * (glob)
245 python hash seed: * (glob)
246 [1]
246 [1]
247
247
248 $ cat test-failure.t
248 $ cat test-failure.t
249 $ echo babar
249 $ echo babar
250 rataxes
250 rataxes
251 This is a noop statement so that
251 This is a noop statement so that
252 this test is still more bytes than success.
252 this test is still more bytes than success.
253
253
254 View the fix
255
256 $ echo 'y' | $TESTDIR/run-tests.py --with-hg=`which hg` --view echo
257 $TESTTMP/test-failure.t $TESTTMP/test-failure.t.err
258
259 ERROR: test-failure.t output changed
260 !.
261 Failed test-failure.t: output changed
262 # Ran 2 tests, 0 skipped, 0 warned, 1 failed.
263 python hash seed: * (glob)
264 [1]
265
254 Accept the fix
266 Accept the fix
255
267
256 $ echo 'y' | $TESTDIR/run-tests.py --with-hg=`which hg` -i
268 $ echo 'y' | $TESTDIR/run-tests.py --with-hg=`which hg` -i
257
269
258 --- $TESTTMP/test-failure.t
270 --- $TESTTMP/test-failure.t
259 +++ $TESTTMP/test-failure.t.err
271 +++ $TESTTMP/test-failure.t.err
260 @@ -1,4 +1,4 @@
272 @@ -1,4 +1,4 @@
261 $ echo babar
273 $ echo babar
262 - rataxes
274 - rataxes
263 + babar
275 + babar
264 This is a noop statement so that
276 This is a noop statement so that
265 this test is still more bytes than success.
277 this test is still more bytes than success.
266 Accept this change? [n] ..
278 Accept this change? [n] ..
267 # Ran 2 tests, 0 skipped, 0 warned, 0 failed.
279 # Ran 2 tests, 0 skipped, 0 warned, 0 failed.
268
280
269 $ cat test-failure.t
281 $ cat test-failure.t
270 $ echo babar
282 $ echo babar
271 babar
283 babar
272 This is a noop statement so that
284 This is a noop statement so that
273 this test is still more bytes than success.
285 this test is still more bytes than success.
274
286
275 (reinstall)
287 (reinstall)
276 $ mv backup test-failure.t
288 $ mv backup test-failure.t
277
289
278 No Diff
290 No Diff
279 ===============
291 ===============
280
292
281 $ $TESTDIR/run-tests.py --with-hg=`which hg` --nodiff
293 $ $TESTDIR/run-tests.py --with-hg=`which hg` --nodiff
282 !.
294 !.
283 Failed test-failure.t: output changed
295 Failed test-failure.t: output changed
284 # Ran 2 tests, 0 skipped, 0 warned, 1 failed.
296 # Ran 2 tests, 0 skipped, 0 warned, 1 failed.
285 python hash seed: * (glob)
297 python hash seed: * (glob)
286 [1]
298 [1]
287
299
288 test for --time
300 test for --time
289 ==================
301 ==================
290
302
291 $ $TESTDIR/run-tests.py --with-hg=`which hg` test-success.t --time
303 $ $TESTDIR/run-tests.py --with-hg=`which hg` test-success.t --time
292 .
304 .
293 # Ran 1 tests, 0 skipped, 0 warned, 0 failed.
305 # Ran 1 tests, 0 skipped, 0 warned, 0 failed.
294 # Producing time report
306 # Producing time report
295 cuser csys real Test
307 cuser csys real Test
296 \s*[\d\.]{5} \s*[\d\.]{5} \s*[\d\.]{5} test-success.t (re)
308 \s*[\d\.]{5} \s*[\d\.]{5} \s*[\d\.]{5} test-success.t (re)
297
309
298 test for --time with --job enabled
310 test for --time with --job enabled
299 ====================================
311 ====================================
300
312
301 $ $TESTDIR/run-tests.py --with-hg=`which hg` test-success.t --time --jobs 2
313 $ $TESTDIR/run-tests.py --with-hg=`which hg` test-success.t --time --jobs 2
302 .
314 .
303 # Ran 1 tests, 0 skipped, 0 warned, 0 failed.
315 # Ran 1 tests, 0 skipped, 0 warned, 0 failed.
304 # Producing time report
316 # Producing time report
305 cuser csys real Test
317 cuser csys real Test
306 \s*[\d\.]{5} \s*[\d\.]{5} \s*[\d\.]{5} test-success.t (re)
318 \s*[\d\.]{5} \s*[\d\.]{5} \s*[\d\.]{5} test-success.t (re)
307
319
308 Skips
320 Skips
309 ================
321 ================
310 $ cat > test-skip.t <<EOF
322 $ cat > test-skip.t <<EOF
311 > $ echo xyzzy
323 > $ echo xyzzy
312 > #require false
324 > #require false
313 > EOF
325 > EOF
314 $ $TESTDIR/run-tests.py --with-hg=`which hg` --nodiff
326 $ $TESTDIR/run-tests.py --with-hg=`which hg` --nodiff
315 !.s
327 !.s
316 Skipped test-skip.t: irrelevant
328 Skipped test-skip.t: irrelevant
317 Failed test-failure.t: output changed
329 Failed test-failure.t: output changed
318 # Ran 2 tests, 1 skipped, 0 warned, 1 failed.
330 # Ran 2 tests, 1 skipped, 0 warned, 1 failed.
319 python hash seed: * (glob)
331 python hash seed: * (glob)
320 [1]
332 [1]
321
333
322 $ $TESTDIR/run-tests.py --with-hg=`which hg` --keyword xyzzy
334 $ $TESTDIR/run-tests.py --with-hg=`which hg` --keyword xyzzy
323 .s
335 .s
324 Skipped test-skip.t: irrelevant
336 Skipped test-skip.t: irrelevant
325 # Ran 2 tests, 2 skipped, 0 warned, 0 failed.
337 # Ran 2 tests, 2 skipped, 0 warned, 0 failed.
326
338
327 Skips with xml
339 Skips with xml
328 $ $TESTDIR/run-tests.py --with-hg=`which hg` --keyword xyzzy \
340 $ $TESTDIR/run-tests.py --with-hg=`which hg` --keyword xyzzy \
329 > --xunit=xunit.xml
341 > --xunit=xunit.xml
330 .s
342 .s
331 Skipped test-skip.t: irrelevant
343 Skipped test-skip.t: irrelevant
332 # Ran 2 tests, 2 skipped, 0 warned, 0 failed.
344 # Ran 2 tests, 2 skipped, 0 warned, 0 failed.
333 $ cat xunit.xml
345 $ cat xunit.xml
334 <?xml version="1.0" encoding="utf-8"?>
346 <?xml version="1.0" encoding="utf-8"?>
335 <testsuite errors="0" failures="0" name="run-tests" skipped="2" tests="2">
347 <testsuite errors="0" failures="0" name="run-tests" skipped="2" tests="2">
336 <testcase name="test-success.t" time="*"/> (glob)
348 <testcase name="test-success.t" time="*"/> (glob)
337 </testsuite>
349 </testsuite>
338
350
339 Missing skips or blacklisted skips don't count as executed:
351 Missing skips or blacklisted skips don't count as executed:
340 $ echo test-failure.t > blacklist
352 $ echo test-failure.t > blacklist
341 $ $TESTDIR/run-tests.py --with-hg=`which hg` --blacklist=blacklist \
353 $ $TESTDIR/run-tests.py --with-hg=`which hg` --blacklist=blacklist \
342 > test-failure.t test-bogus.t
354 > test-failure.t test-bogus.t
343 ss
355 ss
344 Skipped test-bogus.t: Doesn't exist
356 Skipped test-bogus.t: Doesn't exist
345 Skipped test-failure.t: blacklisted
357 Skipped test-failure.t: blacklisted
346 # Ran 0 tests, 2 skipped, 0 warned, 0 failed.
358 # Ran 0 tests, 2 skipped, 0 warned, 0 failed.
347
359
General Comments 0
You need to be logged in to leave comments. Login now