diff options
author | evanm@google.com <evanm@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-12-04 00:42:43 +0000 |
---|---|---|
committer | evanm@google.com <evanm@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-12-04 00:42:43 +0000 |
commit | e588f2ddaf165390676b79e8c959051557193af3 (patch) | |
tree | d63488c94483ec6f945e28322781b1f917bdd9bb | |
parent | cc28c93a338537fa2eb4239b540a8b8943aa8bd5 (diff) | |
download | chromium_src-e588f2ddaf165390676b79e8c959051557193af3.zip chromium_src-e588f2ddaf165390676b79e8c959051557193af3.tar.gz chromium_src-e588f2ddaf165390676b79e8c959051557193af3.tar.bz2 |
Add a flag to the layout test runner to run tests in random order.
This is useful for isolating whether a crash is caused by a particular
test or by corruption in the test shell in general.
Review URL: http://codereview.chromium.org/12926
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6339 0039d316-1c4b-4281-b951-d872f2087c98
-rwxr-xr-x | webkit/tools/layout_tests/run_webkit_tests.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/webkit/tools/layout_tests/run_webkit_tests.py b/webkit/tools/layout_tests/run_webkit_tests.py index 102c4bd..12eaf08 100755 --- a/webkit/tools/layout_tests/run_webkit_tests.py +++ b/webkit/tools/layout_tests/run_webkit_tests.py @@ -25,6 +25,7 @@ import logging import optparse import os import Queue +import random import shutil import subprocess import sys @@ -227,7 +228,10 @@ class TestRunner: google.path_utils.MaybeMakeDirectory(self._options.results_directory) test_files = list(self._test_files) - test_files.sort(self.TestFilesSort) + if self._options.randomize_order: + random.shuffle(test_files) + else: + test_files.sort(self.TestFilesSort) # Create the thread safe queue of (test filenames, test URIs) tuples. Each # TestShellThread pulls values from this queue. filename_queue = Queue.Queue() @@ -661,5 +665,9 @@ if '__main__' == __name__: option_parser.add_option("", "--nocheck-sys-deps", action="store_true", default=False, help="Don't check the system dependencies (themes)") + option_parser.add_option("", "--randomize-order", action="store_true", + default=False, + help=("Run tests in random order (useful for " + "tracking down corruption)")) options, args = option_parser.parse_args() main(options, args) |