Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(22)

Unified Diff: webkit/tools/layout_tests/layout_package/test_failures.py

Issue 346018: 1. Show crash stacks in run_webkit_tests.py stdio... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webkit/tools/layout_tests/layout_package/test_failures.py
===================================================================
--- webkit/tools/layout_tests/layout_package/test_failures.py (revision 30488)
+++ webkit/tools/layout_tests/layout_package/test_failures.py (working copy)
@@ -4,6 +4,8 @@
"""Classes for failures that occur during tests."""
+import os
+
class FailureSort(object):
"""A repository for failure sort orders and tool to facilitate sorting."""
@@ -43,7 +45,22 @@
"""Returns True if we should kill the test shell before the next test."""
return False
+ def RelativeOutputFilename(self, filename, modifier):
+ """Returns a relative filename inside the output dir that contains
+ modifier.
+ For example, if filename is fast\dom\foo.html and modifier is
+ "-expected.txt", the return value is fast\dom\foo-expected.txt
+
+ Args:
+ filename: relative filename to test file
+ modifier: a string to replace the extension of filename with
+
+ Return:
+ The relative windows path to the output filename
+ """
+ return os.path.splitext(filename)[0] + modifier
+
class FailureWithType(TestFailure):
"""Base class that produces standard HTML output based on the test type.
@@ -52,6 +69,7 @@
"""
def __init__(self, test_type):
TestFailure.__init__(self)
+ # TODO(ojan): This class no longer needs to know the test_type.
self._test_type = test_type
# Filename suffixes used by ResultHtmlOutput.
@@ -70,8 +88,7 @@
string.
"""
links = ['']
- uris = [self._test_type.RelativeOutputFilename(filename, fn)
- for fn in out_names]
+ uris = [self.RelativeOutputFilename(filename, fn) for fn in out_names]
if len(uris) > 1:
links.append("<a href='%s'>expected</a>" % uris[1])
if len(uris) > 0:
@@ -108,7 +125,8 @@
def ResultHtmlOutput(self, filename):
# TODO(tc): create a link to the minidump file
- return "<strong>%s</strong>" % self.Message()
+ stack = self.RelativeOutputFilename(filename, "-stack.txt")
+ return "<strong>%s</strong> <a href=%s>stack</a>" % (self.Message(), stack)
def ShouldKillTestShell(self):
return True

Powered by Google App Engine
This is Rietveld 408576698