def run(self, **kwargs): sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "tests", "tools"))) from wptrunner import wptcommandline from manifest import testpaths import manifestupdate import logging logger = logging.getLogger("web-platform-tests") src_root = self.topsrcdir obj_root = self.topobjdir src_wpt_dir = os.path.join(src_root, "testing", "web-platform") config_path = manifestupdate.generate_config(logger, src_root, src_wpt_dir, os.path.join(obj_root, "_tests", "web-platform"), False) test_paths = wptcommandline.get_test_paths(wptcommandline.config.read(config_path)) results = {} for url_base, paths in iteritems(test_paths): if "manifest_path" not in paths: paths["manifest_path"] = os.path.join(paths["metadata_path"], "MANIFEST.json") results.update( testpaths.get_paths(path=paths["manifest_path"], src_root=src_root, tests_root=paths["tests_path"], update=kwargs["update"], rebuild=kwargs["rebuild"], url_base=url_base, cache_root=kwargs["cache_root"], test_ids=kwargs["test_ids"])) testpaths.write_output(results, kwargs["json"]) return True
def run(self, **kwargs): sys.path.insert( 0, os.path.abspath( os.path.join(os.path.dirname(__file__), "tests", "tools")), ) from serve import serve from wptrunner import wptcommandline import manifestupdate import logging logger = logging.getLogger("web-platform-tests") src_root = self.topsrcdir obj_root = self.topobjdir src_wpt_dir = os.path.join(src_root, "testing", "web-platform") config_path = manifestupdate.generate_config( logger, src_root, src_wpt_dir, os.path.join(obj_root, "_tests", "web-platform"), False, ) test_paths = wptcommandline.get_test_paths( wptcommandline.config.read(config_path)) def get_route_builder(*args, **kwargs): route_builder = serve.get_route_builder(*args, **kwargs) for url_base, paths in iteritems(test_paths): if url_base != "/": route_builder.add_mount_point(url_base, paths["tests_path"]) return route_builder return 0 if serve.run(route_builder=get_route_builder, **kwargs) else 1