summaryrefslogtreecommitdiffstats
path: root/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py
diff options
context:
space:
mode:
Diffstat (limited to 'Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py')
-rwxr-xr-xTools/Scripts/webkitpy/layout_tests/run_webkit_tests.py20
1 files changed, 11 insertions, 9 deletions
diff --git a/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py b/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py
index a141661..17b6e89 100755
--- a/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py
+++ b/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py
@@ -32,7 +32,6 @@
from __future__ import with_statement
-import codecs
import errno
import logging
import optparse
@@ -80,7 +79,7 @@ def run(port, options, args, regular_output=sys.stderr,
printer.cleanup()
return 0
- last_unexpected_results = _gather_unexpected_results(options)
+ last_unexpected_results = _gather_unexpected_results(port._filesystem, options)
if options.print_last_failures:
printer.write("\n".join(last_unexpected_results) + "\n")
printer.cleanup()
@@ -146,7 +145,7 @@ def _set_up_derived_options(port_obj, options):
if not options.use_apache:
options.use_apache = sys.platform in ('darwin', 'linux2')
- if not os.path.isabs(options.results_directory):
+ if not port_obj._filesystem.isabs(options.results_directory):
# This normalizes the path to the build dir.
# FIXME: how this happens is not at all obvious; this is a dumb
# interface and should be cleaned up.
@@ -162,15 +161,16 @@ def _set_up_derived_options(port_obj, options):
return warnings
-def _gather_unexpected_results(options):
+def _gather_unexpected_results(filesystem, options):
"""Returns the unexpected results from the previous run, if any."""
last_unexpected_results = []
if options.print_last_failures or options.retest_last_failures:
- unexpected_results_filename = os.path.join(
- options.results_directory, "unexpected_results.json")
- with codecs.open(unexpected_results_filename, "r", "utf-8") as file:
- results = simplejson.load(file)
- last_unexpected_results = results['tests'].keys()
+ unexpected_results_filename = filesystem.join(
+ options.results_directory, "unexpected_results.json")
+ if filesystem.exists(unexpected_results_filename):
+ content = filesystem.read_text_file(unexpected_results_filename)
+ results = simplejson.loads(content)
+ last_unexpected_results = results['tests'].keys()
return last_unexpected_results
@@ -277,6 +277,8 @@ def parse_args(args=None):
default="layout-test-results",
help="Output results directory source dir, relative to Debug or "
"Release"),
+ optparse.make_option("--build-directory",
+ help="Path to the directory under which build files are kept (should not include configuration)"),
optparse.make_option("--new-baseline", action="store_true",
default=False, help="Save all generated results as new baselines "
"into the platform directory, overwriting whatever's "