Пример #1
0
 def test_basic(self):
     filesystem = MockFileSystem({
         '/base/a/1': '',
         '/base/a/2': '',
         '/base/b/1': '',
         '/base/c/2': '',
     })
     self.assertEqual(list(find_files.find(filesystem, '/base/', ['a'])),
                      ['/base/a/1', '/base/a/2'])
     self.assertEqual(
         list(find_files.find(filesystem, '/base/', ['b', 'c'])),
         ['/base/b/1', '/base/c/2'])
     self.assertEqual(list(find_files.find(filesystem, '/base/', ['*/1'])),
                      ['/base/a/1', '/base/b/1'])
Пример #2
0
    def _collect_tests(self):
        """Return the list of tests found."""

        test_extensions = [".html", ".svg"]
        if self._options.replay:
            test_extensions.append(".replay")

        def _is_test_file(filesystem, dirname, filename):
            return filesystem.splitext(filename)[1] in test_extensions

        filesystem = self._host.filesystem

        paths = []
        for arg in self._args:
            paths.append(arg)
            relpath = filesystem.relpath(arg, self._base_path)
            if relpath:
                paths.append(relpath)

        skipped_directories = set([".svn", "resources"])
        test_files = find_files.find(filesystem, self._base_path, paths, skipped_directories, _is_test_file)
        tests = []
        for path in test_files:
            relative_path = self._port.relative_perf_test_filename(path).replace("\\", "/")
            if self._port.skips_perf_test(relative_path) and not self._options.skipped:
                continue
            test = PerfTestFactory.create_perf_test(self._port, relative_path, path)
            tests.append(test)

        return tests
Пример #3
0
    def _collect_tests(self):
        test_extensions = ['.html', '.svg']

        def _is_test_file(filesystem, dirname, filename):
            return filesystem.splitext(filename)[1] in test_extensions

        filesystem = self._host.filesystem

        paths = []
        for arg in self._args:
            if filesystem.exists(filesystem.join(self._base_path, arg)):
                paths.append(arg)
            else:
                relpath = filesystem.relpath(arg, self._base_path)
                if filesystem.exists(filesystem.join(self._base_path, relpath)):
                    paths.append(filesystem.normpath(relpath))
                else:
                    _log.warn('Path was not found:' + arg)

        skipped_directories = set(['.svn', 'resources'])
        test_files = find_files.find(filesystem, self._base_path, paths, skipped_directories, _is_test_file)
        tests = []
        for path in test_files:
            relative_path = filesystem.relpath(path, self._base_path).replace('\\', '/')
            if self._options.use_skipped_list and self._port.skips_perf_test(relative_path) and filesystem.normpath(relative_path) not in paths:
                continue
            test = PerfTestFactory.create_perf_test(self._port, relative_path, path, test_runner_count=self._options.test_runner_count)
            tests.append(test)

        return tests
Пример #4
0
    def _collect_tests(self):
        test_extensions = ['.html', '.svg']
        if self._options.replay:
            test_extensions.append('.replay')

        def _is_test_file(filesystem, dirname, filename):
            return filesystem.splitext(filename)[1] in test_extensions

        filesystem = self._host.filesystem

        paths = []
        for arg in self._args:
            if filesystem.exists(filesystem.join(self._base_path, arg)):
                paths.append(arg)
            else:
                relpath = filesystem.relpath(arg, self._base_path)
                if filesystem.exists(filesystem.join(self._base_path, relpath)):
                    paths.append(filesystem.normpath(relpath))
                else:
                    _log.warn('Path was not found:' + arg)

        skipped_directories = set(['.svn', 'resources'])
        test_files = find_files.find(filesystem, self._base_path, paths, skipped_directories, _is_test_file)
        tests = []
        for path in test_files:
            relative_path = filesystem.relpath(path, self._base_path).replace('\\', '/')
            if self._options.use_skipped_list and self._port.skips_perf_test(relative_path) and filesystem.normpath(relative_path) not in paths:
                continue
            test = PerfTestFactory.create_perf_test(self._port, relative_path, path, test_runner_count=self._options.test_runner_count)
            tests.append(test)

        return tests
Пример #5
0
    def _collect_tests(self):
        """Return the list of tests found."""

        test_extensions = ['.html', '.svg']
        if self._options.replay:
            test_extensions.append('.replay')

        def _is_test_file(filesystem, dirname, filename):
            return filesystem.splitext(filename)[1] in test_extensions

        filesystem = self._host.filesystem

        paths = []
        for arg in self._args:
            paths.append(arg)
            relpath = filesystem.relpath(arg, self._base_path)
            if relpath:
                paths.append(relpath)

        skipped_directories = set(['.svn', 'resources'])
        test_files = find_files.find(filesystem, self._base_path, paths,
                                     skipped_directories, _is_test_file)
        tests = []
        for path in test_files:
            relative_path = self._port.relative_perf_test_filename(
                path).replace('\\', '/')
            if self._port.skips_perf_test(
                    relative_path) and not self._options.skipped:
                continue
            test = PerfTestFactory.create_perf_test(self._port, relative_path,
                                                    path)
            tests.append(test)

        return tests
