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/.
5 # Integrates the xpcshell test runner with mach.
10 from mozbuild
.base
import (
15 from mach
.decorators
import (
21 class JetpackRunner(MozbuildObject
):
22 """Run jetpack tests."""
23 def run_tests(self
, **kwargs
):
24 self
._run
_make
(target
='jetpack-tests')
27 class MachCommands(MachCommandBase
):
28 @Command('jetpack-test', help='Runs the jetpack test suite.')
29 def run_jetpack_test(self
, **params
):
30 # We should probably have a utility function to ensure the tree is
31 # ready to run tests. Until then, we just create the state dir (in
32 # case the tree wasn't built with mach).
33 self
._ensure
_state
_subdir
_exists
('.')
35 jetpack
= self
._spawn
(JetpackRunner
)
37 jetpack
.run_tests(**params
)