results.py (11828:36b064696175) results.py (12581:a8f1d31d3492)
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
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
40from abc import ABCMeta, abstractmethod
41import inspect
42import pickle
43import string
44import sys
45
46import xml.etree.cElementTree as ET
47

--- 120 unchanged lines hidden (view full) ---

168 """Output test results as text."""
169
170 def __init__(self, **kwargs):
171 super(Text, self).__init__(**kwargs)
172
173 def dump_suites(self, suites):
174 fout = self.fout
175 for suite in suites:
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:
176 print >> fout, "--- %s ---" % suite.name
178 print("--- %s ---" % suite.name, file=fout)
177
178 for t in suite.results:
179
180 for t in suite.results:
179 print >> fout, "*** %s" % t
181 print("*** %s" % t, file=fout)
180
181 if t and not self.verbose:
182 continue
183
184 if t.message:
182
183 if t and not self.verbose:
184 continue
185
186 if t.message:
185 print >> fout, t.message
187 print(t.message, file=fout)
186
187 if t.stderr:
188
189 if t.stderr:
188 print >> fout, t.stderr
190 print(t.stderr, file=fout)
189 if t.stdout:
191 if t.stdout:
190 print >> fout, t.stdout
192 print(t.stdout, file=fout)
191
192class TextSummary(ResultFormatter):
193 """Output test results as a text summary"""
194
195 def __init__(self, **kwargs):
196 super(TextSummary, self).__init__(**kwargs)
197
198 def test_status(self, suite):

--- 5 unchanged lines hidden (view full) ---

204 return "OK"
205 else:
206 return "FAILED"
207
208 def dump_suites(self, suites):
209 fout = self.fout
210 for suite in suites:
211 status = self.test_status(suite)
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)
212 print >> fout, "%s: %s" % (suite.name, status)
214 print("%s: %s" % (suite.name, status), file=fout)
213
214class JUnit(ResultFormatter):
215 """Output test results as JUnit XML"""
216
217 def __init__(self, translate_names=True, **kwargs):
218 super(JUnit, self).__init__(**kwargs)
219
220 if translate_names:

--- 77 unchanged lines hidden ---
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 ---