Show More
@@ -63,6 +63,8 b' parser.add_option("--tmpdir", type="stri' | |||||
63 | help="run tests in the given temporary directory") |
|
63 | help="run tests in the given temporary directory") | |
64 | parser.add_option("-v", "--verbose", action="store_true", |
|
64 | parser.add_option("-v", "--verbose", action="store_true", | |
65 | help="output verbose messages") |
|
65 | help="output verbose messages") | |
|
66 | parser.add_option("-n", "--nodiff", action="store_true", | |||
|
67 | help="skip showing test changes") | |||
66 | parser.add_option("--with-hg", type="string", |
|
68 | parser.add_option("--with-hg", type="string", | |
67 | help="test existing install at given location") |
|
69 | help="test existing install at given location") | |
68 |
|
70 | |||
@@ -71,6 +73,7 b' for option, default in defaults.items():' | |||||
71 | parser.set_defaults(**defaults) |
|
73 | parser.set_defaults(**defaults) | |
72 | (options, args) = parser.parse_args() |
|
74 | (options, args) = parser.parse_args() | |
73 | verbose = options.verbose |
|
75 | verbose = options.verbose | |
|
76 | nodiff = options.nodiff | |||
74 | coverage = options.cover or options.cover_stdlib or options.annotate |
|
77 | coverage = options.cover or options.cover_stdlib or options.annotate | |
75 | python = sys.executable |
|
78 | python = sys.executable | |
76 |
|
79 | |||
@@ -308,7 +311,8 b' def run_one(test, skips, fails):' | |||||
308 |
|
311 | |||
309 | def fail(msg): |
|
312 | def fail(msg): | |
310 | fails.append((test, msg)) |
|
313 | fails.append((test, msg)) | |
311 | print "\nERROR: %s %s" % (test, msg) |
|
314 | if not nodiff: | |
|
315 | print "\nERROR: %s %s" % (test, msg) | |||
312 | return None |
|
316 | return None | |
313 |
|
317 | |||
314 | vlog("# Test", test) |
|
318 | vlog("# Test", test) | |
@@ -374,6 +378,8 b' def run_one(test, skips, fails):' | |||||
374 | if options.timeout > 0: |
|
378 | if options.timeout > 0: | |
375 | signal.alarm(0) |
|
379 | signal.alarm(0) | |
376 |
|
380 | |||
|
381 | mark = '.' | |||
|
382 | ||||
377 | skipped = (ret == SKIPPED_STATUS) |
|
383 | skipped = (ret == SKIPPED_STATUS) | |
378 | # If reference output file exists, check test output against it |
|
384 | # If reference output file exists, check test output against it | |
379 | if os.path.exists(ref): |
|
385 | if os.path.exists(ref): | |
@@ -383,22 +389,26 b' def run_one(test, skips, fails):' | |||||
383 | else: |
|
389 | else: | |
384 | ref_out = [] |
|
390 | ref_out = [] | |
385 | if skipped: |
|
391 | if skipped: | |
|
392 | mark = 's' | |||
386 | missing = extract_missing_features(out) |
|
393 | missing = extract_missing_features(out) | |
387 | if not missing: |
|
394 | if not missing: | |
388 | missing = ['irrelevant'] |
|
395 | missing = ['irrelevant'] | |
389 | skip(missing[-1]) |
|
396 | skip(missing[-1]) | |
390 | elif out != ref_out: |
|
397 | elif out != ref_out: | |
|
398 | mark = '!' | |||
391 | if ret: |
|
399 | if ret: | |
392 | fail("output changed and returned error code %d" % ret) |
|
400 | fail("output changed and returned error code %d" % ret) | |
393 | else: |
|
401 | else: | |
394 | fail("output changed") |
|
402 | fail("output changed") | |
395 | show_diff(ref_out, out) |
|
403 | if not nodiff: | |
|
404 | show_diff(ref_out, out) | |||
396 | ret = 1 |
|
405 | ret = 1 | |
397 | elif ret: |
|
406 | elif ret: | |
|
407 | mark = '!' | |||
398 | fail("returned error code %d" % ret) |
|
408 | fail("returned error code %d" % ret) | |
399 |
|
409 | |||
400 | if not verbose: |
|
410 | if not verbose: | |
401 |
sys.stdout.write( |
|
411 | sys.stdout.write(mark) | |
402 | sys.stdout.flush() |
|
412 | sys.stdout.flush() | |
403 |
|
413 | |||
404 | if ret != 0 and not skipped: |
|
414 | if ret != 0 and not skipped: |
General Comments 0
You need to be logged in to leave comments.
Login now