def __init__(self): self.executive = executive.Executive() self.filesystem = filesystem.FileSystem() self.user = user.User() self.platform = platforminfo.PlatformInfo(sys, platform, self.executive) self.workspace = workspace.Workspace(self.filesystem, self.executive)
def configuration_options(): return [ optparse.make_option( "-t", "--target", default=config.Config( executive.Executive(), filesystem.FileSystem()).default_configuration(), dest="configuration", help="(DEPRECATED) (default: %default)"), optparse.make_option('--debug', action='store_const', const='Debug', dest="configuration", help='Set the configuration to Debug'), optparse.make_option('--release', action='store_const', const='Release', dest="configuration", help='Set the configuration to Release'), optparse.make_option( '--64-bit', action='store_const', const='x86_64', default=None, dest="architecture", help='use 64-bit binaries by default (x86_64 instead of x86)'), optparse.make_option( '--32-bit', action='store_const', const='x86', default=None, dest="architecture", help='use 32-bit binaries by default (x86 instead of x86_64)'), ]
def test_webkit_base_dir(self): # FIXME: We use a real filesystem here. Should this move to a # mocked one? c = config.Config(executive.Executive(), filesystem.FileSystem()) base_dir = c.webkit_base_dir() self.assertTrue(base_dir) self.assertNotEqual(base_dir[-1], '/') orig_cwd = os.getcwd() if sys.platform == 'win32': os.chdir(os.environ['USERPROFILE']) else: os.chdir(os.environ['HOME']) c = config.Config(executive.Executive(), filesystem.FileSystem()) try: base_dir_2 = c.webkit_base_dir() self.assertEqual(base_dir, base_dir_2) finally: os.chdir(orig_cwd)
def __init__(self): self.executable = sys.executable self.executive = executive.Executive() self.filesystem = filesystem.FileSystem() self.user = user.User() self.platform = platforminfo.PlatformInfo(sys, platform, self.executive) self.workspace = workspace.Workspace(self.filesystem, self.executive) self.stdin = sys.stdin self.stdout = sys.stdout self.stderr = sys.stderr
def configuration_options(): return [ optparse.make_option( "-t", "--target", default=config.Config( executive.Executive(), filesystem.FileSystem()).default_configuration(), dest="configuration", help="(DEPRECATED) (default: %default)"), optparse.make_option('--debug', action='store_const', const='Debug', dest="configuration", help='Set the configuration to Debug'), optparse.make_option('--release', action='store_const', const='Release', dest="configuration", help='Set the configuration to Release'), optparse.make_option( '--64-bit', action='store_const', const='x86_64', default=None, dest="architecture", help='use 64-bit binaries by default (x86_64 instead of x86)'), optparse.make_option( '--32-bit', action='store_const', const='x86', default=None, dest="architecture", help='use 32-bit binaries by default (x86 instead of x86_64)'), optparse.make_option('--arm', action='store_const', const='arm64e', default=None, dest="architecture", help='Use arm64e binaries by default'), optparse.make_option( '--architecture', action='store', default=None, dest="architecture", help='Use binaries of the specified architecture by default.'), # FIXME https://bugs.webkit.org/213677: This should effect the models used by simulator ports optparse.make_option('--model', action='store', default=None, dest="model", help='Override the model details on upload.'), ]
def main(argv=None): if not argv: argv = sys.argv if len(argv) == 3 and argv[1] == '--mock': e = executive_mock.MockExecutive2(output='foo\nfoo/%s' % argv[2]) fs = filesystem_mock.MockFileSystem({'foo/Configuration': argv[2]}) else: e = executive.Executive() fs = filesystem.FileSystem() c = config.Config(e, fs) print(c.default_configuration())
def __init__(self): self.bugs = bugzilla.Bugzilla() self.buildbot = buildbot.BuildBot() self.executive = executive.Executive() self._irc = None self.filesystem = filesystem.FileSystem() self.workspace = workspace.Workspace(self.filesystem, self.executive) self._port = None self.user = user.User() self._scm = None self._checkout = None self.status_server = statusserver.StatusServer() self.port_factory = port.factory self.platform = platforminfo.PlatformInfo()
def __init__(self): self.bugs = bugzilla.Bugzilla() self.buildbot = buildbot.BuildBot() self.executive = executive.Executive() self.web = web.Web() self._irc = None self.filesystem = filesystem.FileSystem() self.workspace = workspace.Workspace(self.filesystem, self.executive) self._port = None self.user = user.User() self._scm = None self._checkout = None self.status_server = statusserver.StatusServer() # FIXME: Unfortunately Port objects are currently the central-dispatch objects of the NRWT world. # In order to instantiate a port correctly, we have to pass it at least an executive, user, scm, and filesystem # so for now we just pass along the whole Host object. self.port_factory = PortFactory(self) self.platform = platforminfo.PlatformInfo()
def test_default_configuration__standalone(self): # FIXME: This test runs a standalone python script to test # reading the default configuration to work around any possible # caching / reset bugs. See https://bugs.webkit.org/show_bug?id=49360 # for the motivation. We can remove this test when we remove the # global configuration cache in config.py. e = executive.Executive() fs = filesystem.FileSystem() c = config.Config(e, fs) script = c.path_from_webkit_base('Tools', 'Scripts', 'webkitpy', 'layout_tests', 'port', 'config_standalone.py') # Note: don't use 'Release' here, since that's the normal default. expected = 'Debug' args = [sys.executable, script, '--mock', expected] actual = e.run_command(args).rstrip() self.assertEqual(actual, expected)
def test_watch_list_load(self): # Test parsing of the checked-in watch list. OutputCapture().assert_outputs(self, WatchListLoader( filesystem.FileSystem()).load, expected_logs="")
def __init__(self): self._executive = executive.Executive() self._filesystem = filesystem.FileSystem()
def remove_log_files(self, folder, starts_with): files = os.listdir(folder) for file in files: if file.startswith(starts_with): full_path = os.path.join(folder, file) filesystem.FileSystem().remove(full_path)
port = self._port test_name = self._port.uri_to_test_name(test_input.uri) test_path = self._filesystem.join(port.layout_tests_dir(), test_name) actual_text = port.expected_text(test_path) actual_image = '' actual_checksum = '' if self._options.pixel_tests and test_input.checksum: actual_checksum = port.expected_checksum(test_path) if actual_checksum != test_input.checksum: actual_image = port.expected_image(test_path) self._stdout.write("#URL:%s\n" % test_input.uri) if self._options.pixel_tests and test_input.checksum: self._stdout.write("#MD5:%s\n" % actual_checksum) self._filesystem.write_binary_file(self._options.pixel_path, actual_image) self._stdout.write(actual_text) # FIXME: (See above FIXME as well). Chromium DRT appears to always # ensure the text output has a trailing newline. Mac DRT does not. if not actual_text.endswith('\n'): self._stdout.write('\n') self._stdout.write('#EOF\n') self._stdout.flush() if __name__ == '__main__': fs = filesystem.FileSystem() sys.exit(main(sys.argv[1:], fs, sys.stdin, sys.stdout, sys.stderr))
def test_path_from_webkit_base(self): # FIXME: We use a real filesystem here. Should this move to a # mocked one? c = config.Config(executive.Executive(), filesystem.FileSystem()) self.assertTrue(c.path_from_webkit_base('foo'))
def test_watch_list_load(self): # Test parsing of the checked-in watch list. WatchListLoader(filesystem.FileSystem()).load()