Exemplo n.º 1
0
    def run_b2g_test(self, b2g_home=None, xre_path=None, **kwargs):
        """Runs a b2g reftest.

        filter is a regular expression (in JS syntax, as could be passed to the
        RegExp constructor) to select which reftests to run from the manifest.

        tests is a list of paths. It can be a relative path from the
        top source directory, an absolute filename, or a directory containing
        test files.

        suite is the type of reftest to run. It can be one of ('reftest',
        'crashtest').
        """
        if kwargs["suite"] not in ('reftest', 'crashtest'):
            raise Exception('None or unrecognized reftest suite type.')

        self._setup_objdir(**kwargs)
        import runreftestb2g

        for i, path in enumerate(kwargs["tests"]):
            # Non-absolute paths are relative to the packaged directory, which
            # has an extra tests/ at the start
            if os.path.exists(os.path.abspath(path)):
                path = os.path.relpath(path, os.path.join(self.topsrcdir))
            kwargs["tests"][i] = os.path.join('tests', path)

        try:
            which.which('adb')
        except which.WhichError:
            # TODO Find adb automatically if it isn't on the path
            raise Exception(ADB_NOT_FOUND %
                            ('%s-remote' % kwargs["suite"], b2g_home))

        kwargs["b2gPath"] = b2g_home
        kwargs["logdir"] = self.reftest_dir
        kwargs["httpdPath"] = os.path.join(self.topsrcdir, 'netwerk', 'test',
                                           'httpserver')
        kwargs["xrePath"] = xre_path
        kwargs["ignoreWindowSize"] = True

        # Don't enable oop for crashtest until they run oop in automation
        if kwargs["suite"] == 'reftest':
            kwargs["oop"] = True

        return runreftestb2g.run(**kwargs)
Exemplo n.º 2
0
    def run_b2g_test(self, b2g_home=None, xre_path=None, **kwargs):
        """Runs a b2g reftest.

        filter is a regular expression (in JS syntax, as could be passed to the
        RegExp constructor) to select which reftests to run from the manifest.

        tests is a list of paths. It can be a relative path from the
        top source directory, an absolute filename, or a directory containing
        test files.

        suite is the type of reftest to run. It can be one of ('reftest',
        'crashtest').
        """
        if kwargs["suite"] not in ('reftest', 'crashtest'):
            raise Exception('None or unrecognized reftest suite type.')

        self._setup_objdir(**kwargs)
        import runreftestb2g

        for i, path in enumerate(kwargs["tests"]):
            # Non-absolute paths are relative to the packaged directory, which
            # has an extra tests/ at the start
            if os.path.exists(os.path.abspath(path)):
                path = os.path.relpath(path, os.path.join(self.topsrcdir))
            kwargs["tests"][i] = os.path.join('tests', path)

        try:
            which.which('adb')
        except which.WhichError:
            # TODO Find adb automatically if it isn't on the path
            raise Exception(ADB_NOT_FOUND % ('%s-remote' % kwargs["suite"], b2g_home))

        kwargs["b2gPath"] = b2g_home
        kwargs["logdir"] = self.reftest_dir
        kwargs["httpdPath"] = os.path.join(self.topsrcdir, 'netwerk', 'test', 'httpserver')
        kwargs["xrePath"] = xre_path
        kwargs["ignoreWindowSize"] = True

        # Don't enable oop for crashtest until they run oop in automation
        if kwargs["suite"] == 'reftest':
            kwargs["oop"] = True

        return runreftestb2g.run(**kwargs)