mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1194131 - Update to latest wptrunner, a=testonly
This commit is contained in:
parent
b28e3dd40b
commit
d736523d93
@ -26,7 +26,8 @@ def check_args(**kwargs):
|
||||
|
||||
def browser_kwargs(**kwargs):
|
||||
return {"binary": kwargs["binary"],
|
||||
"debug_info": kwargs["debug_info"]}
|
||||
"debug_info": kwargs["debug_info"],
|
||||
"user_stylesheets": kwargs.get("user_stylesheets")}
|
||||
|
||||
|
||||
def executor_kwargs(test_type, server_config, cache_manager, run_info_data,
|
||||
@ -44,11 +45,13 @@ def env_options():
|
||||
|
||||
|
||||
class ServoBrowser(NullBrowser):
|
||||
def __init__(self, logger, binary, debug_info=None):
|
||||
def __init__(self, logger, binary, debug_info=None, user_stylesheets=None):
|
||||
NullBrowser.__init__(self, logger)
|
||||
self.binary = binary
|
||||
self.debug_info = debug_info
|
||||
self.user_stylesheets = user_stylesheets or []
|
||||
|
||||
def executor_browser(self):
|
||||
return ExecutorBrowser, {"binary": self.binary,
|
||||
"debug_info": self.debug_info}
|
||||
"debug_info": self.debug_info,
|
||||
"user_stylesheets": self.user_stylesheets}
|
||||
|
@ -62,9 +62,10 @@ class ServoTestharnessExecutor(ProcessTestExecutor):
|
||||
self.result_data = None
|
||||
self.result_flag = threading.Event()
|
||||
|
||||
debug_args, command = browser_command(self.binary,
|
||||
["--cpu", "--hard-fail", "-u", "Servo/wptrunner", "-z", self.test_url(test)],
|
||||
self.debug_info)
|
||||
args = ["--cpu", "--hard-fail", "-u", "Servo/wptrunner", "-z", self.test_url(test)]
|
||||
for stylesheet in self.browser.user_stylesheets:
|
||||
args += ["--user-stylesheet", stylesheet]
|
||||
debug_args, command = browser_command(self.binary, args, self.debug_info)
|
||||
|
||||
self.command = command
|
||||
|
||||
@ -188,24 +189,41 @@ class ServoRefTestExecutor(ProcessTestExecutor):
|
||||
full_url = self.test_url(test)
|
||||
|
||||
with TempFilename(self.tempdir) as output_path:
|
||||
self.command = [self.binary, "--cpu", "--hard-fail", "--exit",
|
||||
"-u", "Servo/wptrunner", "-Z", "disable-text-aa",
|
||||
"--output=%s" % output_path, full_url]
|
||||
debug_args, command = browser_command(
|
||||
self.binary,
|
||||
["--cpu", "--hard-fail", "--exit", "-u", "Servo/wptrunner",
|
||||
"-Z", "disable-text-aa", "--output=%s" % output_path, full_url],
|
||||
self.debug_info)
|
||||
|
||||
for stylesheet in self.browser.user_stylesheets:
|
||||
command += ["--user-stylesheet", stylesheet]
|
||||
|
||||
self.command = debug_args + command
|
||||
|
||||
env = os.environ.copy()
|
||||
env["HOST_FILE"] = self.hosts_path
|
||||
|
||||
self.proc = ProcessHandler(self.command,
|
||||
processOutputLine=[self.on_output],
|
||||
env=env)
|
||||
if not self.interactive:
|
||||
self.proc = ProcessHandler(self.command,
|
||||
processOutputLine=[self.on_output],
|
||||
env=env)
|
||||
|
||||
try:
|
||||
self.proc.run()
|
||||
timeout = test.timeout * self.timeout_multiplier + 5
|
||||
rv = self.proc.wait(timeout=timeout)
|
||||
except KeyboardInterrupt:
|
||||
self.proc.kill()
|
||||
raise
|
||||
|
||||
try:
|
||||
self.proc.run()
|
||||
timeout = test.timeout * self.timeout_multiplier + 5
|
||||
rv = self.proc.wait(timeout=timeout)
|
||||
except KeyboardInterrupt:
|
||||
self.proc.kill()
|
||||
raise
|
||||
else:
|
||||
self.proc = subprocess.Popen(self.command,
|
||||
env=env)
|
||||
try:
|
||||
rv = self.proc.wait()
|
||||
except KeyboardInterrupt:
|
||||
self.proc.kill()
|
||||
raise
|
||||
|
||||
if rv is None:
|
||||
self.proc.kill()
|
||||
|
@ -496,7 +496,7 @@ class TestLoader(object):
|
||||
def iter_tests(self):
|
||||
manifest_items = []
|
||||
|
||||
for manifest in sorted(self.manifests.keys()):
|
||||
for manifest in sorted(self.manifests.keys(), key=lambda x:x.url_base):
|
||||
manifest_iter = iterfilter(self.manifest_filters,
|
||||
manifest.itertypes(*self.test_types))
|
||||
manifest_items.extend(manifest_iter)
|
||||
|
@ -159,6 +159,11 @@ def create_parser(product_choices=None):
|
||||
b2g_group.add_argument("--b2g-no-backup", action="store_true", default=False,
|
||||
help="Don't backup device before testrun with --product=b2g")
|
||||
|
||||
servo_group = parser.add_argument_group("Servo-specific")
|
||||
servo_group.add_argument("--user-stylesheet",
|
||||
default=[], action="append", dest="user_stylesheets",
|
||||
help="Inject a user CSS stylesheet into every test.")
|
||||
|
||||
parser.add_argument("test_list", nargs="*",
|
||||
help="List of URLs for tests to run, or paths including tests to run. "
|
||||
"(equivalent to --include)")
|
||||
@ -285,7 +290,7 @@ def check_args(kwargs):
|
||||
kwargs["debugger"] = mozdebug.get_default_debugger_name()
|
||||
debug_info = mozdebug.get_debugger_info(kwargs["debugger"],
|
||||
kwargs["debugger_args"])
|
||||
if debug_info.interactive:
|
||||
if debug_info and debug_info.interactive:
|
||||
if kwargs["processes"] != 1:
|
||||
kwargs["processes"] = 1
|
||||
kwargs["no_capture_stdio"] = True
|
||||
|
Loading…
Reference in New Issue
Block a user