Changeset 84111 in webkit
- Timestamp:
- Apr 17, 2011 2:48:01 PM (13 years ago)
- Location:
- trunk/Tools
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r84104 r84111 1 2011-04-17 Dirk Pranke <dpranke@chromium.org> 2 3 Reviewed by Ojan Vafai. 4 5 new-run-webkit-tests: read stderr from chromium DRT separately 6 https://bugs.webkit.org/show_bug.cgi?id=58708 7 8 * Scripts/webkitpy/layout_tests/port/chromium.py: 9 * Scripts/webkitpy/layout_tests/port/chromium_unittest.py: 10 * Scripts/webkitpy/layout_tests/port/mock_drt.py: 11 1 12 2011-04-17 Patrick Gansterer <paroga@webkit.org> 2 13 -
trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium.py
r83759 r84111 358 358 self._image_path = self._port._filesystem.join(self._port.results_directory(), 359 359 'png_result%s.png' % self._worker_number) 360 self._stderr_is_nonblocking = False 360 361 361 362 def cmd_line(self): … … 404 405 self._proc = subprocess.Popen(cmd, stdin=subprocess.PIPE, 405 406 stdout=subprocess.PIPE, 406 stderr=subprocess. STDOUT,407 stderr=subprocess.PIPE, 407 408 close_fds=close_flag) 409 self._stderr_is_nonblocking = False 408 410 409 411 def poll(self): … … 516 518 output.append(line) 517 519 else: 518 error.append( line)520 error.append('extra stdout output: %s' % line) 519 521 520 522 (line, crash) = self._write_command_and_read_line(input=None) … … 527 529 if not text: 528 530 text = None 531 error_text = ''.join(error) + self._read_stderr() 529 532 530 533 return base.DriverOutput(text, output_image, actual_checksum, audio=None, 531 crash=crash, test_time=run_time, timeout=timeout, error= ''.join(error))534 crash=crash, test_time=run_time, timeout=timeout, error=error_text) 532 535 533 536 def stop(self): … … 553 556 self._proc.wait() 554 557 self._proc = None 558 559 def _read_stderr(self): 560 if sys.platform in ('win32', 'cygwin'): 561 import msvcrt 562 import win32pipe 563 564 fd = self._proc.stderr.fileno() 565 osf = msvcrt.get_osfhandle(fd) 566 _, avail, _ = win32pipe.PeekNamedPipe(osf, 0) 567 if avail: 568 return self._proc.stderr.read(avail) 569 return '' 570 else: 571 if not self._stderr_is_nonblocking: 572 import fcntl 573 import os 574 fd = self._proc.stderr.fileno() 575 fl = fcntl.fcntl(fd, fcntl.F_GETFL) 576 fcntl.fcntl(fd, fcntl.F_SETFL, fl | os.O_NONBLOCK) 577 self._stderr_is_nonblocking = True 578 return self._proc.stderr.read() -
trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium_unittest.py
r83476 r84111 42 42 import chromium_win 43 43 44 from webkitpy.layout_tests.port import base 45 from webkitpy.layout_tests.port import factory 44 46 from webkitpy.layout_tests.port import port_testcase 45 47 … … 221 223 self.assertFalse(exception_raised) 222 224 225 # Disabled because this is an integration test that relies on the 226 # actual filesystem. 227 def disabled_test_stderr(self): 228 port = factory.get('mock-chromium-mac-snowleopard') 229 path = port.abspath_for_test('fast/html/article-element.html') 230 self.assertTrue(port._filesystem.exists(path)) 231 232 driver = port.create_driver(1) 233 driver.start() 234 try: 235 driver_input = base.DriverInput(path, 1000, None) 236 driver_output = driver.run_test(driver_input) 237 self.assertEquals(driver_output.error.strip(), 'stuff going to stderr') 238 finally: 239 driver.stop() 240 223 241 224 242 class ChromiumPortLoggingTest(logtesting.LoggingTestCase): -
trunk/Tools/Scripts/webkitpy/layout_tests/port/mock_drt.py
r83475 r84111 284 284 self._stdout.flush() 285 285 286 # FIXME: this is a lame hack to test that we are capturing stderr 287 # output correctly. We should fix this by passing in a command line 288 # arg once https://bugs.webkit.org/show_bug.cgi?id=58680 lands. 289 if 'article-element' in test_input.uri: 290 self._stderr.write("stuff going to stderr\n") 291 self._stderr.flush() 292 286 293 287 294 if __name__ == '__main__':
Note: See TracChangeset
for help on using the changeset viewer.