# HG changeset patch # User Matt Mackall # Date 1303427985 18000 # Node ID fb867941518c4b452a85f1bf260ecfc9c8dc3c0c # Parent 3d47747bf5b315e4c91f0128eca466fd54658859 run-tests: move interactive handling into runone [ original upstream message ] diff -r 3d47747bf5b3 -r fb867941518c tests/run-tests.py --- a/tests/run-tests.py Wed Apr 20 21:41:41 2011 +0200 +++ b/tests/run-tests.py Thu Apr 21 18:19:45 2011 -0500 @@ -646,11 +646,19 @@ print "\nSkipping %s: %s" % (testpath, msg) return None - def fail(msg): - fails.append((test, msg)) + def fail(msg, ret): if not options.nodiff: print "\nERROR: %s %s" % (testpath, msg) - return None + if not ret and options.interactive: + print "Accept this change? [n] ", + answer = sys.stdin.readline().strip() + if answer.lower() in "y yes".split(): + if test.endswith(".t"): + rename(test + ".err", test) + else: + rename(test + ".err", test + ".out") + return + fails.append((test, msg)) vlog("# Test", test) @@ -747,18 +755,18 @@ if not missing: missing = ['irrelevant'] if failed: - fail("hghave failed checking for %s" % failed[-1]) + fail("hghave failed checking for %s" % failed[-1], ret) skipped = False else: skip(missing[-1]) elif out != refout: mark = '!' if ret == 'timeout': - fail("timed out") + fail("timed out", ret) elif ret: - fail("output changed and returned error code %d" % ret) + fail("output changed and returned error code %d" % ret, ret) else: - fail("output changed") + fail("output changed", ret) if ret != 'timeout' and not options.nodiff: if options.view: os.system("%s %s %s" % (options.view, ref, err)) @@ -767,7 +775,7 @@ ret = 1 elif ret: mark = '!' - fail("returned error code %d" % ret) + fail("returned error code %d" % ret, ret) if not options.verbose: sys.stdout.write(mark) @@ -950,17 +958,6 @@ if ret is None: skipped += 1 elif not ret: - if options.interactive: - print "Accept this change? [n] ", - answer = sys.stdin.readline().strip() - if answer.lower() in "y yes".split(): - if test.endswith(".t"): - rename(test + ".err", test) - else: - rename(test + ".err", test + ".out") - tested += 1 - fails.pop() - continue failed += 1 if options.first: break