From: Gabe Black Date: Wed, 16 Jan 2019 22:58:11 +0000 (-0800) Subject: tests: Fix tests/main.py so it can be run from anywhere. X-Git-Tag: v19.0.0.0~1253 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5dda7fb959682f9e051a12de15b982f03adbc1fb;p=gem5.git tests: Fix tests/main.py so it can be run from anywhere. tests/main.py was trying to find paths relative to itself using the string __name__ (which was __main__) when it should have been using the string __file__ which holds the name of the file being executed. Change-Id: I5ff4c42fc7d8b75ff6b96c3cde61baf731d84738 Reviewed-on: https://gem5-review.googlesource.com/c/15675 Reviewed-by: Jason Lowe-Power Maintainer: Jason Lowe-Power --- diff --git a/tests/main.py b/tests/main.py index 509724ed7..779445d81 100755 --- a/tests/main.py +++ b/tests/main.py @@ -10,7 +10,7 @@ from __future__ import print_function import sys import os -base_dir = os.path.dirname(os.path.abspath(__name__)) +base_dir = os.path.dirname(os.path.abspath(__file__)) ext_path = os.path.join(base_dir, os.pardir, 'ext') sys.path.insert(0, base_dir)