Example #1
0
def run_marionette(tests, testtype=None, address=None, binary=None, topsrcdir=None, **kwargs):
    from mozlog.structured import commandline

    from marionette.runtests import (
        MarionetteTestRunner,
        BaseMarionetteArguments,
        MarionetteHarness
    )

    parser = BaseMarionetteArguments()
    commandline.add_logging_group(parser)

    if not tests:
        tests = [os.path.join(topsrcdir,
                 'testing/marionette/harness/marionette/tests/unit-tests.ini')]

    args = parser.parse_args(args=tests)

    args.binary = binary
    path, exe = os.path.split(args.binary)

    for k, v in kwargs.iteritems():
        setattr(args, k, v)

    parser.verify_usage(args)

    args.logger = commandline.setup_logging("Marionette Unit Tests",
                                            args,
                                            {"mach": sys.stdout})
    failed = MarionetteHarness(MarionetteTestRunner, args=vars(args)).run()
    if failed > 0:
        return 1
    else:
        return 0
Example #2
0
def run_marionette(tests, binary=None, topsrcdir=None, **kwargs):
    from mozlog.structured import commandline

    from marionette.runtests import (MarionetteTestRunner,
                                     BaseMarionetteArguments,
                                     MarionetteHarness)

    parser = BaseMarionetteArguments()
    commandline.add_logging_group(parser)

    if not tests:
        tests = [
            os.path.join(
                topsrcdir,
                'testing/marionette/harness/marionette/tests/unit-tests.ini')
        ]

    args = argparse.Namespace(tests=tests)

    args.binary = binary

    for k, v in kwargs.iteritems():
        setattr(args, k, v)

    parser.verify_usage(args)

    args.logger = commandline.setup_logging("Marionette Unit Tests", args,
                                            {"mach": sys.stdout})
    failed = MarionetteHarness(MarionetteTestRunner, args=vars(args)).run()
    if failed > 0:
        return 1
    else:
        return 0
Example #3
0
def run_marionette(tests,
                   b2g_path=None,
                   emulator=None,
                   testtype=None,
                   address=None,
                   binary=None,
                   topsrcdir=None,
                   **kwargs):
    from mozlog.structured import commandline

    from marionette.runtests import (MarionetteTestRunner,
                                     BaseMarionetteArguments,
                                     MarionetteHarness)

    parser = BaseMarionetteArguments()
    commandline.add_logging_group(parser)
    args = parser.parse_args()

    if not tests:
        tests = [
            os.path.join(
                topsrcdir,
                'testing/marionette/client/marionette/tests/unit-tests.ini')
        ]
    args.tests = tests

    if b2g_path:
        args.homedir = b2g_path
        if emulator:
            args.emulator = emulator
    else:
        args.binary = binary
        path, exe = os.path.split(args.binary)

    for k, v in kwargs.iteritems():
        setattr(args, k, v)

    parser.verify_usage(args)

    args.logger = commandline.setup_logging("Marionette Unit Tests", args,
                                            {"mach": sys.stdout})
    failed = MarionetteHarness(MarionetteTestRunner, args=args).run()
    if failed > 0:
        return 1
    else:
        return 0
Example #4
0
def run_marionette(tests, b2g_path=None, emulator=None, testtype=None,
    address=None, binary=None, topsrcdir=None, **kwargs):
    from mozlog.structured import commandline

    from marionette.runtests import (
        MarionetteTestRunner,
        BaseMarionetteArguments,
        startTestRunner
    )

    parser = BaseMarionetteArguments()
    commandline.add_logging_group(parser)
    args = parser.parse_args()

    if not tests:
        tests = [os.path.join(topsrcdir,
                 'testing/marionette/client/marionette/tests/unit-tests.ini')]
    args.tests = tests

    if b2g_path:
        args.homedir = b2g_path
        if emulator:
            args.emulator = emulator
    else:
        args.binary = binary
        path, exe = os.path.split(args.binary)

    for k, v in kwargs.iteritems():
        setattr(args, k, v)

    parser.verify_usage(args)

    args.logger = commandline.setup_logging("Marionette Unit Tests",
                                            args,
                                            {"mach": sys.stdout})

    runner = startTestRunner(MarionetteTestRunner, args)
    if runner.failed > 0:
        return 1

    return 0
Example #5
0
def setup_argument_parser():
    from marionette.runner.base import BaseMarionetteArguments
    return BaseMarionetteArguments()
Example #6
0
def setup_marionette_argument_parser():
    from marionette.runner.base import BaseMarionetteArguments

    global parser
    parser = BaseMarionetteArguments()
    return parser