def run_marionette(tests, b2g_path=None, emulator=None, testtype=None, address=None, bin=None, topsrcdir=None): from marionette.runtests import ( MarionetteTestRunner, MarionetteTestOptions, startTestRunner ) parser = MarionetteTestOptions() options, args = parser.parse_args() if not tests: tests = [os.path.join(topsrcdir, 'testing/marionette/client/marionette/tests/unit-tests.ini')] options.type = testtype if b2g_path: options.homedir = b2g_path if emulator: options.emulator = emulator else: options.bin = bin path, exe = os.path.split(options.bin) if 'b2g' in exe: options.app = 'b2gdesktop' options.address = address parser.verify_usage(options, tests) runner = startTestRunner(MarionetteTestRunner, options, tests) if runner.failed > 0: return 1 return 0
def run_marionette(self, tests, emulator=None, address=None, b2g_path=None, testtype=None): from marionette.runtests import (MarionetteTestRunner, MarionetteTestOptions, startTestRunner) parser = MarionetteTestOptions() options, args = parser.parse_args() if not tests: tests = [ 'testing/marionette/client/marionette/tests/unit-tests.ini' ] options.type = testtype if emulator: if b2g_path: options.homedir = b2g_path if not testtype: options.type = "b2g" else: if not testtype: options.type = "browser" try: bin = self.get_binary_path('app') options.bin = bin except Exception as e: print("It looks like your program isn't built.", "You can run |mach build| to build it.") print(e) return 1 path, exe = os.path.split(options.bin) if 'b2g' in exe: options.app = 'b2gdesktop' if not emulator: if self.substs.get('ENABLE_MARIONETTE') != '1': print("Marionette doesn't appear to be enabled; please " "add ENABLE_MARIONETTE=1 to your mozconfig and " "perform a clobber build.") return 1 options.address = address parser.verify_usage(options, tests) runner = startTestRunner(MarionetteTestRunner, options, tests) if runner.failed > 0: return 1 return 0
def run_marionette(self, tests, emulator=None, address=None, b2g_path=None, testtype=None): from marionette.runtests import ( MarionetteTestRunner, MarionetteTestOptions, startTestRunner ) parser = MarionetteTestOptions() options, args = parser.parse_args() if not tests: tests = ['testing/marionette/client/marionette/tests/unit-tests.ini'] options.type = testtype if emulator: if b2g_path: options.homedir = b2g_path if not testtype: options.type = "b2g" else: if not testtype: options.type = "browser" try: bin = self.get_binary_path('app') options.bin = bin except Exception as e: print("It looks like your program isn't built.", "You can run |mach build| to build it.") print(e) return 1 path, exe = os.path.split(options.bin) if 'b2g' in exe: options.app = 'b2gdesktop' if not emulator: if self.substs.get('ENABLE_MARIONETTE') != '1': print("Marionette doesn't appear to be enabled; please " "add ENABLE_MARIONETTE=1 to your mozconfig and " "perform a clobber build.") return 1 options.address = address parser.verify_usage(options, tests) runner = startTestRunner(MarionetteTestRunner, options, tests) if runner.failed > 0: return 1 return 0
def run_marionette(tests, b2g_path=None, emulator=None, testtype=None, address=None, bin=None, topsrcdir=None): from marionette.runtests import (MarionetteTestRunner, MarionetteTestOptions, startTestRunner) parser = MarionetteTestOptions() options, args = parser.parse_args() if not tests: tests = [ os.path.join( topsrcdir, 'testing/marionette/client/marionette/tests/unit-tests.ini') ] options.type = testtype if b2g_path: options.homedir = b2g_path if emulator: options.emulator = emulator else: options.bin = bin path, exe = os.path.split(options.bin) if 'b2g' in exe: options.app = 'b2gdesktop' options.address = address parser.verify_usage(options, tests) runner = startTestRunner(MarionetteTestRunner, options, tests) if runner.failed > 0: return 1 return 0