Exemplo n.º 1
0
    def run_mochitest_test(self, test_file=None, suite=None):
        """Runs a mochitest.

        test_file is a path to a test file. 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 mochitest to run. It can be one of ('plain',
        'chrome', 'browser').
        """

        # TODO hook up harness via native Python
        target = None
        if suite == 'plain':
            target = 'mochitest-plain'
        elif suite == 'chrome':
            target = 'mochitest-chrome'
        elif suite == 'browser':
            target = 'mochitest-browser-chrome'
        elif suite == 'a11y':
            target = 'mochitest-a11y'
        else:
            raise Exception('None or unrecognized mochitest suite type.')

        if test_file:
            path = parse_test_path(test_file, self.topsrcdir)['normalized']
            if not os.path.exists(path):
                raise Exception('No manifest file was found at %s.' % path)
            env = {'TEST_PATH': path}
        else:
            env = {}

        return self._run_make(directory='.', target=target, append_env=env,
            ensure_exit_code=False)
Exemplo n.º 2
0
    def run_mochitest_test(self, test_file=None, suite=None):
        """Runs a mochitest.

        test_file is a path to a test file. 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 mochitest to run. It can be one of ('plain',
        'chrome', 'browser').
        """

        # TODO hook up harness via native Python
        target = None
        if suite == 'plain':
            target = 'mochitest-plain'
        elif suite == 'chrome':
            target = 'mochitest-chrome'
        elif suite == 'browser':
            target = 'mochitest-browser-chrome'
        elif suite == 'a11y':
            target = 'mochitest-a11y'
        else:
            raise Exception('None or unrecognized mochitest suite type.')

        if test_file:
            path = parse_test_path(test_file, self.topsrcdir)['normalized']
            if not os.path.exists(path):
                raise Exception('No manifest file was found at %s.' % path)
            env = {'TEST_PATH': path}
        else:
            env = {}

        self._run_make(directory='.', target=target, append_env=env)
Exemplo n.º 3
0
    def _find_manifest(self, suite, test_file):
        assert test_file
        parsed = parse_test_path(test_file, self.topsrcdir)
        if parsed['is_dir']:
            return os.path.join(parsed['normalized'], self._manifest_file(suite))

        if parsed['normalized'].endswith('.list'):
            return parsed['normalized']

        raise Exception('Running a single test is not currently supported')
Exemplo n.º 4
0
    def _find_manifest(self, suite, test_file):
        assert test_file
        parsed = parse_test_path(test_file, self.topsrcdir)
        if parsed['is_dir']:
            return os.path.join(parsed['normalized'],
                                self._manifest_file(suite))

        if parsed['normalized'].endswith('.list'):
            return parsed['normalized']

        raise Exception('Running a single test is not currently supported')
Exemplo n.º 5
0
    def run_mochitest_test(self, suite=None, test_file=None, debugger=None):
        """Runs a mochitest.

        test_file is a path to a test file. 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 mochitest to run. It can be one of ('plain',
        'chrome', 'browser').

        debugger is a program name or path to a binary (presumably a debugger)
        to run the test in. e.g. 'gdb'
        """

        # TODO hook up harness via native Python
        target = None
        if suite == 'plain':
            target = 'mochitest-plain'
        elif suite == 'chrome':
            target = 'mochitest-chrome'
        elif suite == 'browser':
            target = 'mochitest-browser-chrome'
        elif suite == 'a11y':
            target = 'mochitest-a11y'
        else:
            raise Exception('None or unrecognized mochitest suite type.')

        if test_file:
            path = parse_test_path(test_file, self.topsrcdir)['normalized']
            if not os.path.exists(path):
                raise Exception('No manifest file was found at %s.' % path)
            env = {'TEST_PATH': path}
        else:
            env = {}

        pass_thru = False

        if debugger:
            env[b'EXTRA_TEST_ARGS'] = '--debugger=%s' % debugger
            pass_thru = True

        return self._run_make(directory='.',
                              target=target,
                              append_env=env,
                              ensure_exit_code=False,
                              pass_thru=pass_thru)
Exemplo n.º 6
0
    def run_mochitest_test(self, suite=None, test_file=None, debugger=None):
        """Runs a mochitest.

        test_file is a path to a test file. 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 mochitest to run. It can be one of ('plain',
        'chrome', 'browser', 'metro', 'a11y').

        debugger is a program name or path to a binary (presumably a debugger)
        to run the test in. e.g. 'gdb'
        """

        # TODO hook up harness via native Python
        target = None
        if suite == 'plain':
            target = 'mochitest-plain'
        elif suite == 'chrome':
            target = 'mochitest-chrome'
        elif suite == 'browser':
            target = 'mochitest-browser-chrome'
        elif suite == 'metro':
            target = 'mochitest-metro-chrome'
        elif suite == 'a11y':
            target = 'mochitest-a11y'
        else:
            raise Exception('None or unrecognized mochitest suite type.')

        if test_file:
            path = parse_test_path(test_file, self.topsrcdir)['normalized']
            if not os.path.exists(path):
                raise Exception('No manifest file was found at %s.' % path)
            env = {'TEST_PATH': path}
        else:
            env = {}

        pass_thru = False

        if debugger:
            env[b'EXTRA_TEST_ARGS'] = '--debugger=%s' % debugger
            pass_thru = True

        return self._run_make(directory='.', target=target, append_env=env,
            ensure_exit_code=False, pass_thru=pass_thru)