summaryrefslogtreecommitdiff
path: root/tests/configs/learning-gem5-p1-two-level.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/configs/learning-gem5-p1-two-level.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/configs/learning-gem5-p1-two-level.py')
-rw-r--r--tests/configs/learning-gem5-p1-two-level.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/configs/learning-gem5-p1-two-level.py b/tests/configs/learning-gem5-p1-two-level.py
index 1a1f8a0b9..8101de318 100644
--- a/tests/configs/learning-gem5-p1-two-level.py
+++ b/tests/configs/learning-gem5-p1-two-level.py
@@ -37,6 +37,12 @@ import m5
def run_test(root):
# Called from tests/run.py
+
+ # Set the working directory in case we are executing from
+ # outside gem5's source tree
+ import os
+ os.chdir(os.path.join(os.path.dirname(__file__), "../"))
+
# Add paths that we need
m5.util.addToPath('../configs/learning_gem5/part1')
m5.util.addToPath('../configs/common')
@@ -49,4 +55,4 @@ def run_test(root):
# For instance, sys.argv.append('--l2_size=512kB')
# Execute the script we are wrapping
- execfile('configs/learning_gem5/part1/two_level.py')
+ execfile(srcpath('configs/learning_gem5/part1/two_level.py'))