def run_test( self, test_paths, b2g_home=None, busybox=None, device_name=None, test_objects=None, log=None, # ignore parameters from other platforms' options **kwargs ): try: import which which.which("adb") except which.WhichError: # TODO Find adb automatically if it isn't on the path print(ADB_NOT_FOUND % ("mochitest-remote", b2g_home)) sys.exit(1) test_path = None if test_objects: if len(test_objects) > 1: print("Warning: Only the first test will be used.") test_path = self._wrap_path_argument(test_objects[0]["path"]) elif test_paths: if len(test_paths) > 1: print("Warning: Only the first test path will be used.") test_path = self._wrap_path_argument(test_paths[0]).relpath() import runtestsb2g parser = runtestsb2g.B2GOptions() options, args = parser.parse_args([]) options.b2g_path = b2g_home options.busybox = busybox or os.environ.get("BUSYBOX") options.localLib = self.bin_dir options.localBin = self.bin_dir options.logdir = self.xpcshell_dir options.manifest = os.path.join(self.xpcshell_dir, "xpcshell.ini") options.mozInfo = os.path.join(self.topobjdir, "mozinfo.json") options.objdir = self.topobjdir options.symbolsPath = (os.path.join(self.distdir, "crashreporter-symbols"),) options.testingModulesDir = os.path.join(self.tests_dir, "modules") options.testsRootDir = self.xpcshell_dir options.testPath = test_path options.use_device_libs = True options.emulator = "arm" if device_name.startswith("emulator"): if "x86" in device_name: options.emulator = "x86" if not options.busybox: options.busybox = self._download_busybox(b2g_home, options.emulator) return runtestsb2g.run_remote_xpcshell(parser, options, args, log)
def run_test( self, test_paths, b2g_home=None, busybox=None, device_name=None, test_objects=None, log=None, # ignore parameters from other platforms' options **kwargs): try: import which which.which('adb') except which.WhichError: # TODO Find adb automatically if it isn't on the path print(ADB_NOT_FOUND % ('mochitest-remote', b2g_home)) sys.exit(1) test_path = None if test_objects: if len(test_objects) > 1: print('Warning: Only the first test will be used.') test_path = self._wrap_path_argument(test_objects[0]['path']) elif test_paths: if len(test_paths) > 1: print('Warning: Only the first test path will be used.') test_path = self._wrap_path_argument(test_paths[0]).relpath() import runtestsb2g parser = runtestsb2g.B2GOptions() options, args = parser.parse_args([]) options.b2g_path = b2g_home options.busybox = busybox or os.environ.get('BUSYBOX') options.localLib = self.bin_dir options.localBin = self.bin_dir options.logdir = self.xpcshell_dir options.manifest = os.path.join(self.xpcshell_dir, 'xpcshell.ini') options.mozInfo = os.path.join(self.topobjdir, 'mozinfo.json') options.objdir = self.topobjdir options.symbolsPath = os.path.join(self.distdir, 'crashreporter-symbols'), options.testingModulesDir = os.path.join(self.tests_dir, 'modules') options.testsRootDir = self.xpcshell_dir options.testPath = test_path options.use_device_libs = True options.emulator = 'arm' if device_name.startswith('emulator'): if 'x86' in device_name: options.emulator = 'x86' if not options.busybox: options.busybox = self._download_busybox(b2g_home, options.emulator) return runtestsb2g.run_remote_xpcshell(parser, options, args, log)
def run_test(self, **kwargs): try: import which which.which('adb') except which.WhichError: # TODO Find adb automatically if it isn't on the path print(ADB_NOT_FOUND % ('mochitest-remote', kwargs["b2g_home"])) sys.exit(1) import runtestsb2g log = kwargs.pop("log") self.log_manager.enable_unstructured() if kwargs["device_name"].startswith( 'emulator') and 'x86' in kwargs["device_name"]: kwargs["emulator"] = 'x86' if kwargs["xpcshell"] is None: kwargs["xpcshell"] = "xpcshell" if kwargs["b2g_path"] is None: kwargs["b2g_path"] = kwargs["b2g_home"] if kwargs["busybox"] is None: kwargs["busybox"] = os.environ.get('BUSYBOX') if kwargs["busybox"] is None: kwargs["busybox"] = self._download_busybox(kwargs["b2g_home"], kwargs["emulator"]) if kwargs["localLib"] is None: kwargs["localLib"] = self.bin_dir if kwargs["localBin"] is None: kwargs["localBin"] = self.bin_dir if kwargs["logdir"] is None: kwargs["logdir"] = self.xpcshell_dir if kwargs["manifest"] is None: kwargs["manifest"] = os.path.join(self.xpcshell_dir, 'xpcshell.ini') if kwargs["mozInfo"] is None: kwargs["mozInfo"] = os.path.join(self.topobjdir, 'mozinfo.json') if kwargs["objdir"] is None: kwargs["objdir"] = self.topobjdir if kwargs["symbolsPath"] is None: kwargs["symbolsPath"] = os.path.join(self.distdir, 'crashreporter-symbols') if kwargs["testingModulesDir"] is None: kwargs["testingModulesDir"] = os.path.join(self.tests_dir, 'modules') if kwargs["use_device_libs"] is None: kwargs["use_device_libs"] = True parser = parser_b2g() options = argparse.Namespace(**kwargs) rv = runtestsb2g.run_remote_xpcshell(parser, options, log) self.log_manager.disable_unstructured() return rv
def run_test(self, **kwargs): try: import which which.which('adb') except which.WhichError: # TODO Find adb automatically if it isn't on the path print(ADB_NOT_FOUND % ('mochitest-remote', kwargs["b2g_home"])) sys.exit(1) import runtestsb2g log = kwargs.pop("log") self.log_manager.enable_unstructured() if kwargs["xpcshell"] is None: kwargs["xpcshell"] = "xpcshell" if kwargs["b2g_path"] is None: kwargs["b2g_path"] = kwargs["b2g_home"] if kwargs["busybox"] is None: kwargs["busybox"] = os.environ.get('BUSYBOX') if kwargs["busybox"] is None: kwargs["busybox"] = self._download_busybox(kwargs["b2g_home"], kwargs["emulator"]) if kwargs["localLib"] is None: kwargs["localLib"] = self.bin_dir if kwargs["localBin"] is None: kwargs["localBin"] = self.bin_dir if kwargs["logdir"] is None: kwargs["logdir"] = self.xpcshell_dir if kwargs["manifest"] is None: kwargs["manifest"] = os.path.join(self.xpcshell_dir, 'xpcshell.ini') if kwargs["mozInfo"] is None: kwargs["mozInfo"] = os.path.join(self.topobjdir, 'mozinfo.json') if kwargs["objdir"] is None: kwargs["objdir"] = self.topobjdir if kwargs["symbolsPath"] is None: kwargs["symbolsPath"] = os.path.join(self.distdir, 'crashreporter-symbols') if kwargs["testingModulesDir"] is None: kwargs["testingModulesDir"] = os.path.join(self.tests_dir, 'modules') if kwargs["use_device_libs"] is None: kwargs["use_device_libs"] = True if kwargs["device_name"].startswith('emulator') and 'x86' in kwargs["device_name"]: kwargs["emulator"] = 'x86' parser = parser_b2g() options = argparse.Namespace(**kwargs) rv = runtestsb2g.run_remote_xpcshell(parser, options, log) self.log_manager.disable_unstructured() return rv
def run_test(self, test_paths, b2g_home=None, busybox=None, device_name=None, # ignore parameters from other platforms' options **kwargs): try: import which which.which('adb') except which.WhichError: # TODO Find adb automatically if it isn't on the path print(ADB_NOT_FOUND % ('mochitest-remote', b2g_home)) sys.exit(1) test_path = None if test_paths: if len(test_paths) > 1: print('Warning: Only the first test path will be used.') test_path = self._wrap_path_argument(test_paths[0]).relpath() import runtestsb2g parser = runtestsb2g.B2GOptions() options, args = parser.parse_args([]) options.b2g_path = b2g_home options.busybox = busybox or os.environ.get('BUSYBOX') options.localLib = self.bin_dir options.localBin = self.bin_dir options.logcat_dir = self.xpcshell_dir options.manifest = os.path.join(self.xpcshell_dir, 'xpcshell_b2g.ini') options.mozInfo = os.path.join(self.topobjdir, 'mozinfo.json') options.objdir = self.topobjdir options.symbolsPath = os.path.join(self.distdir, 'crashreporter-symbols'), options.testingModulesDir = os.path.join(self.tests_dir, 'modules') options.testsRootDir = self.xpcshell_dir options.testPath = test_path options.use_device_libs = True options.emulator = 'arm' if device_name.startswith('emulator'): if 'x86' in device_name: options.emulator = 'x86' if not options.busybox: options.busybox = self._download_busybox(b2g_home, options.emulator) return runtestsb2g.run_remote_xpcshell(parser, options, args)