summaryrefslogtreecommitdiff
path: root/tests/run.py
diff options
context:
space:
mode:
authorAndreas Sandberg <andreas.sandberg@arm.com>2016-05-09 11:32:07 +0100
committerAndreas Sandberg <andreas.sandberg@arm.com>2016-05-09 11:32:07 +0100
commit8b412fcfd6e7a97e4fdf184bf177e2418f2a9705 (patch)
tree719eb032ed7b3feef8e816f66e47f2ba66a4a27b /tests/run.py
parent2ae8b365c110e707cb94aec54cb9b1c29f863cb1 (diff)
downloadgem5-8b412fcfd6e7a97e4fdf184bf177e2418f2a9705.tar.xz
tests: Enable test running outside of gem5's source tree
The learning gem5 scripts currently assumes that the current working directory is the root of gem5's source tree. This isn't necessarily the case when running the tests using gem5's new test runner. Change-Id: Ief569bbe77b1b3e2b0fb0e6c575fb0705bbba9b3 Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com> Reviewed-by: Curtis Dunham <curtis.dunham@arm.com>
Diffstat (limited to 'tests/run.py')
-rw-r--r--tests/run.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/run.py b/tests/run.py
index 461813559..ff5be230d 100644
--- a/tests/run.py
+++ b/tests/run.py
@@ -171,6 +171,10 @@ def inputpath(app, file=None):
file = app
return joinpath(test_progs, app, 'input', file)
+def srcpath(path):
+ """Path to file in gem5's source tree"""
+ return joinpath(os.path.dirname(__file__), "..", path)
+
# build configuration
sys.path.append(joinpath(tests_root, 'configs'))
test_filename = config