summaryrefslogtreecommitdiffstats
path: root/Tools/Scripts/webkitpy/layout_tests
diff options
context:
space:
mode:
Diffstat (limited to 'Tools/Scripts/webkitpy/layout_tests')
-rw-r--r--Tools/Scripts/webkitpy/layout_tests/deduplicate_tests_unittest.py2
-rw-r--r--Tools/Scripts/webkitpy/layout_tests/layout_package/dump_render_tree_thread.py8
-rw-r--r--Tools/Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py1
-rw-r--r--Tools/Scripts/webkitpy/layout_tests/layout_package/printing_unittest.py4
-rw-r--r--Tools/Scripts/webkitpy/layout_tests/layout_package/test_failures.py9
-rw-r--r--Tools/Scripts/webkitpy/layout_tests/layout_package/test_failures_unittest.py10
-rw-r--r--Tools/Scripts/webkitpy/layout_tests/layout_package/test_results.py19
-rw-r--r--Tools/Scripts/webkitpy/layout_tests/layout_package/test_results_unittest.py10
-rw-r--r--Tools/Scripts/webkitpy/layout_tests/layout_package/test_runner.py5
-rw-r--r--Tools/Scripts/webkitpy/layout_tests/port/chromium.py7
-rwxr-xr-xTools/Scripts/webkitpy/layout_tests/run_webkit_tests.py8
11 files changed, 57 insertions, 26 deletions
diff --git a/Tools/Scripts/webkitpy/layout_tests/deduplicate_tests_unittest.py b/Tools/Scripts/webkitpy/layout_tests/deduplicate_tests_unittest.py
index 309bf8d..47dc8a2 100644
--- a/Tools/Scripts/webkitpy/layout_tests/deduplicate_tests_unittest.py
+++ b/Tools/Scripts/webkitpy/layout_tests/deduplicate_tests_unittest.py
@@ -196,7 +196,7 @@ class ListDuplicatesTest(unittest.TestCase):
('LayoutTests/platform/mac/test.html',
('platform/mac/test.html', checkout_root)),
(None,
- ('platform/mac/test.html', os.path.join(checkout_root, 'WebCore'))),
+ ('platform/mac/test.html', os.path.join(checkout_root, 'Source', 'WebCore'))),
('test.html',
('platform/mac/test.html', os.path.join(layout_test_dir, 'platform/mac'))),
(None,
diff --git a/Tools/Scripts/webkitpy/layout_tests/layout_package/dump_render_tree_thread.py b/Tools/Scripts/webkitpy/layout_tests/layout_package/dump_render_tree_thread.py
index fdb8da6..2bb2d02 100644
--- a/Tools/Scripts/webkitpy/layout_tests/layout_package/dump_render_tree_thread.py
+++ b/Tools/Scripts/webkitpy/layout_tests/layout_package/dump_render_tree_thread.py
@@ -500,11 +500,9 @@ class TestShellThread(WatchableThread):
result = worker.get_test_result()
except AttributeError, e:
# This gets raised if the worker thread has already exited.
- failures = []
- _log.error('Cannot get results of test: %s' %
- test_input.filename)
- result = test_results.TestResult(test_input.filename, failures=[],
- test_run_time=0, total_time_for_all_diffs=0, time_for_diffs={})
+ _log.error('Cannot get results of test: %s' % test_input.filename)
+ # FIXME: Seems we want a unique failure type here.
+ result = test_results.TestResult(test_input.filename)
return result
diff --git a/Tools/Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py b/Tools/Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py
index 54d129b..12e65b2 100644
--- a/Tools/Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py
+++ b/Tools/Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py
@@ -46,6 +46,7 @@ import webkitpy.thirdparty.simplejson as simplejson
_log = logging.getLogger("webkitpy.layout_tests.layout_package.json_results_generator")
+# FIXME: We already have a TestResult class in test_results.py
class TestResult(object):
"""A simple class that represents a single test result."""
diff --git a/Tools/Scripts/webkitpy/layout_tests/layout_package/printing_unittest.py b/Tools/Scripts/webkitpy/layout_tests/layout_package/printing_unittest.py
index 0e478c8..9280b02 100644
--- a/Tools/Scripts/webkitpy/layout_tests/layout_package/printing_unittest.py
+++ b/Tools/Scripts/webkitpy/layout_tests/layout_package/printing_unittest.py
@@ -139,9 +139,7 @@ class Testprinter(unittest.TestCase):
elif result_type == test_expectations.CRASH:
failures = [test_failures.FailureCrash()]
path = os.path.join(self._port.layout_tests_dir(), test)
- return test_results.TestResult(path, failures, run_time,
- total_time_for_all_diffs=0,
- time_for_diffs=0)
+ return test_results.TestResult(path, failures=failures, test_run_time=run_time)
def get_result_summary(self, tests, expectations_str):
test_paths = [os.path.join(self._port.layout_tests_dir(), test) for
diff --git a/Tools/Scripts/webkitpy/layout_tests/layout_package/test_failures.py b/Tools/Scripts/webkitpy/layout_tests/layout_package/test_failures.py
index 6d55761..5dd0114 100644
--- a/Tools/Scripts/webkitpy/layout_tests/layout_package/test_failures.py
+++ b/Tools/Scripts/webkitpy/layout_tests/layout_package/test_failures.py
@@ -35,6 +35,9 @@ import test_expectations
import cPickle
+# FIXME: This is backwards. Each TestFailure subclass should know what
+# test_expectation type it corresponds too. Then this method just
+# collects them all from the failure list and returns the worst one.
def determine_result_type(failure_list):
"""Takes a set of test_failures and returns which result type best fits
the list of failures. "Best fits" means we use the worst type of failure.
@@ -88,6 +91,9 @@ class TestFailure(object):
def __ne__(self, other):
return self.__class__.__name__ != other.__class__.__name__
+ def __hash__(self):
+ return hash(self.__class__.__name__)
+
def dumps(self):
"""Returns the string/JSON representation of a TestFailure."""
return cPickle.dumps(self)
@@ -125,9 +131,6 @@ class FailureWithType(TestFailure):
use the standard OutputLinks.
"""
- def __init__(self):
- TestFailure.__init__(self)
-
# Filename suffixes used by ResultHtmlOutput.
OUT_FILENAMES = ()
diff --git a/Tools/Scripts/webkitpy/layout_tests/layout_package/test_failures_unittest.py b/Tools/Scripts/webkitpy/layout_tests/layout_package/test_failures_unittest.py
index 3e3528d..b2698d1 100644
--- a/Tools/Scripts/webkitpy/layout_tests/layout_package/test_failures_unittest.py
+++ b/Tools/Scripts/webkitpy/layout_tests/layout_package/test_failures_unittest.py
@@ -80,5 +80,15 @@ class Test(unittest.TestCase):
for c in ALL_FAILURE_CLASSES:
self.assert_loads(c)
+ def test_equals(self):
+ self.assertEqual(FailureCrash(), FailureCrash())
+ self.assertNotEqual(FailureCrash(), FailureTimeout())
+ crash_set = set([FailureCrash(), FailureCrash()])
+ self.assertEqual(len(crash_set), 1)
+ # The hash happens to be the name of the class, but sets still work:
+ crash_set = set([FailureCrash(), "FailureCrash"])
+ self.assertEqual(len(crash_set), 2)
+
+
if __name__ == '__main__':
unittest.main()
diff --git a/Tools/Scripts/webkitpy/layout_tests/layout_package/test_results.py b/Tools/Scripts/webkitpy/layout_tests/layout_package/test_results.py
index 2417fb7..055f65b 100644
--- a/Tools/Scripts/webkitpy/layout_tests/layout_package/test_results.py
+++ b/Tools/Scripts/webkitpy/layout_tests/layout_package/test_results.py
@@ -38,13 +38,14 @@ class TestResult(object):
def loads(str):
return cPickle.loads(str)
- def __init__(self, filename, failures, test_run_time,
- total_time_for_all_diffs, time_for_diffs):
- self.failures = failures
+ def __init__(self, filename, failures=None, test_run_time=None, total_time_for_all_diffs=None, time_for_diffs=None):
self.filename = filename
- self.test_run_time = test_run_time
- self.time_for_diffs = time_for_diffs
- self.total_time_for_all_diffs = total_time_for_all_diffs
+ self.failures = failures or []
+ self.test_run_time = test_run_time or 0
+ self.total_time_for_all_diffs = total_time_for_all_diffs or 0
+ self.time_for_diffs = time_for_diffs or {} # FIXME: Why is this a dictionary?
+
+ # FIXME: Setting this in the constructor makes this class hard to mutate.
self.type = test_failures.determine_result_type(failures)
def __eq__(self, other):
@@ -57,5 +58,11 @@ class TestResult(object):
def __ne__(self, other):
return not (self == other)
+ def has_failure_matching_types(self, types):
+ for failure in self.failures:
+ if type(failure) in types:
+ return True
+ return False
+
def dumps(self):
return cPickle.dumps(self)
diff --git a/Tools/Scripts/webkitpy/layout_tests/layout_package/test_results_unittest.py b/Tools/Scripts/webkitpy/layout_tests/layout_package/test_results_unittest.py
index 5921666..c8fcf64 100644
--- a/Tools/Scripts/webkitpy/layout_tests/layout_package/test_results_unittest.py
+++ b/Tools/Scripts/webkitpy/layout_tests/layout_package/test_results_unittest.py
@@ -32,12 +32,20 @@ from test_results import TestResult
class Test(unittest.TestCase):
+ def test_defaults(self):
+ result = TestResult("foo")
+ self.assertEqual(result.filename, 'foo')
+ self.assertEqual(result.failures, [])
+ self.assertEqual(result.test_run_time, 0)
+ self.assertEqual(result.total_time_for_all_diffs, 0)
+ self.assertEqual(result.time_for_diffs, {})
+
def test_loads(self):
result = TestResult(filename='foo',
failures=[],
test_run_time=1.1,
total_time_for_all_diffs=0.5,
- time_for_diffs=0.5)
+ time_for_diffs={})
s = result.dumps()
new_result = TestResult.loads(s)
self.assertTrue(isinstance(new_result, TestResult))
diff --git a/Tools/Scripts/webkitpy/layout_tests/layout_package/test_runner.py b/Tools/Scripts/webkitpy/layout_tests/layout_package/test_runner.py
index 24d04ca..5b02a00 100644
--- a/Tools/Scripts/webkitpy/layout_tests/layout_package/test_runner.py
+++ b/Tools/Scripts/webkitpy/layout_tests/layout_package/test_runner.py
@@ -251,6 +251,7 @@ class TestRunner:
overrides=overrides_str)
return self._expectations
+ # FIXME: This method is way too long and needs to be broken into pieces.
def prepare_lists_and_print_output(self):
"""Create appropriate subsets of test lists and returns a
ResultSummary object. Also prints expected test counts.
@@ -384,9 +385,7 @@ class TestRunner:
# subtracted out of self._test_files, above), but we stub out the
# results here so the statistics can remain accurate.
for test in skip_chunk:
- result = test_results.TestResult(test,
- failures=[], test_run_time=0, total_time_for_all_diffs=0,
- time_for_diffs=0)
+ result = test_results.TestResult(test)
result.type = test_expectations.SKIP
result_summary.add(result, expected=True)
self._printer.print_expected('')
diff --git a/Tools/Scripts/webkitpy/layout_tests/port/chromium.py b/Tools/Scripts/webkitpy/layout_tests/port/chromium.py
index 012e9cc..b90421a 100644
--- a/Tools/Scripts/webkitpy/layout_tests/port/chromium.py
+++ b/Tools/Scripts/webkitpy/layout_tests/port/chromium.py
@@ -380,8 +380,11 @@ class ChromiumDriver(base.Driver):
if self._port.get_option('js_flags') is not None:
cmd.append('--js-flags="' + self._port.get_option('js_flags') + '"')
- if self._port.get_option('multiple_loads') > 0:
- cmd.append('--multiple-loads=' + str(self._port.get_option('multiple_loads')))
+ if self._port.get_option('stress_opt'):
+ cmd.append('--stress-opt')
+
+ if self._port.get_option('stress_deopt'):
+ cmd.append('--stress-deopt')
# test_shell does not support accelerated compositing.
if not self._port.get_option("use_test_shell"):
diff --git a/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py b/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py
index f7e5330..c431765 100755
--- a/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py
+++ b/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py
@@ -215,10 +215,14 @@ def parse_args(args=None):
default=False, help="create a dialog on DumpRenderTree startup"),
optparse.make_option("--gp-fault-error-box", action="store_true",
default=False, help="enable Windows GP fault error box"),
- optparse.make_option("--multiple-loads",
- type="int", help="turn on multiple loads of each test"),
optparse.make_option("--js-flags",
type="string", help="JavaScript flags to pass to tests"),
+ optparse.make_option("--stress-opt", action="store_true",
+ default=False,
+ help="Enable additional stress test to JavaScript optimization"),
+ optparse.make_option("--stress-deopt", action="store_true",
+ default=False,
+ help="Enable additional stress test to JavaScript optimization"),
optparse.make_option("--nocheck-sys-deps", action="store_true",
default=False,
help="Don't check the system dependencies (themes)"),