run-tests: add --loop support stable
authorMatt Mackall <mpm@selenic.com>
Sun, 02 Jun 2013 18:09:06 -0500
branchstable
changeset 1261 13890d7a70b1
parent 1260 d9ebd2545572
child 1262 f06138614934
child 1263 f31eefe0ab4c
run-tests: add --loop support This makes it easy to run tests repeatedly at high loads to look for test failures. [ original upstream message ]
tests/run-tests.py
--- a/tests/run-tests.py	Sun Jun 02 17:58:51 2013 -0500
+++ b/tests/run-tests.py	Sun Jun 02 18:09:06 2013 -0500
@@ -159,6 +159,8 @@
         help="run tests matching keywords")
     parser.add_option("-l", "--local", action="store_true",
         help="shortcut for --with-hg=<testdir>/../hg")
+    parser.add_option("--loop", action="store_true",
+        help="loop tests repeatedly")
     parser.add_option("-n", "--nodiff", action="store_true",
         help="skip showing test changes")
     parser.add_option("-p", "--port", type="int",
@@ -1088,6 +1090,8 @@
                 running -= 1
             if tests and not running == jobs:
                 test = tests.pop(0)
+                if options.loop:
+                    tests.append(test)
                 t = threading.Thread(None, job, args=(test, count))
                 t.start()
                 running += 1