Beispiel #1
0
    def run_robocop(self, test_path):
        self.tests_dir = os.path.join(self.topobjdir, '_tests')
        self.mochitest_dir = os.path.join(self.tests_dir, 'testing',
                                          'mochitest')
        import imp
        path = os.path.join(self.mochitest_dir, 'runtestsremote.py')
        with open(path, 'r') as fh:
            imp.load_module('runtestsremote', fh, path,
                            ('.py', 'r', imp.PY_SOURCE))
        import runtestsremote

        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)

        sys.exit(runtestsremote.main(args))
Beispiel #2
0
    def run_robocop(self, test_path):
        self.tests_dir = os.path.join(self.topobjdir, '_tests')
        self.mochitest_dir = os.path.join(self.tests_dir, 'testing', 'mochitest')
        import imp
        path = os.path.join(self.mochitest_dir, 'runtestsremote.py')
        with open(path, 'r') as fh:
            imp.load_module('runtestsremote', fh, path,
                ('.py', 'r', imp.PY_SOURCE))
        import runtestsremote

        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)

        sys.exit(runtestsremote.main(args))
Beispiel #3
0
    def run_android_test(self, args):
        self.tests_dir = os.path.join(self.topobjdir, '_tests')
        self.mochitest_dir = os.path.join(self.tests_dir, 'testing', 'mochitest')
        import imp
        path = os.path.join(self.mochitest_dir, 'runtestsremote.py')
        with open(path, 'r') as fh:
            imp.load_module('runtestsremote', fh, path,
                ('.py', 'r', imp.PY_SOURCE))
        import runtestsremote

        sys.exit(runtestsremote.main(args))
Beispiel #4
0
    def run_android_test(self, args):
        self.tests_dir = os.path.join(self.topobjdir, '_tests')
        self.mochitest_dir = os.path.join(self.tests_dir, 'testing', 'mochitest')
        import imp
        path = os.path.join(self.mochitest_dir, 'runtestsremote.py')
        with open(path, 'r') as fh:
            imp.load_module('runtestsremote', fh, path,
                ('.py', 'r', imp.PY_SOURCE))
        import runtestsremote

        sys.exit(runtestsremote.main(args))
Beispiel #5
0
    def run_robocop(self, test_path):
        self.tests_dir = os.path.join(self.topobjdir, '_tests')
        self.mochitest_dir = os.path.join(
            self.tests_dir,
            'testing',
            'mochitest')
        import imp
        path = os.path.join(self.mochitest_dir, 'runtestsremote.py')
        with open(path, 'r') as fh:
            imp.load_module('runtestsremote', fh, path,
                            ('.py', 'r', imp.PY_SOURCE))
        import runtestsremote

        MOZ_HOST_BIN = os.environ.get('MOZ_HOST_BIN')
        if not MOZ_HOST_BIN:
            print('environment variable MOZ_HOST_BIN must be set to a directory containing host xpcshell')
            return 1
        elif not os.path.isdir(MOZ_HOST_BIN):
            print('$MOZ_HOST_BIN does not specify a directory')
            return 1
        elif not os.path.isfile(os.path.join(MOZ_HOST_BIN, 'xpcshell')):
            print('$MOZ_HOST_BIN/xpcshell does not exist')
            return 1

        args = [
            '--xre-path=' + 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)

        sys.exit(runtestsremote.main(args))
Beispiel #6
0
    def run_robocop(self, test_path):
        self.tests_dir = os.path.join(self.topobjdir, '_tests')
        self.mochitest_dir = os.path.join(
            self.tests_dir,
            'testing',
            'mochitest')
        import imp
        path = os.path.join(self.mochitest_dir, 'runtestsremote.py')
        with open(path, 'r') as fh:
            imp.load_module('runtestsremote', fh, path,
                            ('.py', 'r', imp.PY_SOURCE))
        import runtestsremote

        MOZ_HOST_BIN = os.environ.get('MOZ_HOST_BIN')
        if not MOZ_HOST_BIN:
            print('environment variable MOZ_HOST_BIN must be set to a directory containing host xpcshell')
            return 1
        elif not os.path.isdir(MOZ_HOST_BIN):
            print('$MOZ_HOST_BIN does not specify a directory')
            return 1
        elif not os.path.isfile(os.path.join(MOZ_HOST_BIN, 'xpcshell')):
            print('$MOZ_HOST_BIN/xpcshell does not exist')
            return 1

        args = [
            '--xre-path=' + 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)

        sys.exit(runtestsremote.main(args))
    def run_robocop(self, test_path):
        self.tests_dir = os.path.join(self.topobjdir, "_tests")
        self.mochitest_dir = os.path.join(self.tests_dir, "testing", "mochitest")
        import imp

        path = os.path.join(self.mochitest_dir, "runtestsremote.py")
        with open(path, "r") as fh:
            imp.load_module("runtestsremote", fh, path, (".py", "r", imp.PY_SOURCE))
        import runtestsremote

        MOZ_HOST_BIN = os.environ.get("MOZ_HOST_BIN")
        if not MOZ_HOST_BIN:
            print("environment variable MOZ_HOST_BIN must be set to a directory containing host xpcshell")
            return 1
        elif not os.path.isdir(MOZ_HOST_BIN):
            print("$MOZ_HOST_BIN does not specify a directory")
            return 1
        elif not os.path.isfile(os.path.join(MOZ_HOST_BIN, "xpcshell")):
            print("$MOZ_HOST_BIN/xpcshell does not exist")
            return 1

        args = [
            "--xre-path=" + 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)

        sys.exit(runtestsremote.main(args))