Commit 57086a98 authored by jer.noble@apple.com's avatar jer.noble@apple.com

Strip out extraneous logging from AppleGVA in media tests.

https://bugs.webkit.org/show_bug.cgi?id=125357

Reviewed by Simon Fraser.

Add a mechanism for stripping out abritrary regular expressions from test input and output.

* Scripts/webkitpy/layout_tests/controllers/single_test_runner.py:
(SingleTestRunner._run_compare_test): Strip out logging
* Scripts/webkitpy/port/base.py:
(Port.logging_patterns_to_strip): Return an empty list by default.
* Scripts/webkitpy/port/driver.py:
(DriverOutput.strip_patterns): Apply the port specific patterns to the text.
* Scripts/webkitpy/port/mac.py:
(MacPort.logging_patterns_to_strip): Return a complete list.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160247 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 5dba3f1b
2013-12-06 Jer Noble <jer.noble@apple.com>
Strip out extraneous logging from AppleGVA in media tests.
https://bugs.webkit.org/show_bug.cgi?id=125357
Reviewed by Simon Fraser.
Add a mechanism for stripping out abritrary regular expressions from test input and output.
* Scripts/webkitpy/layout_tests/controllers/single_test_runner.py:
(SingleTestRunner._run_compare_test): Strip out logging
* Scripts/webkitpy/port/base.py:
(Port.logging_patterns_to_strip): Return an empty list by default.
* Scripts/webkitpy/port/driver.py:
(DriverOutput.strip_patterns): Apply the port specific patterns to the text.
* Scripts/webkitpy/port/mac.py:
(MacPort.logging_patterns_to_strip): Return a complete list.
2013-12-06 Dean Jackson <dino@apple.com>
Updating ANGLE should point to instructions
......
......@@ -112,6 +112,10 @@ class SingleTestRunner(object):
expected_driver_output.strip_metrics()
driver_output.strip_metrics()
patterns = self._port.logging_patterns_to_strip()
expected_driver_output.strip_patterns(patterns)
driver_output.strip_patterns(patterns)
test_result = self._compare_output(expected_driver_output, driver_output)
if self._options.new_test_results:
self._add_missing_baselines(test_result, driver_output)
......
......@@ -1541,6 +1541,8 @@ class Port(object):
# By current convention, the WebKit2 name is always mac-wk2, win-wk2, not mac-leopard-wk2, etc,
return "%s-wk2" % self.port_name
def logging_patterns_to_strip(self):
return []
class VirtualTestSuite(object):
def __init__(self, name, base, args, tests=None):
......
......@@ -55,26 +55,26 @@ class DriverOutput(object):
"""Groups information about a output from driver for easy passing
and post-processing of data."""
strip_patterns = []
strip_patterns.append((re.compile('at \(-?[0-9]+,-?[0-9]+\) *'), ''))
strip_patterns.append((re.compile('size -?[0-9]+x-?[0-9]+ *'), ''))
strip_patterns.append((re.compile('text run width -?[0-9]+: '), ''))
strip_patterns.append((re.compile('text run width -?[0-9]+ [a-zA-Z ]+: '), ''))
strip_patterns.append((re.compile('RenderButton {BUTTON} .*'), 'RenderButton {BUTTON}'))
strip_patterns.append((re.compile('RenderImage {INPUT} .*'), 'RenderImage {INPUT}'))
strip_patterns.append((re.compile('RenderBlock {INPUT} .*'), 'RenderBlock {INPUT}'))
strip_patterns.append((re.compile('RenderTextControl {INPUT} .*'), 'RenderTextControl {INPUT}'))
strip_patterns.append((re.compile('\([0-9]+px'), 'px'))
strip_patterns.append((re.compile(' *" *\n +" *'), ' '))
strip_patterns.append((re.compile('" +$'), '"'))
strip_patterns.append((re.compile('- '), '-'))
strip_patterns.append((re.compile('\n( *)"\s+'), '\n\g<1>"'))
strip_patterns.append((re.compile('\s+"\n'), '"\n'))
strip_patterns.append((re.compile('scrollWidth [0-9]+'), 'scrollWidth'))
strip_patterns.append((re.compile('scrollHeight [0-9]+'), 'scrollHeight'))
strip_patterns.append((re.compile('scrollX [0-9]+'), 'scrollX'))
strip_patterns.append((re.compile('scrollY [0-9]+'), 'scrollY'))
strip_patterns.append((re.compile('scrolled to [0-9]+,[0-9]+'), 'scrolled'))
metrics_patterns = []
metrics_patterns.append((re.compile('at \(-?[0-9]+,-?[0-9]+\) *'), ''))
metrics_patterns.append((re.compile('size -?[0-9]+x-?[0-9]+ *'), ''))
metrics_patterns.append((re.compile('text run width -?[0-9]+: '), ''))
metrics_patterns.append((re.compile('text run width -?[0-9]+ [a-zA-Z ]+: '), ''))
metrics_patterns.append((re.compile('RenderButton {BUTTON} .*'), 'RenderButton {BUTTON}'))
metrics_patterns.append((re.compile('RenderImage {INPUT} .*'), 'RenderImage {INPUT}'))
metrics_patterns.append((re.compile('RenderBlock {INPUT} .*'), 'RenderBlock {INPUT}'))
metrics_patterns.append((re.compile('RenderTextControl {INPUT} .*'), 'RenderTextControl {INPUT}'))
metrics_patterns.append((re.compile('\([0-9]+px'), 'px'))
metrics_patterns.append((re.compile(' *" *\n +" *'), ' '))
metrics_patterns.append((re.compile('" +$'), '"'))
metrics_patterns.append((re.compile('- '), '-'))
metrics_patterns.append((re.compile('\n( *)"\s+'), '\n\g<1>"'))
metrics_patterns.append((re.compile('\s+"\n'), '"\n'))
metrics_patterns.append((re.compile('scrollWidth [0-9]+'), 'scrollWidth'))
metrics_patterns.append((re.compile('scrollHeight [0-9]+'), 'scrollHeight'))
metrics_patterns.append((re.compile('scrollX [0-9]+'), 'scrollX'))
metrics_patterns.append((re.compile('scrollY [0-9]+'), 'scrollY'))
metrics_patterns.append((re.compile('scrolled to [0-9]+,[0-9]+'), 'scrolled'))
def __init__(self, text, image, image_hash, audio, crash=False,
test_time=0, measurements=None, timeout=False, error='', crashed_process_name='??',
......@@ -99,12 +99,14 @@ class DriverOutput(object):
return bool(self.error)
def strip_metrics(self):
self.strip_patterns(self.metrics_patterns)
def strip_patterns(self, patterns):
if not self.text:
return
for pattern in self.strip_patterns:
for pattern in patterns:
self.text = re.sub(pattern[0], pattern[1], self.text)
class Driver(object):
"""object for running test(s) using DumpRenderTree/WebKitTestRunner."""
......
......@@ -30,6 +30,7 @@
import logging
import os
import time
import re
from webkitpy.common.system.crashlogs import CrashLogs
from webkitpy.common.system.executive import ScriptError
......@@ -318,3 +319,7 @@ class MacPort(ApplePort):
except ScriptError:
_log.warn("xcrun failed; falling back to '%s'." % fallback)
return fallback
def logging_patterns_to_strip(self):
# FIXME: Remove this after <rdar://problem/15605007> is fixed
return [(re.compile('(AVF|GVA) info:.*\n'), '')]
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment