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