From e588f2ddaf165390676b79e8c959051557193af3 Mon Sep 17 00:00:00 2001 From: "evanm@google.com" Date: Thu, 4 Dec 2008 00:42:43 +0000 Subject: 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 --- webkit/tools/layout_tests/run_webkit_tests.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'webkit') 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) -- cgit v1.1