1 # This Source Code Form is subject to the terms of the Mozilla Public
2 # License, v. 2.0. If a copy of the MPL was not distributed with this
3 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 def create_parser_wpt():
9 from wptrunner
import wptcommandline
11 result
= wptcommandline
.create_parser()
17 help="Do not install test runner application",
22 class WebPlatformTestsRunner(object):
23 """Run web platform tests."""
25 def __init__(self
, setup
):
28 def setup_logging(self
, **kwargs
):
29 from tools
.wpt
import run
31 return run
.setup_logging(
33 {self
.setup
.default_log_type
: sys
.stdout
},
34 formatter_defaults
={"screenshot": True},
37 def run(self
, logger
, **kwargs
):
38 from mozbuild
.base
import BinaryNotFoundException
39 from wptrunner
import wptrunner
41 if kwargs
["manifest_update"] is not False:
42 self
.update_manifest(logger
)
43 kwargs
["manifest_update"] = False
45 if kwargs
["product"] == "firefox":
47 kwargs
= self
.setup
.kwargs_firefox(kwargs
)
48 except BinaryNotFoundException
as e
:
52 elif kwargs
["product"] == "firefox_android":
53 from wptrunner
import wptcommandline
55 kwargs
= wptcommandline
.check_args(self
.setup
.kwargs_common(kwargs
))
57 kwargs
= self
.setup
.kwargs_wptrun(kwargs
)
59 result
= wptrunner
.start(**kwargs
)
62 def update_manifest(self
, logger
, **kwargs
):
65 return manifestupdate
.run(
67 src_root
=self
.setup
.topsrcdir
,
68 obj_root
=self
.setup
.topobjdir
,