changeset 3300:642e5faf6bf0

run-tests: add --retest switch -r reruns tests for which a .err file exists
author Matt Mackall <mpm@selenic.com>
date Mon, 09 Oct 2006 23:05:11 -0500
parents e7abcf3a7c5f
children 3cd51b986172
files tests/run-tests.py
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/tests/run-tests.py	Mon Oct 09 21:27:04 2006 -0500
+++ b/tests/run-tests.py	Mon Oct 09 23:05:11 2006 -0500
@@ -32,6 +32,9 @@
     help="print a test coverage report inc. standard libraries")
 parser.add_option("-C", "--annotate", action="store_true",
     help="output files annotated with coverage")
+parser.add_option("-r", "--retest", action="store_true",
+    help="retest failed tests")
+
 parser.set_defaults(timeout=180)
 (options, args) = parser.parse_args()
 verbose = options.verbose
@@ -360,6 +363,9 @@
             if (test.startswith("test-") and '~' not in test and
                 ('.' not in test or test.endswith('.py') or
                  test.endswith('.bat'))):
+                if options.retest and not os.path.exists(test + ".err"):
+                    skipped += 1
+                    continue
                 ret = run_one(test)
                 if ret is None:
                     skipped += 1