tests: Update test scripts to work with Python 3

Change-Id: I71b1e595765fed9e9f234c9722c33ac5348d4f11
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/15999
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
This commit is contained in:
Andreas Sandberg
2019-01-28 16:53:47 +00:00
parent d63f735663
commit debb5daace
12 changed files with 22 additions and 18 deletions

View File

@@ -209,7 +209,9 @@ test_filename = config
# for ruby configurations, remove the protocol name from the test filename
if re.search('-ruby', test_filename):
test_filename = test_filename.split('-ruby')[0]+'-ruby'
execfile(joinpath(tests_root, 'configs', test_filename + '.py'))
exec(compile( \
open(joinpath(tests_root, 'configs', test_filename + '.py')).read(), \
joinpath(tests_root, 'configs', test_filename + '.py'), 'exec'))
# set default maxtick... script can override
# -1 means run forever
@@ -217,7 +219,9 @@ maxtick = m5.MaxTick
# tweak configuration for specific test
sys.path.append(joinpath(tests_root, category, mode, name))
execfile(joinpath(tests_root, category, mode, name, 'test.py'))
exec(compile( \
open(joinpath(tests_root, category, mode, name, 'test.py')).read(), \
joinpath(tests_root, category, mode, name, 'test.py'), 'exec'))
# Initialize all CPUs in a system
def initCPUs(sys):