本文整理汇总了Python中webkitpy.common.webkit_finder.WebKitFinder类的典型用法代码示例。如果您正苦于以下问题:Python WebKitFinder类的具体用法?Python WebKitFinder怎么用?Python WebKitFinder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了WebKitFinder类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _read_configuration_from_gn
def _read_configuration_from_gn(fs, options):
"""Return the configuration to used based on args.gn, if possible."""
# We should really default to 'out' everywhere at this point, but
# that's a separate cleanup CL.
build_directory = getattr(options, 'build_directory', None) or 'out'
target = options.target
finder = WebKitFinder(fs)
path = fs.join(finder.chromium_base(), build_directory, target, 'args.gn')
if not fs.exists(path):
path = fs.join(finder.chromium_base(), build_directory, target, 'toolchain.ninja')
if not fs.exists(path):
# This does not appear to be a GN-based build directory, so we don't know
# how to interpret it.
return None
# toolchain.ninja exists, but args.gn does not; this can happen when
# `gn gen` is run with no --args.
return 'Debug'
args = fs.read_text_file(path)
for l in args.splitlines():
m = re.match('^\s*is_debug\s*=\s*false(\s*$|\s*#.*$)', l)
if m:
return 'Release'
# if is_debug is set to anything other than false, or if it
# does not exist at all, we should use the default value (True).
return 'Debug'
示例2: __init__
def __init__(self, host, source_directory, options):
self.host = host
self.source_directory = source_directory
self.options = options
self.filesystem = self.host.filesystem
webkit_finder = WebKitFinder(self.filesystem)
self._webkit_root = webkit_finder.webkit_base()
self.destination_directory = webkit_finder.path_from_webkit_base("LayoutTests", options.destination)
self.tests_w3c_relative_path = self.filesystem.join('imported', 'w3c')
self.layout_tests_path = webkit_finder.path_from_webkit_base('LayoutTests')
self.layout_tests_w3c_path = self.filesystem.join(self.layout_tests_path, self.tests_w3c_relative_path)
self.tests_download_path = webkit_finder.path_from_webkit_base('WebKitBuild', 'w3c-tests')
self._test_downloader = None
self._potential_test_resource_files = []
self.import_list = []
self._importing_downloaded_tests = source_directory is None
self._test_resource_files_json_path = self.filesystem.join(self.layout_tests_w3c_path, "resources", "resource-files.json")
self._test_resource_files = json.loads(self.filesystem.read_text_file(self._test_resource_files_json_path)) if self.filesystem.exists(self._test_resource_files_json_path) else None
self._tests_options_json_path = self.filesystem.join(self.layout_tests_path, 'tests-options.json')
self._tests_options = json.loads(self.filesystem.read_text_file(self._tests_options_json_path)) if self.filesystem.exists(self._tests_options_json_path) else None
self._slow_tests = []
if self.options.clean_destination_directory and self._test_resource_files:
self._test_resource_files["files"] = []
if self._tests_options:
self.remove_slow_from_w3c_tests_options()
示例3: _test_prefix_list
def _test_prefix_list(self, issue_number, only_changed_tests):
"""Returns a collection of test, builder and file extensions to get new baselines for.
Args:
issue_number: The CL number of the change which needs new baselines.
only_changed_tests: Whether to only include baselines for tests that
are changed in this CL. If False, all new baselines for failing
tests will be downloaded, even for tests that were not modified.
Returns:
A dict containing information about which new baselines to download.
"""
builds_to_tests = self._builds_to_tests(issue_number)
if only_changed_tests:
files_in_cl = self.rietveld.changed_files(issue_number)
finder = WebKitFinder(self._tool.filesystem)
tests_in_cl = [finder.layout_test_name(f) for f in files_in_cl]
result = {}
for build, tests in builds_to_tests.iteritems():
for test in tests:
if only_changed_tests and test not in tests_in_cl:
continue
if test not in result:
result[test] = {}
result[test][build] = BASELINE_SUFFIX_LIST
return result
示例4: __init__
def __init__(self, repository_directory, host, options):
self._options = options
self._host = host
self._filesystem = host.filesystem
self._test_suites = []
self.repository_directory = repository_directory
self.test_repositories = self.load_test_repositories()
self.paths_to_skip = []
self.paths_to_import = []
for test_repository in self.test_repositories:
self.paths_to_skip.extend(
[self._filesystem.join(test_repository["name"], path) for path in test_repository["paths_to_skip"]]
)
self.paths_to_import.extend(
[self._filesystem.join(test_repository["name"], path) for path in test_repository["paths_to_import"]]
)
if not self._options.import_all:
webkit_finder = WebKitFinder(self._filesystem)
import_expectations_path = webkit_finder.path_from_webkit_base(
"LayoutTests", "imported", "w3c", "resources", "ImportExpectations"
)
self._init_paths_from_expectations(import_expectations_path)
示例5: load_test_repositories
def load_test_repositories():
filesystem = FileSystem()
webkit_finder = WebKitFinder(filesystem)
test_repositories_path = webkit_finder.path_from_webkit_base(
"LayoutTests", "imported", "w3c", "resources", "TestRepositories"
)
return json.loads(filesystem.read_text_file(test_repositories_path))
示例6: get_port
def get_port(self, target=None, configuration=None, files=None):
host = MockHost()
wkf = WebKitFinder(host.filesystem)
files = files or {}
for path, contents in files.items():
host.filesystem.write_text_file(wkf.path_from_chromium_base(path), contents)
options = optparse.Values({'target': target, 'configuration': configuration})
return factory.PortFactory(host).get(options=options)
示例7: get_port
def get_port(self, target=None, configuration=None, files=None):
host = MockSystemHost()
wkf = WebKitFinder(host.filesystem)
files = files or {}
for path, contents in files.items():
host.filesystem.write_text_file(wkf.path_from_chromium_base(path), contents)
options = MockOptions(target=target, configuration=configuration)
return factory.PortFactory(host).get(options=options)
示例8: _run_pylint
def _run_pylint(self, path):
wkf = WebKitFinder(FileSystem())
executive = Executive()
return executive.run_command([sys.executable, wkf.path_from_depot_tools_base('pylint.py'),
'--output-format=parseable',
'--errors-only',
'--rcfile=' + wkf.path_from_webkit_base('Tools', 'Scripts', 'webkitpy', 'pylintrc'),
path],
error_handler=executive.ignore_error)
示例9: main
def main():
filesystem = FileSystem()
wkf = WebKitFinder(filesystem)
tester = Tester(filesystem, wkf)
tester.add_tree(wkf.path_from_webkit_base('tools'), 'webkitpy')
tester.skip(('webkitpy.common.checkout.scm.scm_unittest',), 'are really, really, slow', 31818)
if sys.platform == 'win32':
tester.skip(('webkitpy.common.checkout', 'webkitpy.common.config', 'webkitpy.tool', 'webkitpy.w3c', 'webkitpy.layout_tests.layout_package.bot_test_expectations'), 'fail horribly on win32', 54526)
return not tester.run()
示例10: _determine_driver_path_statically
def _determine_driver_path_statically(cls, host, options):
config_object = config.Config(host.executive, host.filesystem)
build_directory = getattr(options, "build_directory", None)
finder = WebKitFinder(host.filesystem)
webkit_base = finder.webkit_base()
chromium_base = finder.chromium_base()
driver_name = cls.SKY_SHELL_NAME
if hasattr(options, "configuration") and options.configuration:
configuration = options.configuration
else:
configuration = config_object.default_configuration()
return cls._static_build_path(host.filesystem, build_directory, chromium_base, configuration, [driver_name])
示例11: __init__
def __init__(self, host, source_directory, options):
self.host = host
self.source_directory = source_directory
self.options = options
self.filesystem = self.host.filesystem
webkit_finder = WebKitFinder(self.filesystem)
self._webkit_root = webkit_finder.webkit_base()
self.destination_directory = webkit_finder.path_from_webkit_base("LayoutTests", options.destination)
self.import_list = []
示例12: _run_pylint
def _run_pylint(self, path):
wkf = WebKitFinder(FileSystem())
executive = Executive()
env = os.environ.copy()
env['PYTHONPATH'] = ('%s%s%s' % (wkf.path_from_webkit_base('Tools', 'Scripts'),
os.pathsep,
wkf.path_from_webkit_base('Tools', 'Scripts', 'webkitpy', 'thirdparty')))
return executive.run_command([sys.executable, wkf.path_from_depot_tools_base('pylint.py'),
'--output-format=parseable',
'--errors-only',
'--rcfile=' + wkf.path_from_webkit_base('Tools', 'Scripts', 'webkitpy', 'pylintrc'),
path],
env=env,
error_handler=executive.ignore_error)
示例13: __init__
def __init__(self, host):
self.host = host
self.executive = host.executive
self.fs = host.filesystem
self.finder = WebKitFinder(self.fs)
self.verbose = False
self.git_cl = None
示例14: __init__
def __init__(self, host):
self.host = host
self.executive = host.executive
self.fs = host.filesystem
self.finder = WebKitFinder(self.fs)
self.verbose = False
self.allow_local_blink_commits = False
self.keep_w3c_repos_around = False
示例15: __init__
def __init__(self, host, source_directory, options):
self.host = host
self.source_directory = source_directory
self.options = options
self.filesystem = self.host.filesystem
webkit_finder = WebKitFinder(self.filesystem)
self._webkit_root = webkit_finder.webkit_base()
self.destination_directory = webkit_finder.path_from_webkit_base("LayoutTests", options.destination)
self.layout_tests_w3c_path = webkit_finder.path_from_webkit_base('LayoutTests', 'imported', 'w3c')
self.tests_download_path = webkit_finder.path_from_webkit_base('WebKitBuild', 'w3c-tests')
self._test_downloader = None
self.import_list = []
self._importing_downloaded_tests = source_directory is None