def test_mac_port(self): self.assertEquals(MacPort.name(), "Mac") self.assertEquals(MacPort.flag(), "--port=mac") self.assertEquals(MacPort.run_webkit_tests_command(), [WebKitPort.script_path("run-webkit-tests")]) self.assertEquals(MacPort.build_webkit_command(), [WebKitPort.script_path("build-webkit")]) self.assertEquals(MacPort.build_webkit_command(build_style="debug"), [WebKitPort.script_path("build-webkit"), "--debug"]) self.assertEquals(MacPort.build_webkit_command(build_style="release"), [WebKitPort.script_path("build-webkit"), "--release"])
def test_chromium_port(self): self.assertEquals(ChromiumPort.name(), "Chromium") self.assertEquals(ChromiumPort.flag(), "--port=chromium") self.assertEquals(ChromiumPort.run_webkit_tests_command(), [WebKitPort.script_path("run-webkit-tests")]) self.assertEquals(ChromiumPort.build_webkit_command(), [WebKitPort.script_path("build-webkit"), "--chromium"]) self.assertEquals(ChromiumPort.build_webkit_command(build_style="debug"), [WebKitPort.script_path("build-webkit"), "--debug", "--chromium"]) self.assertEquals(ChromiumPort.update_webkit_command(), [WebKitPort.script_path("update-webkit"), "--chromium"])
def test_qt_port(self): self.assertEquals(QtPort.name(), "Qt") self.assertEquals(QtPort.flag(), "--port=qt") self.assertEquals(QtPort.run_webkit_tests_command(), [WebKitPort.script_path("run-webkit-tests")]) self.assertEquals(QtPort.build_webkit_command(), [ WebKitPort.script_path("build-webkit"), "--qt", WebKitPort.makeArgs() ]) self.assertEquals(QtPort.build_webkit_command(build_style="debug"), [ WebKitPort.script_path("build-webkit"), "--debug", "--qt", WebKitPort.makeArgs() ])
def test_mac_port(self): self.assertEquals(MacPort.name(), "Mac") self.assertEquals(MacPort.flag(), "--port=mac") self.assertEquals(MacPort.run_webkit_tests_command(), [WebKitPort.script_path("run-webkit-tests")]) self.assertEquals(MacPort.build_webkit_command(), [WebKitPort.script_path("build-webkit")]) self.assertEquals(MacPort.build_webkit_command(build_style="debug"), [WebKitPort.script_path("build-webkit"), "--debug"]) self.assertEquals(MacPort.build_webkit_command(build_style="release"), [WebKitPort.script_path("build-webkit"), "--release"]) class TestIsLeopard(MacPort): @classmethod def _system_version(cls): return [10, 5] self.assertTrue(TestIsLeopard.is_leopard())
def test_runtests_args(self): mock_options = self._step_options() step = RunTests(MockTool(log_executive=True), mock_options) # FIXME: We shouldn't use a real port-object here, but there is too much to mock at the moment. mock_port = WebKitPort() mock_port.name = lambda: "Mac" tool = MockTool(log_executive=True) tool.port = lambda: mock_port step = RunTests(tool, mock_options) expected_stderr = """Running Python unit tests MOCK run_and_throw_if_fail: ['Tools/Scripts/test-webkitpy'] Running Perl unit tests MOCK run_and_throw_if_fail: ['Tools/Scripts/test-webkitperl'] Running JavaScriptCore tests MOCK run_and_throw_if_fail: ['Tools/Scripts/run-javascriptcore-tests'] Running run-webkit-tests MOCK run_and_throw_if_fail: ['Tools/Scripts/run-webkit-tests', '--no-new-test-results', '--no-launch-safari', '--exit-after-n-failures=20', '--quiet'] """ OutputCapture().assert_outputs(self, step.run, [{}], expected_stderr=expected_stderr)
def test_runtests_args(self): mock_options = self._step_options() step = steps.RunTests(MockTool(log_executive=True), mock_options) # FIXME: We shouldn't use a real port-object here, but there is too much to mock at the moment. mock_port = WebKitPort() mock_port.name = lambda: "Mac" tool = MockTool(log_executive=True) tool.port = lambda: mock_port step = steps.RunTests(tool, mock_options) expected_stderr = """Running Python unit tests MOCK run_and_throw_if_fail: ['Tools/Scripts/test-webkitpy'], cwd=/mock-checkout Running Perl unit tests MOCK run_and_throw_if_fail: ['Tools/Scripts/test-webkitperl'], cwd=/mock-checkout Running JavaScriptCore tests MOCK run_and_throw_if_fail: ['Tools/Scripts/run-javascriptcore-tests'], cwd=/mock-checkout Running run-webkit-tests MOCK run_and_throw_if_fail: ['Tools/Scripts/run-webkit-tests', '--no-new-test-results', '--no-launch-safari', '--exit-after-n-failures=30', '--quiet'], cwd=/mock-checkout """ OutputCapture().assert_outputs(self, step.run, [{}], expected_stderr=expected_stderr)
def handle_global_options(self, options): self._initialize_scm(options.patch_directories) if options.status_host: self.status_server.set_host(options.status_host) if options.bot_id: self.status_server.set_bot_id(options.bot_id) if options.irc_password: self.irc_password = options.irc_password # If options.port is None, we'll get the default port for this platform. self._deprecated_port = WebKitPort.port(options.port)
def test_runtests_leopard_commit_queue_hack(self): mock_options = Mock() mock_options.non_interactive = True step = RunTests(MockTool(log_executive=True), mock_options) # FIXME: We shouldn't use a real port-object here, but there is too much to mock at the moment. mock_port = WebKitPort() mock_port.name = lambda: "Mac" mock_port.is_leopard = lambda: True step.port = lambda: mock_port expected_stderr = """Running Python unit tests MOCK run_and_throw_if_fail: ['WebKitTools/Scripts/test-webkitpy'] Running Perl unit tests MOCK run_and_throw_if_fail: ['WebKitTools/Scripts/test-webkitperl'] Running JavaScriptCore tests MOCK run_and_throw_if_fail: ['WebKitTools/Scripts/run-javascriptcore-tests'] Running run-webkit-tests MOCK run_and_throw_if_fail: ['WebKitTools/Scripts/run-webkit-tests', '--no-launch-safari', '--exit-after-n-failures=1', '--ignore-tests', 'compositing/iframes', '--quiet'] """ OutputCapture().assert_outputs(self, step.run, [{}], expected_stderr=expected_stderr)
def test_runtests_leopard_commit_queue_hack(self): mock_options = MockOptions() mock_options.non_interactive = True step = RunTests(MockTool(log_executive=True), mock_options) # FIXME: We shouldn't use a real port-object here, but there is too much to mock at the moment. mock_port = WebKitPort() mock_port.name = lambda: "Mac" mock_port.is_leopard = lambda: True step.port = lambda: mock_port expected_stderr = """Running Python unit tests MOCK run_and_throw_if_fail: ['WebKitTools/Scripts/test-webkitpy'] Running Perl unit tests MOCK run_and_throw_if_fail: ['WebKitTools/Scripts/test-webkitperl'] Running JavaScriptCore tests MOCK run_and_throw_if_fail: ['WebKitTools/Scripts/run-javascriptcore-tests'] Running run-webkit-tests MOCK run_and_throw_if_fail: ['WebKitTools/Scripts/run-webkit-tests', '--no-launch-safari', '--exit-after-n-failures=1', '--wait-for-httpd', '--ignore-tests', 'compositing,media', '--quiet'] """ OutputCapture().assert_outputs(self, step.run, [{}], expected_stderr=expected_stderr)
def test_runtests_args(self): mock_options = self._step_options() mock_options.non_interactive = False step = steps.RunTests(MockTool(log_executive=True), mock_options) # FIXME: We shouldn't use a real port-object here, but there is too much to mock at the moment. mock_port = WebKitPort() mock_port.name = lambda: "Mac" tool = MockTool(log_executive=True) tool.port = lambda: mock_port step = steps.RunTests(tool, mock_options) expected_stderr = """Running Python unit tests MOCK run_and_throw_if_fail: ['Tools/Scripts/test-webkitpy'], cwd=/mock-checkout Running Perl unit tests MOCK run_and_throw_if_fail: ['Tools/Scripts/test-webkitperl'], cwd=/mock-checkout Running JavaScriptCore tests MOCK run_and_throw_if_fail: ['Tools/Scripts/run-javascriptcore-tests'], cwd=/mock-checkout Running run-webkit-tests MOCK run_and_throw_if_fail: ['Tools/Scripts/run-webkit-tests', '--quiet'], cwd=/mock-checkout """ OutputCapture().assert_outputs(self, step.run, [{}], expected_stderr=expected_stderr)
def handle_global_options(self, options): self._options = options if options.dry_run: self.scm().dryrun = True self.bugs.dryrun = True if options.status_host: self.status_server.set_host(options.status_host) if options.bot_id: self.status_server.set_bot_id(options.bot_id) if options.irc_password: self.irc_password = options.irc_password # If options.port is None, we'll get the default port for this platform. self._port = WebKitPort.port(options.port)
def __init__(self): AbstractReviewQueue.__init__(self) self.port = WebKitPort.port(self.port_name)
def test_qt_port(self): self.assertEquals(QtPort.name(), "Qt") self.assertEquals(QtPort.flag(), "--port=qt") self.assertEquals(QtPort.run_webkit_tests_command(), [WebKitPort.script_path("run-webkit-tests")]) self.assertEquals(QtPort.build_webkit_command(), [WebKitPort.script_path("build-webkit"), "--qt", WebKitPort.makeArgs()]) self.assertEquals(QtPort.build_webkit_command(build_style="debug"), [WebKitPort.script_path("build-webkit"), "--debug", "--qt", WebKitPort.makeArgs()])
def port(self): if self._port: return self._port self._port = WebKitPort.port(self._options.port) return self._port