mirror of
https://github.com/servo/servo.git
synced 2025-08-05 05:30:08 +01:00
fixes test-wpt cannot be run from anywhere but the root
This commit is contained in:
parent
210e068ac7
commit
dafe077280
1 changed files with 7 additions and 5 deletions
|
@ -243,13 +243,13 @@ class MachCommands(CommandBase):
|
||||||
def test_wpt(self, **kwargs):
|
def test_wpt(self, **kwargs):
|
||||||
self.ensure_bootstrapped()
|
self.ensure_bootstrapped()
|
||||||
self.ensure_wpt_virtualenv()
|
self.ensure_wpt_virtualenv()
|
||||||
hosts_file_path = path.join('tests', 'wpt', 'hosts')
|
hosts_file_path = path.join(self.context.topdir, 'tests', 'wpt', 'hosts')
|
||||||
|
|
||||||
os.environ["hosts_file_path"] = hosts_file_path
|
os.environ["hosts_file_path"] = hosts_file_path
|
||||||
|
|
||||||
kwargs["debug"] = not kwargs["release"]
|
kwargs["debug"] = not kwargs["release"]
|
||||||
|
|
||||||
run_file = path.abspath(path.join("tests", "wpt", "run_wpt.py"))
|
run_file = path.abspath(path.join(self.context.topdir, "tests", "wpt", "run_wpt.py"))
|
||||||
run_globals = {"__file__": run_file}
|
run_globals = {"__file__": run_file}
|
||||||
execfile(run_file, run_globals)
|
execfile(run_file, run_globals)
|
||||||
return run_globals["run_tests"](**kwargs)
|
return run_globals["run_tests"](**kwargs)
|
||||||
|
@ -326,7 +326,7 @@ class MachCommands(CommandBase):
|
||||||
return run_globals["update_tests"](**kwargs)
|
return run_globals["update_tests"](**kwargs)
|
||||||
|
|
||||||
def ensure_wpt_virtualenv(self):
|
def ensure_wpt_virtualenv(self):
|
||||||
virtualenv_path = path.join("tests", "wpt", "_virtualenv")
|
virtualenv_path = path.join(self.context.topdir, "tests", "wpt", "_virtualenv")
|
||||||
python = self.get_exec("python2", "python")
|
python = self.get_exec("python2", "python")
|
||||||
|
|
||||||
if not os.path.exists(virtualenv_path):
|
if not os.path.exists(virtualenv_path):
|
||||||
|
@ -342,9 +342,11 @@ class MachCommands(CommandBase):
|
||||||
from wptrunner.browsers import servo # noqa
|
from wptrunner.browsers import servo # noqa
|
||||||
except ImportError:
|
except ImportError:
|
||||||
subprocess.check_call(["pip", "install", "-r",
|
subprocess.check_call(["pip", "install", "-r",
|
||||||
path.join("tests", "wpt", "harness", "requirements.txt")])
|
path.join(self.context.topdir, "tests", "wpt",
|
||||||
|
"harness", "requirements.txt")])
|
||||||
subprocess.check_call(["pip", "install", "-r",
|
subprocess.check_call(["pip", "install", "-r",
|
||||||
path.join("tests", "wpt", "harness", "requirements_servo.txt")])
|
path.join(self.context.topdir, "tests", "wpt",
|
||||||
|
"harness", "requirements_servo.txt")])
|
||||||
try:
|
try:
|
||||||
import blessings
|
import blessings
|
||||||
except ImportError:
|
except ImportError:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue