Skip to content
This repository has been archived by the owner on Dec 18, 2018. It is now read-only.

Commit

Permalink
Merge pull request #136 from w3c/jgraham/executorservo_reftest_debug
Browse files Browse the repository at this point in the history
Support running reftests under a debugger with the servodriver executor
  • Loading branch information
jgraham committed Aug 11, 2015
2 parents 71c7894 + b4ebfac commit 0dd2dde
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 15 deletions.
43 changes: 29 additions & 14 deletions wptrunner/executors/executorservo.py
Expand Up @@ -189,26 +189,41 @@ def screenshot(self, test):
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:
self.command += ["--user-stylesheet", stylesheet]
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()
Expand Down
2 changes: 1 addition & 1 deletion wptrunner/wptcommandline.py
Expand Up @@ -290,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
Expand Down

0 comments on commit 0dd2dde

Please sign in to comment.