Changeset 90538 in webkit


Ignore:
Timestamp:
Jul 6, 2011 9:42:54 PM (13 years ago)
Author:
abarth@webkit.org
Message:

2011-07-06 Adam Barth <abarth@webkit.org>

Cleanup result_summary.py
https://bugs.webkit.org/show_bug.cgi?id=64057

Reviewed by Eric Seidel.

This class had a bunch of out-of-date docstrings that no longer make
any sense.

  • Scripts/webkitpy/layout_tests/models/result_summary.py:
Location:
trunk/Tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r90537 r90538  
     12011-07-06  Adam Barth  <abarth@webkit.org>
     2
     3        Cleanup result_summary.py
     4        https://bugs.webkit.org/show_bug.cgi?id=64057
     5
     6        Reviewed by Eric Seidel.
     7
     8        This class had a bunch of out-of-date docstrings that no longer make
     9        any sense.
     10
     11        * Scripts/webkitpy/layout_tests/models/result_summary.py:
     12
    1132011-07-06  Adam Barth  <abarth@webkit.org>
    214
  • trunk/Tools/Scripts/webkitpy/layout_tests/models/result_summary.py

    r90534 r90538  
    1 #!/usr/bin/env python
    21# Copyright (C) 2010 Google Inc. All rights reserved.
    32# Copyright (C) 2010 Gabor Rapcsanyi (rgabor@inf.u-szeged.hu), University of Szeged
     
    2928# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    3029
    31 """Run layout tests."""
    32 
    33 import logging
    34 
    35 from webkitpy.layout_tests.models import test_expectations
    36 from webkitpy.layout_tests.models.test_expectations import TestExpectations
    37 
    38 
    39 _log = logging.getLogger(__name__)
     30from webkitpy.layout_tests.models.test_expectations import TestExpectations, SKIP, CRASH, TIMEOUT
    4031
    4132
    4233class ResultSummary(object):
    43     """A class for partitioning the test results we get into buckets.
    44 
    45     This class is basically a glorified struct and it's private to this file
    46     so we don't bother with any information hiding."""
    47 
    4834    def __init__(self, expectations, test_files):
    4935        self.total = len(test_files)
     
    6046        self.unexpected_results = {}
    6147        self.failures = {}
    62         self.tests_by_expectation[test_expectations.SKIP] = set()
     48        self.tests_by_expectation[SKIP] = set()
    6349        for expectation in TestExpectations.EXPECTATIONS.values():
    6450            self.tests_by_expectation[expectation] = set()
     
    6652            self.tests_by_timeline[timeline] = expectations.get_tests_with_timeline(timeline)
    6753
    68     def add(self, result, expected):
    69         """Add a TestResult into the appropriate bin.
    70 
    71         Args:
    72           result: TestResult
    73           expected: whether the result was what we expected it to be.
    74         """
    75 
    76         self.tests_by_expectation[result.type].add(result.test_name)
    77         self.results[result.test_name] = result
     54    def add(self, test_result, expected):
     55        self.tests_by_expectation[test_result.type].add(test_result.test_name)
     56        self.results[test_result.test_name] = test_result
    7857        self.remaining -= 1
    79         if len(result.failures):
    80             self.failures[result.test_name] = result.failures
     58        if len(test_result.failures):
     59            self.failures[test_result.test_name] = test_result.failures
    8160        if expected:
    8261            self.expected += 1
    8362        else:
    84             self.unexpected_results[result.test_name] = result
     63            self.unexpected_results[test_result.test_name] = test_result
    8564            self.unexpected += 1
    86             if len(result.failures):
     65            if len(test_result.failures):
    8766                self.unexpected_failures += 1
    88             if result.type == test_expectations.CRASH:
     67            if test_result.type == CRASH:
    8968                self.unexpected_crashes += 1
    90             elif result.type == test_expectations.TIMEOUT:
     69            elif test_result.type == TIMEOUT:
    9170                self.unexpected_timeouts += 1
Note: See TracChangeset for help on using the changeset viewer.