##// END OF EJS Templates
tests: conditionalize test-run-tests.t for Python 3.8...
Gregory Szorc -
r43340:1d60a782 default
parent child Browse files
Show More
@@ -1,2005 +1,2010 b''
1 1 This file tests the behavior of run-tests.py itself.
2 2
3 3 Avoid interference from actual test env:
4 4
5 5 $ . "$TESTDIR/helper-runtests.sh"
6 6
7 7 Smoke test with install
8 8 ============
9 9 $ "$PYTHON" $TESTDIR/run-tests.py $HGTEST_RUN_TESTS_PURE -l
10 10 running 0 tests using 0 parallel processes
11 11
12 12 # Ran 0 tests, 0 skipped, 0 failed.
13 13
14 14 Define a helper to avoid the install step
15 15 =============
16 16 $ rt()
17 17 > {
18 18 > "$PYTHON" $TESTDIR/run-tests.py --with-hg=`which hg` -j1 "$@"
19 19 > }
20 20
21 21 error paths
22 22
23 23 #if symlink
24 24 $ ln -s `which true` hg
25 25 $ "$PYTHON" $TESTDIR/run-tests.py --with-hg=./hg
26 26 warning: --with-hg should specify an hg script
27 27 running 0 tests using 0 parallel processes
28 28
29 29 # Ran 0 tests, 0 skipped, 0 failed.
30 30 $ rm hg
31 31 #endif
32 32
33 33 #if execbit
34 34 $ touch hg
35 35 $ "$PYTHON" $TESTDIR/run-tests.py --with-hg=./hg
36 36 usage: run-tests.py [options] [tests]
37 37 run-tests.py: error: --with-hg must specify an executable hg script
38 38 [2]
39 39 $ rm hg
40 40 #endif
41 41
42 42 Features for testing optional lines
43 43 ===================================
44 44
45 45 $ cat > hghaveaddon.py <<EOF
46 46 > import hghave
47 47 > @hghave.check("custom", "custom hghave feature")
48 48 > def has_custom():
49 49 > return True
50 50 > @hghave.check("missing", "missing hghave feature")
51 51 > def has_missing():
52 52 > return False
53 53 > EOF
54 54
55 55 an empty test
56 56 =======================
57 57
58 58 $ touch test-empty.t
59 59 $ rt
60 60 running 1 tests using 1 parallel processes
61 61 .
62 62 # Ran 1 tests, 0 skipped, 0 failed.
63 63 $ rm test-empty.t
64 64
65 65 a succesful test
66 66 =======================
67 67
68 68 $ cat > test-success.t << EOF
69 69 > $ echo babar
70 70 > babar
71 71 > $ echo xyzzy
72 72 > dont_print (?)
73 73 > nothing[42]line (re) (?)
74 74 > never*happens (glob) (?)
75 75 > more_nothing (?)
76 76 > xyzzy
77 77 > nor this (?)
78 78 > $ printf 'abc\ndef\nxyz\n'
79 79 > 123 (?)
80 80 > abc
81 81 > def (?)
82 82 > 456 (?)
83 83 > xyz
84 84 > $ printf 'zyx\nwvu\ntsr\n'
85 85 > abc (?)
86 86 > zyx (custom !)
87 87 > wvu
88 88 > no_print (no-custom !)
89 89 > tsr (no-missing !)
90 90 > missing (missing !)
91 91 > EOF
92 92
93 93 $ rt
94 94 running 1 tests using 1 parallel processes
95 95 .
96 96 # Ran 1 tests, 0 skipped, 0 failed.
97 97
98 98 failing test
99 99 ==================
100 100
101 101 test churn with globs
102 102 $ cat > test-failure.t <<EOF
103 103 > $ echo "bar-baz"; echo "bar-bad"; echo foo
104 104 > bar*bad (glob)
105 105 > bar*baz (glob)
106 106 > | fo (re)
107 107 > EOF
108 108 $ rt test-failure.t
109 109 running 1 tests using 1 parallel processes
110 110
111 111 --- $TESTTMP/test-failure.t
112 112 +++ $TESTTMP/test-failure.t.err
113 113 @@ -1,4 +1,4 @@
114 114 $ echo "bar-baz"; echo "bar-bad"; echo foo
115 115 + bar*baz (glob)
116 116 bar*bad (glob)
117 117 - bar*baz (glob)
118 118 - | fo (re)
119 119 + foo
120 120
121 121 ERROR: test-failure.t output changed
122 122 !
123 123 Failed test-failure.t: output changed
124 124 # Ran 1 tests, 0 skipped, 1 failed.
125 125 python hash seed: * (glob)
126 126 [1]
127 127
128 128 test how multiple globs gets matched with lines in output
129 129 $ cat > test-failure-globs.t <<EOF
130 130 > $ echo "context"; echo "context"; \
131 131 > echo "key: 1"; echo "value: not a"; \
132 132 > echo "key: 2"; echo "value: not b"; \
133 133 > echo "key: 3"; echo "value: c"; \
134 134 > echo "key: 4"; echo "value: d"
135 135 > context
136 136 > context
137 137 > key: 1
138 138 > value: a
139 139 > key: 2
140 140 > value: b
141 141 > key: 3
142 142 > value: * (glob)
143 143 > key: 4
144 144 > value: * (glob)
145 145 > EOF
146 146 $ rt test-failure-globs.t
147 147 running 1 tests using 1 parallel processes
148 148
149 149 --- $TESTTMP/test-failure-globs.t
150 150 +++ $TESTTMP/test-failure-globs.t.err
151 151 @@ -2,9 +2,9 @@
152 152 context
153 153 context
154 154 key: 1
155 155 - value: a
156 156 + value: not a
157 157 key: 2
158 158 - value: b
159 159 + value: not b
160 160 key: 3
161 161 value: * (glob)
162 162 key: 4
163 163
164 164 ERROR: test-failure-globs.t output changed
165 165 !
166 166 Failed test-failure-globs.t: output changed
167 167 # Ran 1 tests, 0 skipped, 1 failed.
168 168 python hash seed: * (glob)
169 169 [1]
170 170 $ rm test-failure-globs.t
171 171
172 172 test diff colorisation
173 173
174 174 #if no-windows pygments
175 175 $ rt test-failure.t --color always
176 176 running 1 tests using 1 parallel processes
177 177
178 178 \x1b[38;5;124m--- $TESTTMP/test-failure.t\x1b[39m (esc)
179 179 \x1b[38;5;34m+++ $TESTTMP/test-failure.t.err\x1b[39m (esc)
180 180 \x1b[38;5;90;01m@@ -1,4 +1,4 @@\x1b[39;00m (esc)
181 181 $ echo "bar-baz"; echo "bar-bad"; echo foo
182 182 \x1b[38;5;34m+ bar*baz (glob)\x1b[39m (esc)
183 183 bar*bad (glob)
184 184 \x1b[38;5;124m- bar*baz (glob)\x1b[39m (esc)
185 185 \x1b[38;5;124m- | fo (re)\x1b[39m (esc)
186 186 \x1b[38;5;34m+ foo\x1b[39m (esc)
187 187
188 188 \x1b[38;5;88mERROR: \x1b[39m\x1b[38;5;9mtest-failure.t\x1b[39m\x1b[38;5;88m output changed\x1b[39m (esc)
189 189 !
190 190 \x1b[38;5;88mFailed \x1b[39m\x1b[38;5;9mtest-failure.t\x1b[39m\x1b[38;5;88m: output changed\x1b[39m (esc)
191 191 # Ran 1 tests, 0 skipped, 1 failed.
192 192 python hash seed: * (glob)
193 193 [1]
194 194
195 195 $ rt test-failure.t 2> tmp.log
196 196 running 1 tests using 1 parallel processes
197 197 [1]
198 198 $ cat tmp.log
199 199
200 200 --- $TESTTMP/test-failure.t
201 201 +++ $TESTTMP/test-failure.t.err
202 202 @@ -1,4 +1,4 @@
203 203 $ echo "bar-baz"; echo "bar-bad"; echo foo
204 204 + bar*baz (glob)
205 205 bar*bad (glob)
206 206 - bar*baz (glob)
207 207 - | fo (re)
208 208 + foo
209 209
210 210 ERROR: test-failure.t output changed
211 211 !
212 212 Failed test-failure.t: output changed
213 213 # Ran 1 tests, 0 skipped, 1 failed.
214 214 python hash seed: * (glob)
215 215 #endif
216 216
217 217 $ cat > test-failure.t << EOF
218 218 > $ true
219 219 > should go away (true !)
220 220 > $ true
221 221 > should stay (false !)
222 222 >
223 223 > Should remove first line, not second or third
224 224 > $ echo 'testing'
225 225 > baz*foo (glob) (true !)
226 226 > foobar*foo (glob) (false !)
227 227 > te*ting (glob) (true !)
228 228 >
229 229 > Should keep first two lines, remove third and last
230 230 > $ echo 'testing'
231 231 > test.ng (re) (true !)
232 232 > foo.ar (re) (false !)
233 233 > b.r (re) (true !)
234 234 > missing (?)
235 235 > awol (true !)
236 236 >
237 237 > The "missing" line should stay, even though awol is dropped
238 238 > $ echo 'testing'
239 239 > test.ng (re) (true !)
240 240 > foo.ar (?)
241 241 > awol
242 242 > missing (?)
243 243 > EOF
244 244 $ rt test-failure.t
245 245 running 1 tests using 1 parallel processes
246 246
247 247 --- $TESTTMP/test-failure.t
248 248 +++ $TESTTMP/test-failure.t.err
249 249 @@ -1,11 +1,9 @@
250 250 $ true
251 251 - should go away (true !)
252 252 $ true
253 253 should stay (false !)
254 254
255 255 Should remove first line, not second or third
256 256 $ echo 'testing'
257 257 - baz*foo (glob) (true !)
258 258 foobar*foo (glob) (false !)
259 259 te*ting (glob) (true !)
260 260
261 261 foo.ar (re) (false !)
262 262 missing (?)
263 263 @@ -13,13 +11,10 @@
264 264 $ echo 'testing'
265 265 test.ng (re) (true !)
266 266 foo.ar (re) (false !)
267 267 - b.r (re) (true !)
268 268 missing (?)
269 269 - awol (true !)
270 270
271 271 The "missing" line should stay, even though awol is dropped
272 272 $ echo 'testing'
273 273 test.ng (re) (true !)
274 274 foo.ar (?)
275 275 - awol
276 276 missing (?)
277 277
278 278 ERROR: test-failure.t output changed
279 279 !
280 280 Failed test-failure.t: output changed
281 281 # Ran 1 tests, 0 skipped, 1 failed.
282 282 python hash seed: * (glob)
283 283 [1]
284 284
285 285 basic failing test
286 286 $ cat > test-failure.t << EOF
287 287 > $ echo babar
288 288 > rataxes
289 289 > This is a noop statement so that
290 290 > this test is still more bytes than success.
291 291 > pad pad pad pad............................................................
292 292 > pad pad pad pad............................................................
293 293 > pad pad pad pad............................................................
294 294 > pad pad pad pad............................................................
295 295 > pad pad pad pad............................................................
296 296 > pad pad pad pad............................................................
297 297 > EOF
298 298
299 299 >>> fh = open('test-failure-unicode.t', 'wb')
300 300 >>> fh.write(u' $ echo babar\u03b1\n'.encode('utf-8')) and None
301 301 >>> fh.write(u' l\u03b5\u03b5t\n'.encode('utf-8')) and None
302 302
303 303 $ rt
304 304 running 3 tests using 1 parallel processes
305 305
306 306 --- $TESTTMP/test-failure.t
307 307 +++ $TESTTMP/test-failure.t.err
308 308 @@ -1,5 +1,5 @@
309 309 $ echo babar
310 310 - rataxes
311 311 + babar
312 312 This is a noop statement so that
313 313 this test is still more bytes than success.
314 314 pad pad pad pad............................................................
315 315
316 316 ERROR: test-failure.t output changed
317 317 !.
318 318 --- $TESTTMP/test-failure-unicode.t
319 319 +++ $TESTTMP/test-failure-unicode.t.err
320 320 @@ -1,2 +1,2 @@
321 321 $ echo babar\xce\xb1 (esc)
322 322 - l\xce\xb5\xce\xb5t (esc)
323 323 + babar\xce\xb1 (esc)
324 324
325 325 ERROR: test-failure-unicode.t output changed
326 326 !
327 327 Failed test-failure-unicode.t: output changed
328 328 Failed test-failure.t: output changed
329 329 # Ran 3 tests, 0 skipped, 2 failed.
330 330 python hash seed: * (glob)
331 331 [1]
332 332
333 333 test --outputdir
334 334 $ mkdir output
335 335 $ rt --outputdir output
336 336 running 3 tests using 1 parallel processes
337 337
338 338 --- $TESTTMP/test-failure.t
339 339 +++ $TESTTMP/output/test-failure.t.err
340 340 @@ -1,5 +1,5 @@
341 341 $ echo babar
342 342 - rataxes
343 343 + babar
344 344 This is a noop statement so that
345 345 this test is still more bytes than success.
346 346 pad pad pad pad............................................................
347 347
348 348 ERROR: test-failure.t output changed
349 349 !.
350 350 --- $TESTTMP/test-failure-unicode.t
351 351 +++ $TESTTMP/output/test-failure-unicode.t.err
352 352 @@ -1,2 +1,2 @@
353 353 $ echo babar\xce\xb1 (esc)
354 354 - l\xce\xb5\xce\xb5t (esc)
355 355 + babar\xce\xb1 (esc)
356 356
357 357 ERROR: test-failure-unicode.t output changed
358 358 !
359 359 Failed test-failure-unicode.t: output changed
360 360 Failed test-failure.t: output changed
361 361 # Ran 3 tests, 0 skipped, 2 failed.
362 362 python hash seed: * (glob)
363 363 [1]
364 364 $ ls -a output
365 365 .
366 366 ..
367 367 .testtimes
368 368 test-failure-unicode.t.err
369 369 test-failure.t.err
370 370
371 371 test --xunit support
372 372 $ rt --xunit=xunit.xml
373 373 running 3 tests using 1 parallel processes
374 374
375 375 --- $TESTTMP/test-failure.t
376 376 +++ $TESTTMP/test-failure.t.err
377 377 @@ -1,5 +1,5 @@
378 378 $ echo babar
379 379 - rataxes
380 380 + babar
381 381 This is a noop statement so that
382 382 this test is still more bytes than success.
383 383 pad pad pad pad............................................................
384 384
385 385 ERROR: test-failure.t output changed
386 386 !.
387 387 --- $TESTTMP/test-failure-unicode.t
388 388 +++ $TESTTMP/test-failure-unicode.t.err
389 389 @@ -1,2 +1,2 @@
390 390 $ echo babar\xce\xb1 (esc)
391 391 - l\xce\xb5\xce\xb5t (esc)
392 392 + babar\xce\xb1 (esc)
393 393
394 394 ERROR: test-failure-unicode.t output changed
395 395 !
396 396 Failed test-failure-unicode.t: output changed
397 397 Failed test-failure.t: output changed
398 398 # Ran 3 tests, 0 skipped, 2 failed.
399 399 python hash seed: * (glob)
400 400 [1]
401 401 $ cat xunit.xml
402 402 <?xml version="1.0" encoding="utf-8"?>
403 403 <testsuite errors="0" failures="2" name="run-tests" skipped="0" tests="3">
404 404 <testcase name="test-success.t" time="*"/> (glob)
405 405 <testcase name="test-failure-unicode.t" time="*"> (glob)
406 <failure message="output changed" type="output-mismatch">
407 <![CDATA[--- $TESTTMP/test-failure-unicode.t
406 <failure message="output changed" type="output-mismatch"><![CDATA[--- $TESTTMP/test-failure-unicode.t (py38 !)
407 <failure message="output changed" type="output-mismatch"> (no-py38 !)
408 <![CDATA[--- $TESTTMP/test-failure-unicode.t (no-py38 !)
408 409 +++ $TESTTMP/test-failure-unicode.t.err
409 410 @@ -1,2 +1,2 @@
410 411 $ echo babar\xce\xb1 (esc)
411 412 - l\xce\xb5\xce\xb5t (esc)
412 413 + babar\xce\xb1 (esc)
413 ]]> </failure>
414 ]]></failure> (py38 !)
415 ]]> </failure> (no-py38 !)
414 416 </testcase>
415 417 <testcase name="test-failure.t" time="*"> (glob)
416 <failure message="output changed" type="output-mismatch">
417 <![CDATA[--- $TESTTMP/test-failure.t
418 <failure message="output changed" type="output-mismatch"><![CDATA[--- $TESTTMP/test-failure.t (py38 !)
419 <failure message="output changed" type="output-mismatch"> (no-py38 !)
420 <![CDATA[--- $TESTTMP/test-failure.t (no-py38 !)
418 421 +++ $TESTTMP/test-failure.t.err
419 422 @@ -1,5 +1,5 @@
420 423 $ echo babar
421 424 - rataxes
422 425 + babar
423 426 This is a noop statement so that
424 427 this test is still more bytes than success.
425 428 pad pad pad pad............................................................
426 ]]> </failure>
429 ]]></failure> (py38 !)
430 ]]> </failure> (no-py38 !)
427 431 </testcase>
428 432 </testsuite>
429 433
430 434 $ cat .testtimes
431 435 test-empty.t * (glob)
432 436 test-failure-globs.t * (glob)
433 437 test-failure-unicode.t * (glob)
434 438 test-failure.t * (glob)
435 439 test-success.t * (glob)
436 440
437 441 $ rt --list-tests
438 442 test-failure-unicode.t
439 443 test-failure.t
440 444 test-success.t
441 445
442 446 $ rt --list-tests --json
443 447 test-failure-unicode.t
444 448 test-failure.t
445 449 test-success.t
446 450 $ cat report.json
447 451 testreport ={
448 452 "test-failure-unicode.t": {
449 453 "result": "success"
450 454 },
451 455 "test-failure.t": {
452 456 "result": "success"
453 457 },
454 458 "test-success.t": {
455 459 "result": "success"
456 460 }
457 461 } (no-eol)
458 462
459 463 $ rt --list-tests --xunit=xunit.xml
460 464 test-failure-unicode.t
461 465 test-failure.t
462 466 test-success.t
463 467 $ cat xunit.xml
464 468 <?xml version="1.0" encoding="utf-8"?>
465 469 <testsuite errors="0" failures="0" name="run-tests" skipped="0" tests="0">
466 470 <testcase name="test-failure-unicode.t"/>
467 471 <testcase name="test-failure.t"/>
468 472 <testcase name="test-success.t"/>
469 473 </testsuite>
470 474
471 475 $ rt --list-tests test-failure* --json --xunit=xunit.xml --outputdir output
472 476 test-failure-unicode.t
473 477 test-failure.t
474 478 $ cat output/report.json
475 479 testreport ={
476 480 "test-failure-unicode.t": {
477 481 "result": "success"
478 482 },
479 483 "test-failure.t": {
480 484 "result": "success"
481 485 }
482 486 } (no-eol)
483 487 $ cat xunit.xml
484 488 <?xml version="1.0" encoding="utf-8"?>
485 489 <testsuite errors="0" failures="0" name="run-tests" skipped="0" tests="0">
486 490 <testcase name="test-failure-unicode.t"/>
487 491 <testcase name="test-failure.t"/>
488 492 </testsuite>
489 493
490 494 $ rm test-failure-unicode.t
491 495
492 496 test for --retest
493 497 ====================
494 498
495 499 $ rt --retest
496 500 running 2 tests using 1 parallel processes
497 501
498 502 --- $TESTTMP/test-failure.t
499 503 +++ $TESTTMP/test-failure.t.err
500 504 @@ -1,5 +1,5 @@
501 505 $ echo babar
502 506 - rataxes
503 507 + babar
504 508 This is a noop statement so that
505 509 this test is still more bytes than success.
506 510 pad pad pad pad............................................................
507 511
508 512 ERROR: test-failure.t output changed
509 513 !
510 514 Failed test-failure.t: output changed
511 515 # Ran 2 tests, 1 skipped, 1 failed.
512 516 python hash seed: * (glob)
513 517 [1]
514 518
515 519 --retest works with --outputdir
516 520 $ rm -r output
517 521 $ mkdir output
518 522 $ mv test-failure.t.err output
519 523 $ rt --retest --outputdir output
520 524 running 2 tests using 1 parallel processes
521 525
522 526 --- $TESTTMP/test-failure.t
523 527 +++ $TESTTMP/output/test-failure.t.err
524 528 @@ -1,5 +1,5 @@
525 529 $ echo babar
526 530 - rataxes
527 531 + babar
528 532 This is a noop statement so that
529 533 this test is still more bytes than success.
530 534 pad pad pad pad............................................................
531 535
532 536 ERROR: test-failure.t output changed
533 537 !
534 538 Failed test-failure.t: output changed
535 539 # Ran 2 tests, 1 skipped, 1 failed.
536 540 python hash seed: * (glob)
537 541 [1]
538 542
539 543 Selecting Tests To Run
540 544 ======================
541 545
542 546 successful
543 547
544 548 $ rt test-success.t
545 549 running 1 tests using 1 parallel processes
546 550 .
547 551 # Ran 1 tests, 0 skipped, 0 failed.
548 552
549 553 success w/ keyword
550 554 $ rt -k xyzzy
551 555 running 2 tests using 1 parallel processes
552 556 .
553 557 # Ran 2 tests, 1 skipped, 0 failed.
554 558
555 559 failed
556 560
557 561 $ rt test-failure.t
558 562 running 1 tests using 1 parallel processes
559 563
560 564 --- $TESTTMP/test-failure.t
561 565 +++ $TESTTMP/test-failure.t.err
562 566 @@ -1,5 +1,5 @@
563 567 $ echo babar
564 568 - rataxes
565 569 + babar
566 570 This is a noop statement so that
567 571 this test is still more bytes than success.
568 572 pad pad pad pad............................................................
569 573
570 574 ERROR: test-failure.t output changed
571 575 !
572 576 Failed test-failure.t: output changed
573 577 # Ran 1 tests, 0 skipped, 1 failed.
574 578 python hash seed: * (glob)
575 579 [1]
576 580
577 581 failure w/ keyword
578 582 $ rt -k rataxes
579 583 running 2 tests using 1 parallel processes
580 584
581 585 --- $TESTTMP/test-failure.t
582 586 +++ $TESTTMP/test-failure.t.err
583 587 @@ -1,5 +1,5 @@
584 588 $ echo babar
585 589 - rataxes
586 590 + babar
587 591 This is a noop statement so that
588 592 this test is still more bytes than success.
589 593 pad pad pad pad............................................................
590 594
591 595 ERROR: test-failure.t output changed
592 596 !
593 597 Failed test-failure.t: output changed
594 598 # Ran 2 tests, 1 skipped, 1 failed.
595 599 python hash seed: * (glob)
596 600 [1]
597 601
598 602 Verify that when a process fails to start we show a useful message
599 603 ==================================================================
600 604
601 605 $ cat > test-serve-fail.t <<EOF
602 606 > $ echo 'abort: child process failed to start blah'
603 607 > EOF
604 608 $ rt test-serve-fail.t
605 609 running 1 tests using 1 parallel processes
606 610
607 611 --- $TESTTMP/test-serve-fail.t
608 612 +++ $TESTTMP/test-serve-fail.t.err
609 613 @@ -1* +1,2 @@ (glob)
610 614 $ echo 'abort: child process failed to start blah'
611 615 + abort: child process failed to start blah
612 616
613 617 ERROR: test-serve-fail.t output changed
614 618 !
615 619 Failed test-serve-fail.t: server failed to start (HGPORT=*) (glob)
616 620 # Ran 1 tests, 0 skipped, 1 failed.
617 621 python hash seed: * (glob)
618 622 [1]
619 623 $ rm test-serve-fail.t
620 624
621 625 Verify that we can try other ports
622 626 ===================================
623 627
624 628 Extensions aren't inherited by the invoked run-tests.py. An extension
625 629 introducing a repository requirement could cause this to fail. So we force
626 630 HGRCPATH to get a clean environment.
627 631
628 632 $ HGRCPATH= hg init inuse
629 633 $ hg serve -R inuse -p $HGPORT -d --pid-file=blocks.pid
630 634 $ cat blocks.pid >> $DAEMON_PIDS
631 635 $ cat > test-serve-inuse.t <<EOF
632 636 > $ hg serve -R `pwd`/inuse -p \$HGPORT -d --pid-file=hg.pid
633 637 > $ cat hg.pid >> \$DAEMON_PIDS
634 638 > EOF
635 639 $ rt test-serve-inuse.t
636 640 running 1 tests using 1 parallel processes
637 641 .
638 642 # Ran 1 tests, 0 skipped, 0 failed.
639 643 $ rm test-serve-inuse.t
640 644 $ killdaemons.py $DAEMON_PIDS
641 645
642 646 Running In Debug Mode
643 647 ======================
644 648
645 649 $ rt --debug 2>&1 | grep -v pwd
646 650 running 2 tests using 1 parallel processes
647 651 + alias hg=hg.exe (windows !)
648 652 + echo *SALT* 0 0 (glob)
649 653 *SALT* 0 0 (glob)
650 654 + echo babar
651 655 babar
652 656 + echo *SALT* 10 0 (glob)
653 657 *SALT* 10 0 (glob)
654 658 .+ alias hg=hg.exe (windows !)
655 659 *+ echo *SALT* 0 0 (glob)
656 660 *SALT* 0 0 (glob)
657 661 + echo babar
658 662 babar
659 663 + echo *SALT* 2 0 (glob)
660 664 *SALT* 2 0 (glob)
661 665 + echo xyzzy
662 666 xyzzy
663 667 + echo *SALT* 9 0 (glob)
664 668 *SALT* 9 0 (glob)
665 669 + printf *abc\ndef\nxyz\n* (glob)
666 670 abc
667 671 def
668 672 xyz
669 673 + echo *SALT* 15 0 (glob)
670 674 *SALT* 15 0 (glob)
671 675 + printf *zyx\nwvu\ntsr\n* (glob)
672 676 zyx
673 677 wvu
674 678 tsr
675 679 + echo *SALT* 22 0 (glob)
676 680 *SALT* 22 0 (glob)
677 681 .
678 682 # Ran 2 tests, 0 skipped, 0 failed.
679 683
680 684 Parallel runs
681 685 ==============
682 686
683 687 (duplicate the failing test to get predictable output)
684 688 $ cp test-failure.t test-failure-copy.t
685 689
686 690 $ rt --jobs 2 test-failure*.t -n
687 691 running 2 tests using 2 parallel processes
688 692 !!
689 693 Failed test-failure*.t: output changed (glob)
690 694 Failed test-failure*.t: output changed (glob)
691 695 # Ran 2 tests, 0 skipped, 2 failed.
692 696 python hash seed: * (glob)
693 697 [1]
694 698
695 699 failures in parallel with --first should only print one failure
696 700 $ rt --jobs 2 --first test-failure*.t
697 701 running 2 tests using 2 parallel processes
698 702
699 703 --- $TESTTMP/test-failure*.t (glob)
700 704 +++ $TESTTMP/test-failure*.t.err (glob)
701 705 @@ -1,5 +1,5 @@
702 706 $ echo babar
703 707 - rataxes
704 708 + babar
705 709 This is a noop statement so that
706 710 this test is still more bytes than success.
707 711 pad pad pad pad............................................................
708 712
709 713 Failed test-failure*.t: output changed (glob)
710 714 Failed test-failure*.t: output changed (glob)
711 715 # Ran 2 tests, 0 skipped, 2 failed.
712 716 python hash seed: * (glob)
713 717 [1]
714 718
715 719
716 720 (delete the duplicated test file)
717 721 $ rm test-failure-copy.t
718 722
719 723 multiple runs per test should be parallelized
720 724
721 725 $ rt --jobs 2 --runs-per-test 2 test-success.t
722 726 running 2 tests using 2 parallel processes
723 727 ..
724 728 # Ran 2 tests, 0 skipped, 0 failed.
725 729
726 730 Interactive run
727 731 ===============
728 732
729 733 (backup the failing test)
730 734 $ cp test-failure.t backup
731 735
732 736 Refuse the fix
733 737
734 738 $ echo 'n' | rt -i
735 739 running 2 tests using 1 parallel processes
736 740
737 741 --- $TESTTMP/test-failure.t
738 742 +++ $TESTTMP/test-failure.t.err
739 743 @@ -1,5 +1,5 @@
740 744 $ echo babar
741 745 - rataxes
742 746 + babar
743 747 This is a noop statement so that
744 748 this test is still more bytes than success.
745 749 pad pad pad pad............................................................
746 750 Accept this change? [n]
747 751 ERROR: test-failure.t output changed
748 752 !.
749 753 Failed test-failure.t: output changed
750 754 # Ran 2 tests, 0 skipped, 1 failed.
751 755 python hash seed: * (glob)
752 756 [1]
753 757
754 758 $ cat test-failure.t
755 759 $ echo babar
756 760 rataxes
757 761 This is a noop statement so that
758 762 this test is still more bytes than success.
759 763 pad pad pad pad............................................................
760 764 pad pad pad pad............................................................
761 765 pad pad pad pad............................................................
762 766 pad pad pad pad............................................................
763 767 pad pad pad pad............................................................
764 768 pad pad pad pad............................................................
765 769
766 770 Interactive with custom view
767 771
768 772 $ echo 'n' | rt -i --view echo
769 773 running 2 tests using 1 parallel processes
770 774 $TESTTMP/test-failure.t $TESTTMP/test-failure.t.err
771 775 Accept this change? [n]* (glob)
772 776 ERROR: test-failure.t output changed
773 777 !.
774 778 Failed test-failure.t: output changed
775 779 # Ran 2 tests, 0 skipped, 1 failed.
776 780 python hash seed: * (glob)
777 781 [1]
778 782
779 783 View the fix
780 784
781 785 $ echo 'y' | rt --view echo
782 786 running 2 tests using 1 parallel processes
783 787 $TESTTMP/test-failure.t $TESTTMP/test-failure.t.err
784 788
785 789 ERROR: test-failure.t output changed
786 790 !.
787 791 Failed test-failure.t: output changed
788 792 # Ran 2 tests, 0 skipped, 1 failed.
789 793 python hash seed: * (glob)
790 794 [1]
791 795
792 796 Accept the fix
793 797
794 798 $ cat >> test-failure.t <<EOF
795 799 > $ echo 'saved backup bundle to \$TESTTMP/foo.hg'
796 800 > saved backup bundle to \$TESTTMP/foo.hg
797 801 > $ echo 'saved backup bundle to \$TESTTMP/foo.hg'
798 802 > saved backup bundle to $TESTTMP\\foo.hg
799 803 > $ echo 'saved backup bundle to \$TESTTMP/foo.hg'
800 804 > saved backup bundle to \$TESTTMP/*.hg (glob)
801 805 > EOF
802 806 $ echo 'y' | rt -i 2>&1
803 807 running 2 tests using 1 parallel processes
804 808
805 809 --- $TESTTMP/test-failure.t
806 810 +++ $TESTTMP/test-failure.t.err
807 811 @@ -1,5 +1,5 @@
808 812 $ echo babar
809 813 - rataxes
810 814 + babar
811 815 This is a noop statement so that
812 816 this test is still more bytes than success.
813 817 pad pad pad pad............................................................
814 818 @@ -11,6 +11,6 @@
815 819 $ echo 'saved backup bundle to $TESTTMP/foo.hg'
816 820 saved backup bundle to $TESTTMP/foo.hg
817 821 $ echo 'saved backup bundle to $TESTTMP/foo.hg'
818 822 - saved backup bundle to $TESTTMP\foo.hg
819 823 + saved backup bundle to $TESTTMP/foo.hg
820 824 $ echo 'saved backup bundle to $TESTTMP/foo.hg'
821 825 saved backup bundle to $TESTTMP/*.hg (glob)
822 826 Accept this change? [n] ..
823 827 # Ran 2 tests, 0 skipped, 0 failed.
824 828
825 829 $ sed -e 's,(glob)$,&<,g' test-failure.t
826 830 $ echo babar
827 831 babar
828 832 This is a noop statement so that
829 833 this test is still more bytes than success.
830 834 pad pad pad pad............................................................
831 835 pad pad pad pad............................................................
832 836 pad pad pad pad............................................................
833 837 pad pad pad pad............................................................
834 838 pad pad pad pad............................................................
835 839 pad pad pad pad............................................................
836 840 $ echo 'saved backup bundle to $TESTTMP/foo.hg'
837 841 saved backup bundle to $TESTTMP/foo.hg
838 842 $ echo 'saved backup bundle to $TESTTMP/foo.hg'
839 843 saved backup bundle to $TESTTMP/foo.hg
840 844 $ echo 'saved backup bundle to $TESTTMP/foo.hg'
841 845 saved backup bundle to $TESTTMP/*.hg (glob)<
842 846
843 847 Race condition - test file was modified when test is running
844 848
845 849 $ TESTRACEDIR=`pwd`
846 850 $ export TESTRACEDIR
847 851 $ cat > test-race.t <<EOF
848 852 > $ echo 1
849 853 > $ echo "# a new line" >> $TESTRACEDIR/test-race.t
850 854 > EOF
851 855
852 856 $ rt -i test-race.t
853 857 running 1 tests using 1 parallel processes
854 858
855 859 --- $TESTTMP/test-race.t
856 860 +++ $TESTTMP/test-race.t.err
857 861 @@ -1,2 +1,3 @@
858 862 $ echo 1
859 863 + 1
860 864 $ echo "# a new line" >> $TESTTMP/test-race.t
861 865 Reference output has changed (run again to prompt changes)
862 866 ERROR: test-race.t output changed
863 867 !
864 868 Failed test-race.t: output changed
865 869 # Ran 1 tests, 0 skipped, 1 failed.
866 870 python hash seed: * (glob)
867 871 [1]
868 872
869 873 $ rm test-race.t
870 874
871 875 When "#testcases" is used in .t files
872 876
873 877 $ cat >> test-cases.t <<EOF
874 878 > #testcases a b
875 879 > #if a
876 880 > $ echo 1
877 881 > #endif
878 882 > #if b
879 883 > $ echo 2
880 884 > #endif
881 885 > EOF
882 886
883 887 $ cat <<EOF | rt -i test-cases.t 2>&1
884 888 > y
885 889 > y
886 890 > EOF
887 891 running 2 tests using 1 parallel processes
888 892
889 893 --- $TESTTMP/test-cases.t
890 894 +++ $TESTTMP/test-cases.t#a.err
891 895 @@ -1,6 +1,7 @@
892 896 #testcases a b
893 897 #if a
894 898 $ echo 1
895 899 + 1
896 900 #endif
897 901 #if b
898 902 $ echo 2
899 903 Accept this change? [n] .
900 904 --- $TESTTMP/test-cases.t
901 905 +++ $TESTTMP/test-cases.t#b.err
902 906 @@ -5,4 +5,5 @@
903 907 #endif
904 908 #if b
905 909 $ echo 2
906 910 + 2
907 911 #endif
908 912 Accept this change? [n] .
909 913 # Ran 2 tests, 0 skipped, 0 failed.
910 914
911 915 $ cat test-cases.t
912 916 #testcases a b
913 917 #if a
914 918 $ echo 1
915 919 1
916 920 #endif
917 921 #if b
918 922 $ echo 2
919 923 2
920 924 #endif
921 925
922 926 $ cat >> test-cases.t <<'EOF'
923 927 > #if a
924 928 > $ NAME=A
925 929 > #else
926 930 > $ NAME=B
927 931 > #endif
928 932 > $ echo $NAME
929 933 > A (a !)
930 934 > B (b !)
931 935 > EOF
932 936 $ rt test-cases.t
933 937 running 2 tests using 1 parallel processes
934 938 ..
935 939 # Ran 2 tests, 0 skipped, 0 failed.
936 940
937 941 When using multiple dimensions of "#testcases" in .t files
938 942
939 943 $ cat > test-cases.t <<'EOF'
940 944 > #testcases a b
941 945 > #testcases c d
942 946 > #if a d
943 947 > $ echo $TESTCASE
944 948 > a#d
945 949 > #endif
946 950 > #if b c
947 951 > $ echo yes
948 952 > no
949 953 > #endif
950 954 > EOF
951 955 $ rt test-cases.t
952 956 running 4 tests using 1 parallel processes
953 957 ..
954 958 --- $TESTTMP/test-cases.t
955 959 +++ $TESTTMP/test-cases.t#b#c.err
956 960 @@ -6,5 +6,5 @@
957 961 #endif
958 962 #if b c
959 963 $ echo yes
960 964 - no
961 965 + yes
962 966 #endif
963 967
964 968 ERROR: test-cases.t#b#c output changed
965 969 !.
966 970 Failed test-cases.t#b#c: output changed
967 971 # Ran 4 tests, 0 skipped, 1 failed.
968 972 python hash seed: * (glob)
969 973 [1]
970 974
971 975 $ rm test-cases.t#b#c.err
972 976 $ rm test-cases.t
973 977
974 978 (reinstall)
975 979 $ mv backup test-failure.t
976 980
977 981 No Diff
978 982 ===============
979 983
980 984 $ rt --nodiff
981 985 running 2 tests using 1 parallel processes
982 986 !.
983 987 Failed test-failure.t: output changed
984 988 # Ran 2 tests, 0 skipped, 1 failed.
985 989 python hash seed: * (glob)
986 990 [1]
987 991
988 992 test --tmpdir support
989 993 $ rt --tmpdir=$TESTTMP/keep test-success.t
990 994 running 1 tests using 1 parallel processes
991 995
992 996 Keeping testtmp dir: $TESTTMP/keep/child1/test-success.t
993 997 Keeping threadtmp dir: $TESTTMP/keep/child1
994 998 .
995 999 # Ran 1 tests, 0 skipped, 0 failed.
996 1000
997 1001 timeouts
998 1002 ========
999 1003 $ cat > test-timeout.t <<EOF
1000 1004 > $ sleep 2
1001 1005 > $ echo pass
1002 1006 > pass
1003 1007 > EOF
1004 1008 > echo '#require slow' > test-slow-timeout.t
1005 1009 > cat test-timeout.t >> test-slow-timeout.t
1006 1010 $ rt --timeout=1 --slowtimeout=3 test-timeout.t test-slow-timeout.t
1007 1011 running 2 tests using 1 parallel processes
1008 1012 st
1009 1013 Skipped test-slow-timeout.t: missing feature: allow slow tests (use --allow-slow-tests)
1010 1014 Failed test-timeout.t: timed out
1011 1015 # Ran 1 tests, 1 skipped, 1 failed.
1012 1016 python hash seed: * (glob)
1013 1017 [1]
1014 1018 $ rt --timeout=1 --slowtimeout=3 \
1015 1019 > test-timeout.t test-slow-timeout.t --allow-slow-tests
1016 1020 running 2 tests using 1 parallel processes
1017 1021 .t
1018 1022 Failed test-timeout.t: timed out
1019 1023 # Ran 2 tests, 0 skipped, 1 failed.
1020 1024 python hash seed: * (glob)
1021 1025 [1]
1022 1026 $ rm test-timeout.t test-slow-timeout.t
1023 1027
1024 1028 test for --time
1025 1029 ==================
1026 1030
1027 1031 $ rt test-success.t --time
1028 1032 running 1 tests using 1 parallel processes
1029 1033 .
1030 1034 # Ran 1 tests, 0 skipped, 0 failed.
1031 1035 # Producing time report
1032 1036 start end cuser csys real Test
1033 1037 \s*[\d\.]{5,8} \s*[\d\.]{5,8} \s*[\d\.]{5,8} \s*[\d\.]{5,8} \s*[\d\.]{5,8} test-success.t (re)
1034 1038
1035 1039 test for --time with --job enabled
1036 1040 ====================================
1037 1041
1038 1042 $ rt test-success.t --time --jobs 2
1039 1043 running 1 tests using 1 parallel processes
1040 1044 .
1041 1045 # Ran 1 tests, 0 skipped, 0 failed.
1042 1046 # Producing time report
1043 1047 start end cuser csys real Test
1044 1048 \s*[\d\.]{5,8} \s*[\d\.]{5,8} \s*[\d\.]{5,8} \s*[\d\.]{5,8} \s*[\d\.]{5,8} test-success.t (re)
1045 1049
1046 1050 Skips
1047 1051 ================
1048 1052 $ cat > test-skip.t <<EOF
1049 1053 > $ echo xyzzy
1050 1054 > #if true
1051 1055 > #require false
1052 1056 > #end
1053 1057 > EOF
1054 1058 $ cat > test-noskip.t <<EOF
1055 1059 > #if false
1056 1060 > #require false
1057 1061 > #endif
1058 1062 > EOF
1059 1063 $ rt --nodiff
1060 1064 running 4 tests using 1 parallel processes
1061 1065 !.s.
1062 1066 Skipped test-skip.t: missing feature: nail clipper
1063 1067 Failed test-failure.t: output changed
1064 1068 # Ran 3 tests, 1 skipped, 1 failed.
1065 1069 python hash seed: * (glob)
1066 1070 [1]
1067 1071
1068 1072 $ rm test-noskip.t
1069 1073 $ rt --keyword xyzzy
1070 1074 running 3 tests using 1 parallel processes
1071 1075 .s
1072 1076 Skipped test-skip.t: missing feature: nail clipper
1073 1077 # Ran 2 tests, 2 skipped, 0 failed.
1074 1078
1075 1079 Skips with xml
1076 1080 $ rt --keyword xyzzy \
1077 1081 > --xunit=xunit.xml
1078 1082 running 3 tests using 1 parallel processes
1079 1083 .s
1080 1084 Skipped test-skip.t: missing feature: nail clipper
1081 1085 # Ran 2 tests, 2 skipped, 0 failed.
1082 1086 $ cat xunit.xml
1083 1087 <?xml version="1.0" encoding="utf-8"?>
1084 1088 <testsuite errors="0" failures="0" name="run-tests" skipped="2" tests="2">
1085 1089 <testcase name="test-success.t" time="*"/> (glob)
1086 1090 <testcase name="test-skip.t">
1087 <skipped>
1088 <![CDATA[missing feature: nail clipper]]> </skipped>
1091 <skipped><![CDATA[missing feature: nail clipper]]></skipped> (py38 !)
1092 <skipped> (no-py38 !)
1093 <![CDATA[missing feature: nail clipper]]> </skipped> (no-py38 !)
1089 1094 </testcase>
1090 1095 </testsuite>
1091 1096
1092 1097 Missing skips or blacklisted skips don't count as executed:
1093 1098 $ echo test-failure.t > blacklist
1094 1099 $ rt --blacklist=blacklist --json\
1095 1100 > test-failure.t test-bogus.t
1096 1101 running 2 tests using 1 parallel processes
1097 1102 ss
1098 1103 Skipped test-bogus.t: Doesn't exist
1099 1104 Skipped test-failure.t: blacklisted
1100 1105 # Ran 0 tests, 2 skipped, 0 failed.
1101 1106 $ cat report.json
1102 1107 testreport ={
1103 1108 "test-bogus.t": {
1104 1109 "result": "skip"
1105 1110 },
1106 1111 "test-failure.t": {
1107 1112 "result": "skip"
1108 1113 }
1109 1114 } (no-eol)
1110 1115
1111 1116 Whitelist trumps blacklist
1112 1117 $ echo test-failure.t > whitelist
1113 1118 $ rt --blacklist=blacklist --whitelist=whitelist --json\
1114 1119 > test-failure.t test-bogus.t
1115 1120 running 2 tests using 1 parallel processes
1116 1121 s
1117 1122 --- $TESTTMP/test-failure.t
1118 1123 +++ $TESTTMP/test-failure.t.err
1119 1124 @@ -1,5 +1,5 @@
1120 1125 $ echo babar
1121 1126 - rataxes
1122 1127 + babar
1123 1128 This is a noop statement so that
1124 1129 this test is still more bytes than success.
1125 1130 pad pad pad pad............................................................
1126 1131
1127 1132 ERROR: test-failure.t output changed
1128 1133 !
1129 1134 Skipped test-bogus.t: Doesn't exist
1130 1135 Failed test-failure.t: output changed
1131 1136 # Ran 1 tests, 1 skipped, 1 failed.
1132 1137 python hash seed: * (glob)
1133 1138 [1]
1134 1139
1135 1140 Ensure that --test-list causes only the tests listed in that file to
1136 1141 be executed.
1137 1142 $ echo test-success.t >> onlytest
1138 1143 $ rt --test-list=onlytest
1139 1144 running 1 tests using 1 parallel processes
1140 1145 .
1141 1146 # Ran 1 tests, 0 skipped, 0 failed.
1142 1147 $ echo test-bogus.t >> anothertest
1143 1148 $ rt --test-list=onlytest --test-list=anothertest
1144 1149 running 2 tests using 1 parallel processes
1145 1150 s.
1146 1151 Skipped test-bogus.t: Doesn't exist
1147 1152 # Ran 1 tests, 1 skipped, 0 failed.
1148 1153 $ rm onlytest anothertest
1149 1154
1150 1155 test for --json
1151 1156 ==================
1152 1157
1153 1158 $ rt --json
1154 1159 running 3 tests using 1 parallel processes
1155 1160
1156 1161 --- $TESTTMP/test-failure.t
1157 1162 +++ $TESTTMP/test-failure.t.err
1158 1163 @@ -1,5 +1,5 @@
1159 1164 $ echo babar
1160 1165 - rataxes
1161 1166 + babar
1162 1167 This is a noop statement so that
1163 1168 this test is still more bytes than success.
1164 1169 pad pad pad pad............................................................
1165 1170
1166 1171 ERROR: test-failure.t output changed
1167 1172 !.s
1168 1173 Skipped test-skip.t: missing feature: nail clipper
1169 1174 Failed test-failure.t: output changed
1170 1175 # Ran 2 tests, 1 skipped, 1 failed.
1171 1176 python hash seed: * (glob)
1172 1177 [1]
1173 1178
1174 1179 $ cat report.json
1175 1180 testreport ={
1176 1181 "test-failure.t": [\{] (re)
1177 1182 "csys": "\s*\d+\.\d{3,4}", ? (re)
1178 1183 "cuser": "\s*\d+\.\d{3,4}", ? (re)
1179 1184 "diff": "---.+\+\+\+.+", ? (re)
1180 1185 "end": "\s*\d+\.\d{3,4}", ? (re)
1181 1186 "result": "failure", ? (re)
1182 1187 "start": "\s*\d+\.\d{3,4}", ? (re)
1183 1188 "time": "\s*\d+\.\d{3,4}" (re)
1184 1189 }, ? (re)
1185 1190 "test-skip.t": {
1186 1191 "csys": "\s*\d+\.\d{3,4}", ? (re)
1187 1192 "cuser": "\s*\d+\.\d{3,4}", ? (re)
1188 1193 "diff": "", ? (re)
1189 1194 "end": "\s*\d+\.\d{3,4}", ? (re)
1190 1195 "result": "skip", ? (re)
1191 1196 "start": "\s*\d+\.\d{3,4}", ? (re)
1192 1197 "time": "\s*\d+\.\d{3,4}" (re)
1193 1198 }, ? (re)
1194 1199 "test-success.t": [\{] (re)
1195 1200 "csys": "\s*\d+\.\d{3,4}", ? (re)
1196 1201 "cuser": "\s*\d+\.\d{3,4}", ? (re)
1197 1202 "diff": "", ? (re)
1198 1203 "end": "\s*\d+\.\d{3,4}", ? (re)
1199 1204 "result": "success", ? (re)
1200 1205 "start": "\s*\d+\.\d{3,4}", ? (re)
1201 1206 "time": "\s*\d+\.\d{3,4}" (re)
1202 1207 }
1203 1208 } (no-eol)
1204 1209 --json with --outputdir
1205 1210
1206 1211 $ rm report.json
1207 1212 $ rm -r output
1208 1213 $ mkdir output
1209 1214 $ rt --json --outputdir output
1210 1215 running 3 tests using 1 parallel processes
1211 1216
1212 1217 --- $TESTTMP/test-failure.t
1213 1218 +++ $TESTTMP/output/test-failure.t.err
1214 1219 @@ -1,5 +1,5 @@
1215 1220 $ echo babar
1216 1221 - rataxes
1217 1222 + babar
1218 1223 This is a noop statement so that
1219 1224 this test is still more bytes than success.
1220 1225 pad pad pad pad............................................................
1221 1226
1222 1227 ERROR: test-failure.t output changed
1223 1228 !.s
1224 1229 Skipped test-skip.t: missing feature: nail clipper
1225 1230 Failed test-failure.t: output changed
1226 1231 # Ran 2 tests, 1 skipped, 1 failed.
1227 1232 python hash seed: * (glob)
1228 1233 [1]
1229 1234 $ f report.json
1230 1235 report.json: file not found
1231 1236 $ cat output/report.json
1232 1237 testreport ={
1233 1238 "test-failure.t": [\{] (re)
1234 1239 "csys": "\s*\d+\.\d{3,4}", ? (re)
1235 1240 "cuser": "\s*\d+\.\d{3,4}", ? (re)
1236 1241 "diff": "---.+\+\+\+.+", ? (re)
1237 1242 "end": "\s*\d+\.\d{3,4}", ? (re)
1238 1243 "result": "failure", ? (re)
1239 1244 "start": "\s*\d+\.\d{3,4}", ? (re)
1240 1245 "time": "\s*\d+\.\d{3,4}" (re)
1241 1246 }, ? (re)
1242 1247 "test-skip.t": {
1243 1248 "csys": "\s*\d+\.\d{3,4}", ? (re)
1244 1249 "cuser": "\s*\d+\.\d{3,4}", ? (re)
1245 1250 "diff": "", ? (re)
1246 1251 "end": "\s*\d+\.\d{3,4}", ? (re)
1247 1252 "result": "skip", ? (re)
1248 1253 "start": "\s*\d+\.\d{3,4}", ? (re)
1249 1254 "time": "\s*\d+\.\d{3,4}" (re)
1250 1255 }, ? (re)
1251 1256 "test-success.t": [\{] (re)
1252 1257 "csys": "\s*\d+\.\d{3,4}", ? (re)
1253 1258 "cuser": "\s*\d+\.\d{3,4}", ? (re)
1254 1259 "diff": "", ? (re)
1255 1260 "end": "\s*\d+\.\d{3,4}", ? (re)
1256 1261 "result": "success", ? (re)
1257 1262 "start": "\s*\d+\.\d{3,4}", ? (re)
1258 1263 "time": "\s*\d+\.\d{3,4}" (re)
1259 1264 }
1260 1265 } (no-eol)
1261 1266 $ ls -a output
1262 1267 .
1263 1268 ..
1264 1269 .testtimes
1265 1270 report.json
1266 1271 test-failure.t.err
1267 1272
1268 1273 Test that failed test accepted through interactive are properly reported:
1269 1274
1270 1275 $ cp test-failure.t backup
1271 1276 $ echo y | rt --json -i
1272 1277 running 3 tests using 1 parallel processes
1273 1278
1274 1279 --- $TESTTMP/test-failure.t
1275 1280 +++ $TESTTMP/test-failure.t.err
1276 1281 @@ -1,5 +1,5 @@
1277 1282 $ echo babar
1278 1283 - rataxes
1279 1284 + babar
1280 1285 This is a noop statement so that
1281 1286 this test is still more bytes than success.
1282 1287 pad pad pad pad............................................................
1283 1288 Accept this change? [n] ..s
1284 1289 Skipped test-skip.t: missing feature: nail clipper
1285 1290 # Ran 2 tests, 1 skipped, 0 failed.
1286 1291
1287 1292 $ cat report.json
1288 1293 testreport ={
1289 1294 "test-failure.t": [\{] (re)
1290 1295 "csys": "\s*\d+\.\d{3,4}", ? (re)
1291 1296 "cuser": "\s*\d+\.\d{3,4}", ? (re)
1292 1297 "diff": "", ? (re)
1293 1298 "end": "\s*\d+\.\d{3,4}", ? (re)
1294 1299 "result": "success", ? (re)
1295 1300 "start": "\s*\d+\.\d{3,4}", ? (re)
1296 1301 "time": "\s*\d+\.\d{3,4}" (re)
1297 1302 }, ? (re)
1298 1303 "test-skip.t": {
1299 1304 "csys": "\s*\d+\.\d{3,4}", ? (re)
1300 1305 "cuser": "\s*\d+\.\d{3,4}", ? (re)
1301 1306 "diff": "", ? (re)
1302 1307 "end": "\s*\d+\.\d{3,4}", ? (re)
1303 1308 "result": "skip", ? (re)
1304 1309 "start": "\s*\d+\.\d{3,4}", ? (re)
1305 1310 "time": "\s*\d+\.\d{3,4}" (re)
1306 1311 }, ? (re)
1307 1312 "test-success.t": [\{] (re)
1308 1313 "csys": "\s*\d+\.\d{3,4}", ? (re)
1309 1314 "cuser": "\s*\d+\.\d{3,4}", ? (re)
1310 1315 "diff": "", ? (re)
1311 1316 "end": "\s*\d+\.\d{3,4}", ? (re)
1312 1317 "result": "success", ? (re)
1313 1318 "start": "\s*\d+\.\d{3,4}", ? (re)
1314 1319 "time": "\s*\d+\.\d{3,4}" (re)
1315 1320 }
1316 1321 } (no-eol)
1317 1322 $ mv backup test-failure.t
1318 1323
1319 1324 backslash on end of line with glob matching is handled properly
1320 1325
1321 1326 $ cat > test-glob-backslash.t << EOF
1322 1327 > $ echo 'foo bar \\'
1323 1328 > foo * \ (glob)
1324 1329 > EOF
1325 1330
1326 1331 $ rt test-glob-backslash.t
1327 1332 running 1 tests using 1 parallel processes
1328 1333 .
1329 1334 # Ran 1 tests, 0 skipped, 0 failed.
1330 1335
1331 1336 $ rm -f test-glob-backslash.t
1332 1337
1333 1338 Test globbing of local IP addresses
1334 1339 $ echo 172.16.18.1
1335 1340 $LOCALIP (glob)
1336 1341 $ echo dead:beef::1
1337 1342 $LOCALIP (glob)
1338 1343
1339 1344 Add support for external test formatter
1340 1345 =======================================
1341 1346
1342 1347 $ CUSTOM_TEST_RESULT=basic_test_result "$PYTHON" $TESTDIR/run-tests.py --with-hg=`which hg` -j1 "$@" test-success.t test-failure.t
1343 1348 running 2 tests using 1 parallel processes
1344 1349
1345 1350 # Ran 2 tests, 0 skipped, 0 failed.
1346 1351 ON_START! <__main__.TestSuite tests=[<__main__.TTest testMethod=test-failure.t>, <__main__.TTest testMethod=test-success.t>]>
1347 1352 FAILURE! test-failure.t output changed
1348 1353 SUCCESS! test-success.t
1349 1354 ON_END!
1350 1355
1351 1356 Test reusability for third party tools
1352 1357 ======================================
1353 1358
1354 1359 $ mkdir "$TESTTMP"/anothertests
1355 1360 $ cd "$TESTTMP"/anothertests
1356 1361
1357 1362 test that `run-tests.py` can execute hghave, even if it runs not in
1358 1363 Mercurial source tree.
1359 1364
1360 1365 $ cat > test-hghave.t <<EOF
1361 1366 > #require true
1362 1367 > $ echo foo
1363 1368 > foo
1364 1369 > EOF
1365 1370 $ rt test-hghave.t
1366 1371 running 1 tests using 1 parallel processes
1367 1372 .
1368 1373 # Ran 1 tests, 0 skipped, 0 failed.
1369 1374
1370 1375 test that RUNTESTDIR refers the directory, in which `run-tests.py` now
1371 1376 running is placed.
1372 1377
1373 1378 $ cat > test-runtestdir.t <<EOF
1374 1379 > - $TESTDIR, in which test-run-tests.t is placed
1375 1380 > - \$TESTDIR, in which test-runtestdir.t is placed (expanded at runtime)
1376 1381 > - \$RUNTESTDIR, in which run-tests.py is placed (expanded at runtime)
1377 1382 >
1378 1383 > #if windows
1379 1384 > $ test "\$TESTDIR" = "$TESTTMP\anothertests"
1380 1385 > #else
1381 1386 > $ test "\$TESTDIR" = "$TESTTMP"/anothertests
1382 1387 > #endif
1383 1388 > If this prints a path, that means RUNTESTDIR didn't equal
1384 1389 > TESTDIR as it should have.
1385 1390 > $ test "\$RUNTESTDIR" = "$TESTDIR" || echo "\$RUNTESTDIR"
1386 1391 > This should print the start of check-code. If this passes but the
1387 1392 > previous check failed, that means we found a copy of check-code at whatever
1388 1393 > RUNTESTSDIR ended up containing, even though it doesn't match TESTDIR.
1389 1394 > $ head -n 3 "\$RUNTESTDIR"/../contrib/check-code.py | sed 's@.!.*python@#!USRBINENVPY@'
1390 1395 > #!USRBINENVPY
1391 1396 > #
1392 1397 > # check-code - a style and portability checker for Mercurial
1393 1398 > EOF
1394 1399 $ rt test-runtestdir.t
1395 1400 running 1 tests using 1 parallel processes
1396 1401 .
1397 1402 # Ran 1 tests, 0 skipped, 0 failed.
1398 1403
1399 1404 #if execbit
1400 1405
1401 1406 test that TESTDIR is referred in PATH
1402 1407
1403 1408 $ cat > custom-command.sh <<EOF
1404 1409 > #!/bin/sh
1405 1410 > echo "hello world"
1406 1411 > EOF
1407 1412 $ chmod +x custom-command.sh
1408 1413 $ cat > test-testdir-path.t <<EOF
1409 1414 > $ custom-command.sh
1410 1415 > hello world
1411 1416 > EOF
1412 1417 $ rt test-testdir-path.t
1413 1418 running 1 tests using 1 parallel processes
1414 1419 .
1415 1420 # Ran 1 tests, 0 skipped, 0 failed.
1416 1421
1417 1422 #endif
1418 1423
1419 1424 test support for --allow-slow-tests
1420 1425 $ cat > test-very-slow-test.t <<EOF
1421 1426 > #require slow
1422 1427 > $ echo pass
1423 1428 > pass
1424 1429 > EOF
1425 1430 $ rt test-very-slow-test.t
1426 1431 running 1 tests using 1 parallel processes
1427 1432 s
1428 1433 Skipped test-very-slow-test.t: missing feature: allow slow tests (use --allow-slow-tests)
1429 1434 # Ran 0 tests, 1 skipped, 0 failed.
1430 1435 $ rt $HGTEST_RUN_TESTS_PURE --allow-slow-tests test-very-slow-test.t
1431 1436 running 1 tests using 1 parallel processes
1432 1437 .
1433 1438 # Ran 1 tests, 0 skipped, 0 failed.
1434 1439
1435 1440 support for running a test outside the current directory
1436 1441 $ mkdir nonlocal
1437 1442 $ cat > nonlocal/test-is-not-here.t << EOF
1438 1443 > $ echo pass
1439 1444 > pass
1440 1445 > EOF
1441 1446 $ rt nonlocal/test-is-not-here.t
1442 1447 running 1 tests using 1 parallel processes
1443 1448 .
1444 1449 # Ran 1 tests, 0 skipped, 0 failed.
1445 1450
1446 1451 support for automatically discovering test if arg is a folder
1447 1452 $ mkdir tmp && cd tmp
1448 1453
1449 1454 $ cat > test-uno.t << EOF
1450 1455 > $ echo line
1451 1456 > line
1452 1457 > EOF
1453 1458
1454 1459 $ cp test-uno.t test-dos.t
1455 1460 $ cd ..
1456 1461 $ cp -R tmp tmpp
1457 1462 $ cp tmp/test-uno.t test-solo.t
1458 1463
1459 1464 $ rt tmp/ test-solo.t tmpp
1460 1465 running 5 tests using 1 parallel processes
1461 1466 .....
1462 1467 # Ran 5 tests, 0 skipped, 0 failed.
1463 1468 $ rm -rf tmp tmpp
1464 1469
1465 1470 support for running run-tests.py from another directory
1466 1471 $ mkdir tmp && cd tmp
1467 1472
1468 1473 $ cat > useful-file.sh << EOF
1469 1474 > important command
1470 1475 > EOF
1471 1476
1472 1477 $ cat > test-folder.t << EOF
1473 1478 > $ cat \$TESTDIR/useful-file.sh
1474 1479 > important command
1475 1480 > EOF
1476 1481
1477 1482 $ cat > test-folder-fail.t << EOF
1478 1483 > $ cat \$TESTDIR/useful-file.sh
1479 1484 > important commando
1480 1485 > EOF
1481 1486
1482 1487 $ cd ..
1483 1488 $ rt tmp/test-*.t
1484 1489 running 2 tests using 1 parallel processes
1485 1490
1486 1491 --- $TESTTMP/anothertests/tmp/test-folder-fail.t
1487 1492 +++ $TESTTMP/anothertests/tmp/test-folder-fail.t.err
1488 1493 @@ -1,2 +1,2 @@
1489 1494 $ cat $TESTDIR/useful-file.sh
1490 1495 - important commando
1491 1496 + important command
1492 1497
1493 1498 ERROR: test-folder-fail.t output changed
1494 1499 !.
1495 1500 Failed test-folder-fail.t: output changed
1496 1501 # Ran 2 tests, 0 skipped, 1 failed.
1497 1502 python hash seed: * (glob)
1498 1503 [1]
1499 1504
1500 1505 support for bisecting failed tests automatically
1501 1506 $ hg init bisect
1502 1507 $ cd bisect
1503 1508 $ cat >> test-bisect.t <<EOF
1504 1509 > $ echo pass
1505 1510 > pass
1506 1511 > EOF
1507 1512 $ hg add test-bisect.t
1508 1513 $ hg ci -m 'good'
1509 1514 $ cat >> test-bisect.t <<EOF
1510 1515 > $ echo pass
1511 1516 > fail
1512 1517 > EOF
1513 1518 $ hg ci -m 'bad'
1514 1519 $ rt --known-good-rev=0 test-bisect.t
1515 1520 running 1 tests using 1 parallel processes
1516 1521
1517 1522 --- $TESTTMP/anothertests/bisect/test-bisect.t
1518 1523 +++ $TESTTMP/anothertests/bisect/test-bisect.t.err
1519 1524 @@ -1,4 +1,4 @@
1520 1525 $ echo pass
1521 1526 pass
1522 1527 $ echo pass
1523 1528 - fail
1524 1529 + pass
1525 1530
1526 1531 ERROR: test-bisect.t output changed
1527 1532 !
1528 1533 Failed test-bisect.t: output changed
1529 1534 test-bisect.t broken by 72cbf122d116 (bad)
1530 1535 # Ran 1 tests, 0 skipped, 1 failed.
1531 1536 python hash seed: * (glob)
1532 1537 [1]
1533 1538
1534 1539 $ cd ..
1535 1540
1536 1541 support bisecting a separate repo
1537 1542
1538 1543 $ hg init bisect-dependent
1539 1544 $ cd bisect-dependent
1540 1545 $ cat > test-bisect-dependent.t <<EOF
1541 1546 > $ tail -1 \$TESTDIR/../bisect/test-bisect.t
1542 1547 > pass
1543 1548 > EOF
1544 1549 $ hg commit -Am dependent test-bisect-dependent.t
1545 1550
1546 1551 $ rt --known-good-rev=0 test-bisect-dependent.t
1547 1552 running 1 tests using 1 parallel processes
1548 1553
1549 1554 --- $TESTTMP/anothertests/bisect-dependent/test-bisect-dependent.t
1550 1555 +++ $TESTTMP/anothertests/bisect-dependent/test-bisect-dependent.t.err
1551 1556 @@ -1,2 +1,2 @@
1552 1557 $ tail -1 $TESTDIR/../bisect/test-bisect.t
1553 1558 - pass
1554 1559 + fail
1555 1560
1556 1561 ERROR: test-bisect-dependent.t output changed
1557 1562 !
1558 1563 Failed test-bisect-dependent.t: output changed
1559 1564 Failed to identify failure point for test-bisect-dependent.t
1560 1565 # Ran 1 tests, 0 skipped, 1 failed.
1561 1566 python hash seed: * (glob)
1562 1567 [1]
1563 1568
1564 1569 $ rt --bisect-repo=../test-bisect test-bisect-dependent.t
1565 1570 usage: run-tests.py [options] [tests]
1566 1571 run-tests.py: error: --bisect-repo cannot be used without --known-good-rev
1567 1572 [2]
1568 1573
1569 1574 $ rt --known-good-rev=0 --bisect-repo=../bisect test-bisect-dependent.t
1570 1575 running 1 tests using 1 parallel processes
1571 1576
1572 1577 --- $TESTTMP/anothertests/bisect-dependent/test-bisect-dependent.t
1573 1578 +++ $TESTTMP/anothertests/bisect-dependent/test-bisect-dependent.t.err
1574 1579 @@ -1,2 +1,2 @@
1575 1580 $ tail -1 $TESTDIR/../bisect/test-bisect.t
1576 1581 - pass
1577 1582 + fail
1578 1583
1579 1584 ERROR: test-bisect-dependent.t output changed
1580 1585 !
1581 1586 Failed test-bisect-dependent.t: output changed
1582 1587 test-bisect-dependent.t broken by 72cbf122d116 (bad)
1583 1588 # Ran 1 tests, 0 skipped, 1 failed.
1584 1589 python hash seed: * (glob)
1585 1590 [1]
1586 1591
1587 1592 $ cd ..
1588 1593
1589 1594 Test a broken #if statement doesn't break run-tests threading.
1590 1595 ==============================================================
1591 1596 $ mkdir broken
1592 1597 $ cd broken
1593 1598 $ cat > test-broken.t <<EOF
1594 1599 > true
1595 1600 > #if notarealhghavefeature
1596 1601 > $ false
1597 1602 > #endif
1598 1603 > EOF
1599 1604 $ for f in 1 2 3 4 ; do
1600 1605 > cat > test-works-$f.t <<EOF
1601 1606 > This is test case $f
1602 1607 > $ sleep 1
1603 1608 > EOF
1604 1609 > done
1605 1610 $ rt -j 2
1606 1611 running 5 tests using 2 parallel processes
1607 1612 ....
1608 1613 # Ran 5 tests, 0 skipped, 0 failed.
1609 1614 skipped: unknown feature: notarealhghavefeature
1610 1615
1611 1616 $ cd ..
1612 1617 $ rm -rf broken
1613 1618
1614 1619 Test cases in .t files
1615 1620 ======================
1616 1621 $ mkdir cases
1617 1622 $ cd cases
1618 1623 $ cat > test-cases-abc.t <<'EOF'
1619 1624 > #testcases A B C
1620 1625 > $ V=B
1621 1626 > #if A
1622 1627 > $ V=A
1623 1628 > #endif
1624 1629 > #if C
1625 1630 > $ V=C
1626 1631 > #endif
1627 1632 > $ echo $V | sed 's/A/C/'
1628 1633 > C
1629 1634 > #if C
1630 1635 > $ [ $V = C ]
1631 1636 > #endif
1632 1637 > #if A
1633 1638 > $ [ $V = C ]
1634 1639 > [1]
1635 1640 > #endif
1636 1641 > #if no-C
1637 1642 > $ [ $V = C ]
1638 1643 > [1]
1639 1644 > #endif
1640 1645 > $ [ $V = D ]
1641 1646 > [1]
1642 1647 > EOF
1643 1648 $ rt
1644 1649 running 3 tests using 1 parallel processes
1645 1650 .
1646 1651 --- $TESTTMP/anothertests/cases/test-cases-abc.t
1647 1652 +++ $TESTTMP/anothertests/cases/test-cases-abc.t#B.err
1648 1653 @@ -7,7 +7,7 @@
1649 1654 $ V=C
1650 1655 #endif
1651 1656 $ echo $V | sed 's/A/C/'
1652 1657 - C
1653 1658 + B
1654 1659 #if C
1655 1660 $ [ $V = C ]
1656 1661 #endif
1657 1662
1658 1663 ERROR: test-cases-abc.t#B output changed
1659 1664 !.
1660 1665 Failed test-cases-abc.t#B: output changed
1661 1666 # Ran 3 tests, 0 skipped, 1 failed.
1662 1667 python hash seed: * (glob)
1663 1668 [1]
1664 1669
1665 1670 --restart works
1666 1671
1667 1672 $ rt --restart
1668 1673 running 2 tests using 1 parallel processes
1669 1674
1670 1675 --- $TESTTMP/anothertests/cases/test-cases-abc.t
1671 1676 +++ $TESTTMP/anothertests/cases/test-cases-abc.t#B.err
1672 1677 @@ -7,7 +7,7 @@
1673 1678 $ V=C
1674 1679 #endif
1675 1680 $ echo $V | sed 's/A/C/'
1676 1681 - C
1677 1682 + B
1678 1683 #if C
1679 1684 $ [ $V = C ]
1680 1685 #endif
1681 1686
1682 1687 ERROR: test-cases-abc.t#B output changed
1683 1688 !.
1684 1689 Failed test-cases-abc.t#B: output changed
1685 1690 # Ran 2 tests, 0 skipped, 1 failed.
1686 1691 python hash seed: * (glob)
1687 1692 [1]
1688 1693
1689 1694 --restart works with outputdir
1690 1695
1691 1696 $ mkdir output
1692 1697 $ mv test-cases-abc.t#B.err output
1693 1698 $ rt --restart --outputdir output
1694 1699 running 2 tests using 1 parallel processes
1695 1700
1696 1701 --- $TESTTMP/anothertests/cases/test-cases-abc.t
1697 1702 +++ $TESTTMP/anothertests/cases/output/test-cases-abc.t#B.err
1698 1703 @@ -7,7 +7,7 @@
1699 1704 $ V=C
1700 1705 #endif
1701 1706 $ echo $V | sed 's/A/C/'
1702 1707 - C
1703 1708 + B
1704 1709 #if C
1705 1710 $ [ $V = C ]
1706 1711 #endif
1707 1712
1708 1713 ERROR: test-cases-abc.t#B output changed
1709 1714 !.
1710 1715 Failed test-cases-abc.t#B: output changed
1711 1716 # Ran 2 tests, 0 skipped, 1 failed.
1712 1717 python hash seed: * (glob)
1713 1718 [1]
1714 1719
1715 1720 Test TESTCASE variable
1716 1721
1717 1722 $ cat > test-cases-ab.t <<'EOF'
1718 1723 > $ dostuff() {
1719 1724 > > echo "In case $TESTCASE"
1720 1725 > > }
1721 1726 > #testcases A B
1722 1727 > #if A
1723 1728 > $ dostuff
1724 1729 > In case A
1725 1730 > #endif
1726 1731 > #if B
1727 1732 > $ dostuff
1728 1733 > In case B
1729 1734 > #endif
1730 1735 > EOF
1731 1736 $ rt test-cases-ab.t
1732 1737 running 2 tests using 1 parallel processes
1733 1738 ..
1734 1739 # Ran 2 tests, 0 skipped, 0 failed.
1735 1740
1736 1741 Support running a specific test case
1737 1742
1738 1743 $ rt "test-cases-abc.t#B"
1739 1744 running 1 tests using 1 parallel processes
1740 1745
1741 1746 --- $TESTTMP/anothertests/cases/test-cases-abc.t
1742 1747 +++ $TESTTMP/anothertests/cases/test-cases-abc.t#B.err
1743 1748 @@ -7,7 +7,7 @@
1744 1749 $ V=C
1745 1750 #endif
1746 1751 $ echo $V | sed 's/A/C/'
1747 1752 - C
1748 1753 + B
1749 1754 #if C
1750 1755 $ [ $V = C ]
1751 1756 #endif
1752 1757
1753 1758 ERROR: test-cases-abc.t#B output changed
1754 1759 !
1755 1760 Failed test-cases-abc.t#B: output changed
1756 1761 # Ran 1 tests, 0 skipped, 1 failed.
1757 1762 python hash seed: * (glob)
1758 1763 [1]
1759 1764
1760 1765 Support running multiple test cases in the same file
1761 1766
1762 1767 $ rt test-cases-abc.t#B test-cases-abc.t#C
1763 1768 running 2 tests using 1 parallel processes
1764 1769
1765 1770 --- $TESTTMP/anothertests/cases/test-cases-abc.t
1766 1771 +++ $TESTTMP/anothertests/cases/test-cases-abc.t#B.err
1767 1772 @@ -7,7 +7,7 @@
1768 1773 $ V=C
1769 1774 #endif
1770 1775 $ echo $V | sed 's/A/C/'
1771 1776 - C
1772 1777 + B
1773 1778 #if C
1774 1779 $ [ $V = C ]
1775 1780 #endif
1776 1781
1777 1782 ERROR: test-cases-abc.t#B output changed
1778 1783 !.
1779 1784 Failed test-cases-abc.t#B: output changed
1780 1785 # Ran 2 tests, 0 skipped, 1 failed.
1781 1786 python hash seed: * (glob)
1782 1787 [1]
1783 1788
1784 1789 Support ignoring invalid test cases
1785 1790
1786 1791 $ rt test-cases-abc.t#B test-cases-abc.t#D
1787 1792 running 1 tests using 1 parallel processes
1788 1793
1789 1794 --- $TESTTMP/anothertests/cases/test-cases-abc.t
1790 1795 +++ $TESTTMP/anothertests/cases/test-cases-abc.t#B.err
1791 1796 @@ -7,7 +7,7 @@
1792 1797 $ V=C
1793 1798 #endif
1794 1799 $ echo $V | sed 's/A/C/'
1795 1800 - C
1796 1801 + B
1797 1802 #if C
1798 1803 $ [ $V = C ]
1799 1804 #endif
1800 1805
1801 1806 ERROR: test-cases-abc.t#B output changed
1802 1807 !
1803 1808 Failed test-cases-abc.t#B: output changed
1804 1809 # Ran 1 tests, 0 skipped, 1 failed.
1805 1810 python hash seed: * (glob)
1806 1811 [1]
1807 1812
1808 1813 Support running complex test cases names
1809 1814
1810 1815 $ cat > test-cases-advanced-cases.t <<'EOF'
1811 1816 > #testcases simple case-with-dashes casewith_-.chars
1812 1817 > $ echo $TESTCASE
1813 1818 > simple
1814 1819 > EOF
1815 1820
1816 1821 $ cat test-cases-advanced-cases.t
1817 1822 #testcases simple case-with-dashes casewith_-.chars
1818 1823 $ echo $TESTCASE
1819 1824 simple
1820 1825
1821 1826 $ rt test-cases-advanced-cases.t
1822 1827 running 3 tests using 1 parallel processes
1823 1828
1824 1829 --- $TESTTMP/anothertests/cases/test-cases-advanced-cases.t
1825 1830 +++ $TESTTMP/anothertests/cases/test-cases-advanced-cases.t#case-with-dashes.err
1826 1831 @@ -1,3 +1,3 @@
1827 1832 #testcases simple case-with-dashes casewith_-.chars
1828 1833 $ echo $TESTCASE
1829 1834 - simple
1830 1835 + case-with-dashes
1831 1836
1832 1837 ERROR: test-cases-advanced-cases.t#case-with-dashes output changed
1833 1838 !
1834 1839 --- $TESTTMP/anothertests/cases/test-cases-advanced-cases.t
1835 1840 +++ $TESTTMP/anothertests/cases/test-cases-advanced-cases.t#casewith_-.chars.err
1836 1841 @@ -1,3 +1,3 @@
1837 1842 #testcases simple case-with-dashes casewith_-.chars
1838 1843 $ echo $TESTCASE
1839 1844 - simple
1840 1845 + casewith_-.chars
1841 1846
1842 1847 ERROR: test-cases-advanced-cases.t#casewith_-.chars output changed
1843 1848 !.
1844 1849 Failed test-cases-advanced-cases.t#case-with-dashes: output changed
1845 1850 Failed test-cases-advanced-cases.t#casewith_-.chars: output changed
1846 1851 # Ran 3 tests, 0 skipped, 2 failed.
1847 1852 python hash seed: * (glob)
1848 1853 [1]
1849 1854
1850 1855 $ rt "test-cases-advanced-cases.t#case-with-dashes"
1851 1856 running 1 tests using 1 parallel processes
1852 1857
1853 1858 --- $TESTTMP/anothertests/cases/test-cases-advanced-cases.t
1854 1859 +++ $TESTTMP/anothertests/cases/test-cases-advanced-cases.t#case-with-dashes.err
1855 1860 @@ -1,3 +1,3 @@
1856 1861 #testcases simple case-with-dashes casewith_-.chars
1857 1862 $ echo $TESTCASE
1858 1863 - simple
1859 1864 + case-with-dashes
1860 1865
1861 1866 ERROR: test-cases-advanced-cases.t#case-with-dashes output changed
1862 1867 !
1863 1868 Failed test-cases-advanced-cases.t#case-with-dashes: output changed
1864 1869 # Ran 1 tests, 0 skipped, 1 failed.
1865 1870 python hash seed: * (glob)
1866 1871 [1]
1867 1872
1868 1873 $ rt "test-cases-advanced-cases.t#casewith_-.chars"
1869 1874 running 1 tests using 1 parallel processes
1870 1875
1871 1876 --- $TESTTMP/anothertests/cases/test-cases-advanced-cases.t
1872 1877 +++ $TESTTMP/anothertests/cases/test-cases-advanced-cases.t#casewith_-.chars.err
1873 1878 @@ -1,3 +1,3 @@
1874 1879 #testcases simple case-with-dashes casewith_-.chars
1875 1880 $ echo $TESTCASE
1876 1881 - simple
1877 1882 + casewith_-.chars
1878 1883
1879 1884 ERROR: test-cases-advanced-cases.t#casewith_-.chars output changed
1880 1885 !
1881 1886 Failed test-cases-advanced-cases.t#casewith_-.chars: output changed
1882 1887 # Ran 1 tests, 0 skipped, 1 failed.
1883 1888 python hash seed: * (glob)
1884 1889 [1]
1885 1890
1886 1891 Test automatic pattern replacement
1887 1892 ==================================
1888 1893
1889 1894 $ cat << EOF >> common-pattern.py
1890 1895 > substitutions = [
1891 1896 > (br'foo-(.*)\\b',
1892 1897 > br'\$XXX=\\1\$'),
1893 1898 > (br'bar\\n',
1894 1899 > br'\$YYY$\\n'),
1895 1900 > ]
1896 1901 > EOF
1897 1902
1898 1903 $ cat << EOF >> test-substitution.t
1899 1904 > $ echo foo-12
1900 1905 > \$XXX=12$
1901 1906 > $ echo foo-42
1902 1907 > \$XXX=42$
1903 1908 > $ echo bar prior
1904 1909 > bar prior
1905 1910 > $ echo lastbar
1906 1911 > last\$YYY$
1907 1912 > $ echo foo-bar foo-baz
1908 1913 > EOF
1909 1914
1910 1915 $ rt test-substitution.t
1911 1916 running 1 tests using 1 parallel processes
1912 1917
1913 1918 --- $TESTTMP/anothertests/cases/test-substitution.t
1914 1919 +++ $TESTTMP/anothertests/cases/test-substitution.t.err
1915 1920 @@ -7,3 +7,4 @@
1916 1921 $ echo lastbar
1917 1922 last$YYY$
1918 1923 $ echo foo-bar foo-baz
1919 1924 + $XXX=bar foo-baz$
1920 1925
1921 1926 ERROR: test-substitution.t output changed
1922 1927 !
1923 1928 Failed test-substitution.t: output changed
1924 1929 # Ran 1 tests, 0 skipped, 1 failed.
1925 1930 python hash seed: * (glob)
1926 1931 [1]
1927 1932
1928 1933 --extra-config-opt works
1929 1934
1930 1935 $ cat << EOF >> test-config-opt.t
1931 1936 > $ hg init test-config-opt
1932 1937 > $ hg -R test-config-opt purge
1933 1938 > EOF
1934 1939
1935 1940 $ rt --extra-config-opt extensions.purge= test-config-opt.t
1936 1941 running 1 tests using 1 parallel processes
1937 1942 .
1938 1943 # Ran 1 tests, 0 skipped, 0 failed.
1939 1944
1940 1945 Test conditional output matching
1941 1946 ================================
1942 1947
1943 1948 $ cat << EOF >> test-conditional-matching.t
1944 1949 > #testcases foo bar
1945 1950 > $ echo richtig
1946 1951 > richtig (true !)
1947 1952 > $ echo falsch
1948 1953 > falsch (false !)
1949 1954 > #if foo
1950 1955 > $ echo arthur
1951 1956 > arthur (bar !)
1952 1957 > #endif
1953 1958 > $ echo celeste
1954 1959 > celeste (foo !)
1955 1960 > $ echo zephir
1956 1961 > zephir (bar !)
1957 1962 > EOF
1958 1963
1959 1964 $ rt test-conditional-matching.t
1960 1965 running 2 tests using 1 parallel processes
1961 1966
1962 1967 --- $TESTTMP/anothertests/cases/test-conditional-matching.t
1963 1968 +++ $TESTTMP/anothertests/cases/test-conditional-matching.t#bar.err
1964 1969 @@ -3,11 +3,13 @@
1965 1970 richtig (true !)
1966 1971 $ echo falsch
1967 1972 falsch (false !)
1968 1973 + falsch
1969 1974 #if foo
1970 1975 $ echo arthur
1971 1976 arthur \(bar !\) (re)
1972 1977 #endif
1973 1978 $ echo celeste
1974 1979 celeste \(foo !\) (re)
1975 1980 + celeste
1976 1981 $ echo zephir
1977 1982 zephir \(bar !\) (re)
1978 1983
1979 1984 ERROR: test-conditional-matching.t#bar output changed
1980 1985 !
1981 1986 --- $TESTTMP/anothertests/cases/test-conditional-matching.t
1982 1987 +++ $TESTTMP/anothertests/cases/test-conditional-matching.t#foo.err
1983 1988 @@ -3,11 +3,14 @@
1984 1989 richtig (true !)
1985 1990 $ echo falsch
1986 1991 falsch (false !)
1987 1992 + falsch
1988 1993 #if foo
1989 1994 $ echo arthur
1990 1995 arthur \(bar !\) (re)
1991 1996 + arthur
1992 1997 #endif
1993 1998 $ echo celeste
1994 1999 celeste \(foo !\) (re)
1995 2000 $ echo zephir
1996 2001 zephir \(bar !\) (re)
1997 2002 + zephir
1998 2003
1999 2004 ERROR: test-conditional-matching.t#foo output changed
2000 2005 !
2001 2006 Failed test-conditional-matching.t#bar: output changed
2002 2007 Failed test-conditional-matching.t#foo: output changed
2003 2008 # Ran 2 tests, 0 skipped, 2 failed.
2004 2009 python hash seed: * (glob)
2005 2010 [1]
General Comments 0
You need to be logged in to leave comments. Login now