summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorNikos Nikoleris <nikos.nikoleris@arm.com>2016-09-01 17:27:20 +0100
committerAndreas Sandberg <andreas.sandberg@arm.com>2017-03-16 13:51:37 +0000
commite2805f825a7983fdc1cf802ad2935b89e4d7ec8f (patch)
tree87fc34181b13ed34e0b1b804ac50c606a4f82fac /tests
parent083cd6da788ce3d89a959aa2a847a622e0385afa (diff)
downloadgem5-e2805f825a7983fdc1cf802ad2935b89e4d7ec8f.tar.xz
tests: Warn not fail when reading invalid pickle status files
With this change, the test script will output a warning when it reads an incomplete (e.g., when a regression is still running) or corrupt status file instead of throwing an exception. When the scipt is used to show the results the corrupt file is skipped; when it is used to test if all regressions run successfully it will return an error value (2). Change-Id: Ie7d9b457b200e3abc7ae6238e3efbf3d18cf4297 Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com> Reviewed-on: https://gem5-review.googlesource.com/2320 Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Maintainer: Jason Lowe-Power <jason@lowepower.com>
Diffstat (limited to 'tests')
-rwxr-xr-xtests/tests.py18
1 files changed, 16 insertions, 2 deletions
diff --git a/tests/tests.py b/tests/tests.py
index 3f6ed0a7a..bb6486679 100755
--- a/tests/tests.py
+++ b/tests/tests.py
@@ -242,8 +242,18 @@ def _show_args(subparsers):
help="Pickled test results")
def _show(args):
+ def _load(f):
+ # Load the pickled status file, sometimes e.g., when a
+ # regression is still running the status file might be
+ # incomplete.
+ try:
+ return pickle.load(f)
+ except EOFError:
+ print >> sys.stderr, 'Could not read file %s' % f.name
+ return []
+
formatter = _create_formatter(args)
- suites = sum([ pickle.load(f) for f in args.result ], [])
+ suites = sum([ _load(f) for f in args.result ], [])
formatter.dump_suites(suites)
def _test_args(subparsers):
@@ -276,7 +286,11 @@ def _test_args(subparsers):
help="Pickled test results")
def _test(args):
- suites = sum([ pickle.load(f) for f in args.result ], [])
+ try:
+ suites = sum([ pickle.load(f) for f in args.result ], [])
+ except EOFError:
+ print >> sys.stderr, 'Could not read all files'
+ sys.exit(2)
if all(s for s in suites):
sys.exit(0)