summaryrefslogtreecommitdiff
path: root/buildscripts/resmokelib/testing/summary.py
blob: cf3649c3e1627dc3ca6c596d80e2e21d97f32b67 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
"""
Holder for summary information about a test suite.
"""

from __future__ import absolute_import

import collections

Summary = collections.namedtuple(
    "Summary",
    ["num_run", "time_taken", "num_succeeded", "num_skipped", "num_failed", "num_errored"])


def combine(summary1, summary2):
    """
    Returns a summary representing the sum of 'summary1' and 'summary2'.
    """
    args = []
    for i in xrange(len(Summary._fields)):
        args.append(summary1[i] + summary2[i])
    return Summary._make(args)