Deleted Added
sdiff udiff text old ( 11976:d1f151ee0e08 ) new ( 12575:16ada03839d9 )
full compact
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
40import argparse
41import sys
42import os
43import pickle
44
45from testing.tests import *
46import testing.results
47

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

121
122def _list_tests(args):
123 for isa, categories, modes in \
124 ( parse_test_filter(f) for f in args.list_filter ):
125
126 for test in get_tests(isa, categories=categories, modes=modes,
127 ruby_protocol=args.ruby_protocol,
128 gpu_isa=args.gpu_isa):
129 print "/".join(test)
130 sys.exit(0)
131
132def _run_tests_args(subparsers):
133 parser = subparsers.add_parser(
134 "run",
135 formatter_class=ParagraphHelpFormatter,
136 help='Run one or more tests',
137 description="Run one or more tests.",

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

170
171 parser.add_argument("--skip-diff-stat", action="store_true",
172 help="Skip stat diffing stage")
173
174 _add_format_args(parser)
175
176def _run_tests(args):
177 if not os.path.isfile(args.gem5) or not os.access(args.gem5, os.X_OK):
178 print >> sys.stderr, \
179 "gem5 binary '%s' not an executable file" % args.gem5
180 sys.exit(2)
181
182 formatter = _create_formatter(args)
183
184 out_base = os.path.abspath(args.directory)
185 if not os.path.exists(out_base):
186 os.mkdir(out_base)
187 tests = []
188 for test_name in args.test:
189 config = ClassicConfig(*test_name.split("/"))
190 out_dir = os.path.join(out_base, "/".join(config))
191 tests.append(
192 ClassicTest(args.gem5, out_dir, config,
193 timeout=args.timeout,
194 skip_diff_stat=args.skip_diff_stat,
195 skip_diff_out=args.skip_diff_out))
196
197 all_results = []
198 print "Running %i tests" % len(tests)
199 for testno, test in enumerate(tests):
200 print "%i: Running '%s'..." % (testno, test)
201
202 all_results.append(test.run())
203
204 formatter.dump_suites(all_results)
205
206def _show_args(subparsers):
207 parser = subparsers.add_parser(
208 "show",

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

244def _show(args):
245 def _load(f):
246 # Load the pickled status file, sometimes e.g., when a
247 # regression is still running the status file might be
248 # incomplete.
249 try:
250 return pickle.load(f)
251 except EOFError:
252 print >> sys.stderr, 'Could not read file %s' % f.name
253 return []
254
255 formatter = _create_formatter(args)
256 suites = sum([ _load(f) for f in args.result ], [])
257 formatter.dump_suites(suites)
258
259def _test_args(subparsers):
260 parser = subparsers.add_parser(

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

282
283 parser.add_argument("result", type=argparse.FileType("rb"), nargs="*",
284 help="Pickled test results")
285
286def _test(args):
287 try:
288 suites = sum([ pickle.load(f) for f in args.result ], [])
289 except EOFError:
290 print >> sys.stderr, 'Could not read all files'
291 sys.exit(2)
292
293 if all(s for s in suites):
294 sys.exit(0)
295 elif any([ s.failed_run() for s in suites ]):
296 sys.exit(2)
297 elif any([ s.changed() for s in suites ]):
298 sys.exit(3)

--- 48 unchanged lines hidden ---