From f78dc9f613ec8788c894343955bfd376e260bb41 Mon Sep 17 00:00:00 2001 From: Austin Hicks Date: Mon, 19 Jun 2017 21:15:20 -0400 Subject: [PATCH 1/2] Minimal changes to get WPT tests running on Windows. --- tests/wpt/grouping_formatter.py | 7 ++++++- tests/wpt/harness/wptrunner/wptcommandline.py | 4 +++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/tests/wpt/grouping_formatter.py b/tests/wpt/grouping_formatter.py index 5bca29eec62..a02714b7068 100644 --- a/tests/wpt/grouping_formatter.py +++ b/tests/wpt/grouping_formatter.py @@ -7,6 +7,7 @@ import collections import os import sys import subprocess +import platform DEFAULT_MOVE_UP_CODE = u"\x1b[A" DEFAULT_CLEAR_EOL_CODE = u"\x1b[K" @@ -29,8 +30,12 @@ class GroupingFormatter(base.BaseFormatter): # TODO(mrobinson, 8313): We need to add support for Windows terminals here. if self.interactive: - self.line_width = int(subprocess.check_output(['stty', 'size']).split()[1]) self.move_up, self.clear_eol = self.get_move_up_and_clear_eol_codes() + if platform.system() != "Windows": + self.line_width = int(subprocess.check_output(['stty', 'size']).split()[1]) + else: + # Until we figure out proper Windows support, this makes things work well enough to run. + self.line_width = 80 self.expected = { 'OK': 0, diff --git a/tests/wpt/harness/wptrunner/wptcommandline.py b/tests/wpt/harness/wptrunner/wptcommandline.py index 38e7b8f5363..d7dd0534729 100644 --- a/tests/wpt/harness/wptrunner/wptcommandline.py +++ b/tests/wpt/harness/wptrunner/wptcommandline.py @@ -256,8 +256,10 @@ def exe_path(name): return path = find_executable(name) - if os.access(path, os.X_OK): + if path and os.access(path, os.X_OK): return path + else: + return None def check_args(kwargs): From 8c82f862309a14e85bafc257b8cfae6085d5c003 Mon Sep 17 00:00:00 2001 From: Austin Hicks Date: Mon, 19 Jun 2017 22:03:07 -0400 Subject: [PATCH 2/2] mach test --all doesn't crash when trying to run tidy. --- python/servo/testing_commands.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/python/servo/testing_commands.py b/python/servo/testing_commands.py index 78d745df3b2..2d4df90755b 100644 --- a/python/servo/testing_commands.py +++ b/python/servo/testing_commands.py @@ -45,7 +45,8 @@ WEB_PLATFORM_TESTS_PATH = os.path.join("tests", "wpt", "web-platform-tests") SERVO_TESTS_PATH = os.path.join("tests", "wpt", "mozilla", "tests") TEST_SUITES = OrderedDict([ - ("tidy", {"kwargs": {"all_files": False, "no_progress": False, "self_test": False}, + ("tidy", {"kwargs": {"all_files": False, "no_progress": False, "self_test": False, + "stylo": False}, "include_arg": "include"}), ("wpt", {"kwargs": {"release": False}, "paths": [path.abspath(WEB_PLATFORM_TESTS_PATH), @@ -111,7 +112,8 @@ class MachCommands(CommandBase): def test(self, params, render_mode=DEFAULT_RENDER_MODE, release=False, tidy_all=False, no_progress=False, self_test=False, all_suites=False): suites = copy.deepcopy(TEST_SUITES) - suites["tidy"]["kwargs"] = {"all_files": tidy_all, "no_progress": no_progress, "self_test": self_test} + suites["tidy"]["kwargs"] = {"all_files": tidy_all, "no_progress": no_progress, "self_test": self_test, + "stylo": False} suites["wpt"]["kwargs"] = {"release": release} suites["css"]["kwargs"] = {"release": release} suites["unit"]["kwargs"] = {}