diff options
Diffstat (limited to 'python/mach_bootstrap.py')
-rw-r--r-- | python/mach_bootstrap.py | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/python/mach_bootstrap.py b/python/mach_bootstrap.py index a857889b84a..f34689993a7 100644 --- a/python/mach_bootstrap.py +++ b/python/mach_bootstrap.py @@ -14,11 +14,6 @@ SEARCH_PATHS = [ os.path.join("python", "tidy"), ] -WPT_SEARCH_PATHS = [ - ".", - "harness", -] - # Individual files providing mach commands. MACH_MODULES = [ os.path.join('python', 'servo', 'bootstrap_commands.py'), @@ -106,7 +101,7 @@ def _get_virtualenv_script_dir(): return "bin" -def wpt_path(topdir, paths, is_firefox): +def wpt_path(is_firefox, topdir, *paths): if is_firefox: rel = os.path.join("..", "testing", "web-platform") else: @@ -115,6 +110,16 @@ def wpt_path(topdir, paths, is_firefox): return os.path.join(topdir, rel, *paths) +def wpt_harness_path(is_firefox, topdir, *paths): + wpt_root = wpt_path(is_firefox, topdir) + if is_firefox: + rel = os.path.join(wpt_root, "tests", "tools", "wptrunner") + else: + rel = os.path.join(wpt_root, "harness") + + return os.path.join(topdir, rel, *paths) + + def _activate_virtualenv(topdir, is_firefox): virtualenv_path = os.path.join(topdir, "python", "_virtualenv") check_exec_path = lambda path: path.startswith(virtualenv_path) @@ -157,9 +162,9 @@ def _activate_virtualenv(topdir, is_firefox): # and it will check for conflicts. requirements_paths = [ os.path.join("python", "requirements.txt"), - wpt_path(topdir, ("harness", "requirements.txt"), is_firefox), - wpt_path(topdir, ("harness", "requirements_firefox.txt"), is_firefox), - wpt_path(topdir, ("harness", "requirements_servo.txt"), is_firefox), + wpt_harness_path(is_firefox, topdir, "requirements.txt",), + wpt_harness_path(is_firefox, topdir, "requirements_firefox.txt"), + wpt_harness_path(is_firefox, topdir, "requirements_servo.txt"), ] if need_pip_upgrade: @@ -257,8 +262,10 @@ def bootstrap(topdir): raise AttributeError(key) sys.path[0:0] = [os.path.join(topdir, path) for path in SEARCH_PATHS] - sys.path[0:0] = [wpt_path(topdir, (path,), is_firefox) - for path in WPT_SEARCH_PATHS] + + sys.path[0:0] = [wpt_path(is_firefox, topdir), + wpt_harness_path(is_firefox, topdir)] + import mach.main mach = mach.main.Mach(os.getcwd()) mach.populate_context_handler = populate_context |