# HG changeset patch # User Matt Mackall # Date 2006-11-08 19:20:08 # Node ID 02e9355c3420e4da5c8b4c1434100383d79d9ddf # Parent cc0cd5942223d52a12a5d7cbb067f994e8cae6bf tests: add -i switch Prompt to accept changes for tests where output changed diff --git a/tests/run-tests.py b/tests/run-tests.py --- a/tests/run-tests.py +++ b/tests/run-tests.py @@ -38,6 +38,8 @@ parser.add_option("-f", "--first", actio help="exit on the first test failure") parser.add_option("-R", "--restart", action="store_true", help="restart at last error") +parser.add_option("-i", "--interactive", action="store_true", + help="prompt to accept changed output") parser.set_defaults(timeout=180) (options, args) = parser.parse_args() @@ -391,6 +393,13 @@ try: 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(): + os.rename(test + ".err", test + ".out") + tested += 1 + continue failed += 1 if options.first: break