addon-sdk/mach_commands.py

Tue, 06 Jan 2015 21:39:09 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 06 Jan 2015 21:39:09 +0100
branch
TOR_BUG_9701
changeset 8
97036ab72558
permissions
-rw-r--r--

Conditionally force memory storage according to privacy.thirdparty.isolate;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.

     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.
     7 import os
     8 import sys
    10 from mozbuild.base import (
    11     MachCommandBase,
    12     MozbuildObject,
    13 )
    15 from mach.decorators import (
    16     CommandArgument,
    17     CommandProvider,
    18     Command,
    19 )
    21 class JetpackRunner(MozbuildObject):
    22     """Run jetpack tests."""
    23     def run_tests(self, **kwargs):
    24         self._run_make(target='jetpack-tests')
    26 @CommandProvider
    27 class MachCommands(MachCommandBase):
    28     @Command('jetpack-test', category='testing',
    29         description='Runs the jetpack test suite.')
    30     def run_jetpack_test(self, **params):
    31         # We should probably have a utility function to ensure the tree is
    32         # ready to run tests. Until then, we just create the state dir (in
    33         # case the tree wasn't built with mach).
    34         self._ensure_state_subdir_exists('.')
    36         jetpack = self._spawn(JetpackRunner)
    38         jetpack.run_tests(**params)

mercurial