changeset 19057:3d265e0822d3

run-tests: introduce --random for running tests in random error This is convenient when investigating failures one by one to avoid running the same fixed tests first every time.
author Mads Kiilerich <madski@unity3d.com>
date Wed, 17 Apr 2013 03:41:34 +0200
parents ac41bb76c737
children d8d548d868d3
files tests/run-tests.py
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/tests/run-tests.py	Wed Apr 17 03:41:11 2013 +0200
+++ b/tests/run-tests.py	Wed Apr 17 03:41:34 2013 +0200
@@ -198,6 +198,8 @@
         help="enable Py3k warnings on Python 2.6+")
     parser.add_option('--extra-config-opt', action="append",
                       help='set the given config opt in the test hgrc')
+    parser.add_option('--random', action="store_true",
+                      help='run tests in random order')
 
     for option, (envvar, default) in defaults.items():
         defaults[option] = type(default)(os.environ.get(envvar, default))
@@ -1248,6 +1250,9 @@
 
     tests = args
 
+    if options.random:
+        random.shuffle(tests)
+
     # Reset some environment variables to well-known values so that
     # the tests produce repeatable output.
     os.environ['LANG'] = os.environ['LC_ALL'] = os.environ['LANGUAGE'] = 'C'