Пример #6
0
    def _collect_tests(self):
        """Return the list of tests found."""

        def _is_test_file(filesystem, dirname, filename):
            return filesystem.splitext(filename)[1] in ['.html', '.svg']

        filesystem = self._host.filesystem

        paths = []
        for arg in self._args:
            paths.append(arg)
            relpath = filesystem.relpath(arg, self._base_path)
            if relpath:
                paths.append(relpath)

        skipped_directories = set(['.svn', 'resources'])
        test_files = find_files.find(filesystem, self._base_path, paths, skipped_directories, _is_test_file)
        tests = []
        for path in test_files:
            relative_path = self._port.relative_perf_test_filename(path).replace('\\', '/')
            if self._port.skips_perf_test(relative_path):
                continue
            tests.append(PerfTestFactory.create_perf_test(relative_path, path))

        return tests
Пример #7
0
    def _collect_tests(self):
        """Return the list of tests found."""

        def _is_test_file(filesystem, dirname, filename):
            return filesystem.splitext(filename)[1] in ['.html', '.svg']

        filesystem = self._host.filesystem

        paths = []
        for arg in self._args:
            paths.append(arg)
            relpath = filesystem.relpath(arg, self._base_path)
            if relpath:
                paths.append(relpath)

        skipped_directories = set(['.svn', 'resources'])
        test_files = find_files.find(filesystem, self._base_path, paths, skipped_directories, _is_test_file)
        tests = []
        for path in test_files:
            relative_path = self._port.relative_perf_test_filename(path)
            if self._port.skips_perf_test(relative_path):
                continue
            test_name = relative_path.replace('\\', '/')
            dirname = filesystem.dirname(path)
            if self._pattern_for_chromium_style_tests.match(relative_path):
                tests.append(ChromiumStylePerfTest(test_name, dirname, path))
            elif self._pattern_for_page_loading_tests.match(relative_path):
                tests.append(PageLoadingPerfTest(test_name, dirname, path))
            else:
                tests.append(PerfTest(test_name, dirname, path))

        return tests
Пример #8
0
    def _collect_tests(self):
        """Return the list of tests found."""

        def _is_test_file(filesystem, dirname, filename):
            return filename.endswith('.html')

        return find_files.find(self._host.filesystem, self._base_path, paths=self._args, file_filter=_is_test_file)
Пример #9
0
    def _collect_tests(self):
        """Return the list of tests found."""

        def _is_test_file(filesystem, dirname, filename):
            return filename.endswith('.html')

        skipped_directories = set(['.svn', 'resources'])
        tests = find_files.find(self._host.filesystem, self._base_path, self._args, skipped_directories, _is_test_file)
        return [test for test in tests if not self._port.skips_perf_test(self._port.relative_perf_test_filename(test))]
Пример #10
0
    def _collect_tests(self, webkit_base, filesystem=None):
        """Return the list of tests found."""

        def _is_test_file(filesystem, dirname, filename):
            return filename.endswith('.html')

        filesystem = filesystem or self._host.filesystem
        base_dir = filesystem.join(webkit_base, self._perf_tests_base_dir, self._perf_tests_dir)
        return find_files.find(filesystem, base_dir, paths=self._args, file_filter=_is_test_file)
Пример #11
0
 def _real_tests(self, paths):
     # When collecting test cases, skip these directories
     skipped_directories = set([
         '.svn', '_svn', 'resources', 'support', 'script-tests',
         'reference', 'reftest'
     ])
     files = find_files.find(self._port._filesystem,
                             self._port.layout_tests_dir(), paths,
                             skipped_directories, self._is_test_file,
                             self._port.test_key)
     return [self._port.relative_test_filename(f) for f in files]
Пример #12
0
    def _collect_tests(self, webkit_base, filesystem=None):
        """Return the list of tests found."""
        def _is_test_file(filesystem, dirname, filename):
            return filename.endswith('.html')

        filesystem = filesystem or self._host.filesystem
        base_dir = filesystem.join(webkit_base, self._perf_tests_base_dir,
                                   self._perf_tests_dir)
        return find_files.find(filesystem,
                               base_dir,
                               paths=self._args,
                               file_filter=_is_test_file)
Пример #13
0
    def _collect_tests(self):
        """Return the list of tests found."""
        def _is_test_file(filesystem, dirname, filename):
            return filename.endswith('.html')

        skipped_directories = set(['.svn', 'resources'])
        tests = find_files.find(self._host.filesystem, self._base_path,
                                self._args, skipped_directories, _is_test_file)
        return [
            test for test in tests if not self._port.skips_perf_test(
                self._port.relative_perf_test_filename(test))
        ]
Пример #14
0
    def _collect_tests(self):
        """Return the list of tests found."""

        def _is_test_file(filesystem, dirname, filename):
            return filename.endswith(".html")

        paths = []
        for arg in self._args:
            paths.append(arg)
            relpath = self._host.filesystem.relpath(arg, self._base_path)
            if relpath:
                paths.append(relpath)

        skipped_directories = set([".svn", "resources"])
        tests = find_files.find(self._host.filesystem, self._base_path, paths, skipped_directories, _is_test_file)
        return [test for test in tests if not self._port.skips_perf_test(self._port.relative_perf_test_filename(test))]
Пример #15
0
 def tests(self, paths):
     """Return the list of tests found."""
     # When collecting test cases, skip these directories
     skipped_directories = set(['.svn', '_svn', 'resources', 'script-tests', 'reference', 'reftest'])
     files = find_files.find(self.filesystem, self.layout_tests_dir(), paths, skipped_directories, Port._is_test_file)
     return set([self.relative_test_filename(f) for f in files])