1#!/usr/bin/env python2 2# 3# Copyright (c) 2016 ARM Limited 4# All rights reserved 5# 6# The license below extends only to copyright in the software and shall 7# not be construed as granting a license to any other intellectual 8# property including but not limited to intellectual property relating --- 23 unchanged lines hidden (view full) --- 32# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 33# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 34# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 35# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 36# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 37# 38# Authors: Andreas Sandberg 39 |
40from __future__ import print_function 41 |
42from abc import ABCMeta, abstractmethod 43import inspect 44import pickle 45import string 46import sys 47 48import xml.etree.cElementTree as ET 49 --- 120 unchanged lines hidden (view full) --- 170 """Output test results as text.""" 171 172 def __init__(self, **kwargs): 173 super(Text, self).__init__(**kwargs) 174 175 def dump_suites(self, suites): 176 fout = self.fout 177 for suite in suites: |
178 print("--- %s ---" % suite.name, file=fout) |
179 180 for t in suite.results: |
181 print("*** %s" % t, file=fout) |
182 183 if t and not self.verbose: 184 continue 185 186 if t.message: |
187 print(t.message, file=fout) |
188 189 if t.stderr: |
190 print(t.stderr, file=fout) |
191 if t.stdout: |
192 print(t.stdout, file=fout) |
193 194class TextSummary(ResultFormatter): 195 """Output test results as a text summary""" 196 197 def __init__(self, **kwargs): 198 super(TextSummary, self).__init__(**kwargs) 199 200 def test_status(self, suite): --- 5 unchanged lines hidden (view full) --- 206 return "OK" 207 else: 208 return "FAILED" 209 210 def dump_suites(self, suites): 211 fout = self.fout 212 for suite in suites: 213 status = self.test_status(suite) |
214 print("%s: %s" % (suite.name, status), file=fout) |
215 216class JUnit(ResultFormatter): 217 """Output test results as JUnit XML""" 218 219 def __init__(self, translate_names=True, **kwargs): 220 super(JUnit, self).__init__(**kwargs) 221 222 if translate_names: --- 77 unchanged lines hidden --- |