def run_robocop(self, test_path): host_ret = verify_host_bin() if host_ret != 0: return host_ret args = [ '--xre-path=' + os.environ.get('MOZ_HOST_BIN'), '--dm_trans=adb', '--deviceIP=', '--console-level=INFO', '--app=' + self.substs['ANDROID_PACKAGE_NAME'], '--robocop-apk=' + os.path.join( self.topobjdir, 'build', 'mobile', 'robocop', 'robocop-debug.apk'), '--robocop-ini=' + os.path.join( self.topobjdir, 'build', 'mobile', 'robocop', 'robocop.ini'), '--log-mach=-', ] if test_path: args.append('--test-path=%s' % test_path) mochitest = self._spawn(MochitestRunner) return mochitest.run_android_test(args)
def run_mochitest_android(self, test_paths, chrome=False, **kwargs): host_ret = verify_host_bin() if host_ret != 0: return host_ret args = [ '--xre-path=' + os.environ.get('MOZ_HOST_BIN'), '--dm_trans=adb', '--deviceIP=', '--console-level=INFO', '--app=' + self.substs['ANDROID_PACKAGE_NAME'], '--log-mach=-', '--autorun', '--close-when-done', '--testing-modules-dir=' + os.path.join(self.topobjdir, '_tests', 'modules'), ] 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() args.append('--test-path=%s' % test_path) if chrome: args.append('--chrome') mochitest = self._spawn(MochitestRunner) return mochitest.run_android_test(args)
def run_robocop(self, serve=False, **kwargs): if serve: kwargs['autorun'] = False if not kwargs.get('robocopIni'): kwargs['robocopIni'] = os.path.join(self.topobjdir, '_tests', 'testing', 'mochitest', 'robocop.ini') if not kwargs.get('robocopApk'): kwargs['robocopApk'] = os.path.join(self.topobjdir, 'build', 'mobile', 'robocop', 'robocop-debug.apk') from mozbuild.controller.building import BuildDriver self._ensure_state_subdir_exists('.') driver = self._spawn(BuildDriver) driver.install_tests(remove=False) test_paths = kwargs['test_paths'] kwargs['test_paths'] = [] from mozbuild.testing import TestResolver resolver = self._spawn(TestResolver) tests = list(resolver.resolve_tests(paths=test_paths, cwd=self._mach_context.cwd, flavor='instrumentation', subsuite='robocop')) mochitest = self._spawn(MochitestRunner) return mochitest.run_android_test(self._mach_context, tests, 'robocop', **kwargs)
def run_robocop(self, test_paths, serve=False, **kwargs): if serve: kwargs['autorun'] = False if not kwargs.get('robocopIni'): kwargs['robocopIni'] = os.path.join(self.topobjdir, '_tests', 'testing', 'mochitest', 'robocop.ini') if not kwargs.get('robocopApk'): kwargs['robocopApk'] = os.path.join(self.topobjdir, 'build', 'mobile', 'robocop', 'robocop-debug.apk') from mozbuild.controller.building import BuildDriver self._ensure_state_subdir_exists('.') driver = self._spawn(BuildDriver) driver.install_tests(remove=False) from mozbuild.testing import TestResolver resolver = self._spawn(TestResolver) tests = list( resolver.resolve_tests(paths=test_paths, cwd=self._mach_context.cwd, flavor='instrumentation', subsuite='robocop')) mochitest = self._spawn(MochitestRunner) return mochitest.run_android_test(self._mach_context, tests, 'robocop', **kwargs)
def run_mochitest_android(self, test_paths, **kwargs): host_ret = verify_host_bin() if host_ret != 0: return host_ret 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() mochitest = self._spawn(MochitestRunner) return mochitest.run_android_test(test_path, **kwargs)
def run_robocop(self, test_path, **kwargs): host_ret = verify_host_bin() if host_ret != 0: return host_ret if not kwargs.get('robocopIni'): kwargs['robocopIni'] = os.path.join(self.topobjdir, '_tests', 'testing', 'mochitest', 'robocop.ini') if not kwargs.get('robocopApk'): kwargs['robocopApk'] = os.path.join(self.topobjdir, 'build', 'mobile', 'robocop', 'robocop-debug.apk') mochitest = self._spawn(MochitestRunner) return mochitest.run_android_test(test_path, **kwargs)
def run_robocop(self, test_path, **kwargs): if not kwargs.get('robocopIni'): kwargs['robocopIni'] = os.path.join(self.topobjdir, '_tests', 'testing', 'mochitest', 'robocop.ini') if not kwargs.get('robocopApk'): kwargs['robocopApk'] = os.path.join(self.topobjdir, 'build', 'mobile', 'robocop', 'robocop-debug.apk') if isinstance(test_path, basestring): test_path = [test_path] mochitest = self._spawn(MochitestRunner) tests = mochitest.resolve_tests(test_path, cwd=self._mach_context.cwd) return mochitest.run_android_test(self._mach_context, tests, 'robocop', **kwargs)