Mercurial > hg > mercurial-crew-with-dirclash
comparison tests/run-tests.py @ 3307:3cd51b986172
run-tests: add --first switch to exit on first error
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Mon, 09 Oct 2006 23:08:41 -0500 |
parents | 642e5faf6bf0 |
children | a90a86929d04 |
comparison
equal
deleted
inserted
replaced
3306:642e5faf6bf0 | 3307:3cd51b986172 |
---|---|
32 help="print a test coverage report inc. standard libraries") | 32 help="print a test coverage report inc. standard libraries") |
33 parser.add_option("-C", "--annotate", action="store_true", | 33 parser.add_option("-C", "--annotate", action="store_true", |
34 help="output files annotated with coverage") | 34 help="output files annotated with coverage") |
35 parser.add_option("-r", "--retest", action="store_true", | 35 parser.add_option("-r", "--retest", action="store_true", |
36 help="retest failed tests") | 36 help="retest failed tests") |
37 parser.add_option("-f", "--first", action="store_true", | |
38 help="exit on the first test failure") | |
37 | 39 |
38 parser.set_defaults(timeout=180) | 40 parser.set_defaults(timeout=180) |
39 (options, args) = parser.parse_args() | 41 (options, args) = parser.parse_args() |
40 verbose = options.verbose | 42 verbose = options.verbose |
41 coverage = options.cover or options.cover_stdlib or options.annotate | 43 coverage = options.cover or options.cover_stdlib or options.annotate |
369 ret = run_one(test) | 371 ret = run_one(test) |
370 if ret is None: | 372 if ret is None: |
371 skipped += 1 | 373 skipped += 1 |
372 elif not ret: | 374 elif not ret: |
373 failed += 1 | 375 failed += 1 |
376 if options.first: | |
377 break | |
374 tests += 1 | 378 tests += 1 |
375 | 379 |
376 print "\n# Ran %d tests, %d skipped, %d failed." % (tests, skipped, | 380 print "\n# Ran %d tests, %d skipped, %d failed." % (tests, skipped, |
377 failed) | 381 failed) |
378 if coverage: | 382 if coverage: |