From 8b412fcfd6e7a97e4fdf184bf177e2418f2a9705 Mon Sep 17 00:00:00 2001 From: Andreas Sandberg Date: Mon, 9 May 2016 11:32:07 +0100 Subject: 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 Reviewed-by: Curtis Dunham --- tests/configs/learning-gem5-p1-simple.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'tests/configs/learning-gem5-p1-simple.py') diff --git a/tests/configs/learning-gem5-p1-simple.py b/tests/configs/learning-gem5-p1-simple.py index 850abccf1..9ad70854e 100644 --- a/tests/configs/learning-gem5-p1-simple.py +++ b/tests/configs/learning-gem5-p1-simple.py @@ -35,5 +35,10 @@ root = None 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__), "../")) + # Execute the script we are wrapping - execfile('configs/learning_gem5/part1/simple.py') + execfile(srcpath('configs/learning_gem5/part1/simple.py')) -- cgit v1.2.3