tests: Add a helper to run external scripts
authorAndreas Sandberg <andreas.sandberg@arm.com>
Mon, 28 Jan 2019 16:50:35 +0000 (16:50 +0000)
committerAndreas Sandberg <andreas.sandberg@arm.com>
Thu, 31 Jan 2019 17:31:54 +0000 (17:31 +0000)
commit2d1723acd31e1c935341e5d27307804039ede56d
treea24ab22629fa5c17d71da601a308dd89d544648d
parentcc5981597573146fe32e0d2abf83b17dcbb325cb
tests: Add a helper to run external scripts

Some tests are really just a wrapper around a test script in
configs/. Add a helper method to wrap these scripts to make sure they
are executed in a consistent environment. This wrapper sets up a
global environment that is identical to that created by main() when it
executes the script. Unlike the old wrappers, it updates the module
search path to make relative imports work correctly in Python 3.

Change-Id: Ie9f81ec4e2689aa8cf5ecb9fc8025d3534b5c9ca
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/15976
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
tests/configs/dram-lowp.py
tests/configs/learning-gem5-p1-simple.py
tests/configs/learning-gem5-p1-two-level.py
tests/configs/memcheck.py
tests/run.py