diff --git a/scripts/exec_wrapper.py b/scripts/exec_wrapper.py index 3e85e538..fdab3fd7 100755 --- a/scripts/exec_wrapper.py +++ b/scripts/exec_wrapper.py @@ -19,7 +19,7 @@ def exec_wrapper_init(): # don't change: name is used to test if script is runni sys.path[0] = 'test' else: from test.overlay import overlay_setup - sys.path[0] = overlay_setup() + sys.path[0] = overlay_setup(repo_root=os.getcwd()) # assume we're in the repo root os.environ['MMGEN_TRACEBACK'] = '1' os.environ['PYTHONPATH'] = '.' diff --git a/test/gentest.py b/test/gentest.py index b00df354..aa7a5f8f 100755 --- a/test/gentest.py +++ b/test/gentest.py @@ -24,7 +24,7 @@ import sys,os from include.tests_header import repo_root from test.overlay import overlay_setup -sys.path.insert(0,overlay_setup()) +sys.path.insert(0,overlay_setup(repo_root)) # Import these _after_ local path's been added to sys.path from mmgen.common import * diff --git a/test/objtest.py b/test/objtest.py index 68fb49c3..9cb943d8 100755 --- a/test/objtest.py +++ b/test/objtest.py @@ -24,7 +24,7 @@ import sys,os,re from include.tests_header import repo_root from test.overlay import overlay_setup -sys.path.insert(0,overlay_setup()) +sys.path.insert(0,overlay_setup(repo_root)) os.environ['MMGEN_TEST_SUITE'] = '1' diff --git a/test/overlay/__init__.py b/test/overlay/__init__.py index fb720833..72d5dfcd 100644 --- a/test/overlay/__init__.py +++ b/test/overlay/__init__.py @@ -1,6 +1,6 @@ import sys,os -def overlay_setup(): +def overlay_setup(repo_root): def process_srcdir(d): srcdir = os.path.join(repo_root,*d.split('.')) @@ -23,7 +23,6 @@ def overlay_setup(): os.path.join(srcdir,fn), os.path.join(destdir,link_fn) ) - repo_root = os.path.dirname(os.path.abspath(os.path.dirname(sys.argv[0]))) overlay_dir = os.path.join(repo_root,'test','overlay','tree') fakemod_dir = os.path.join(repo_root,'test','overlay','fakemods') fakemods = os.listdir(fakemod_dir) diff --git a/test/test.py b/test/test.py index ca1bb114..21d17d50 100755 --- a/test/test.py +++ b/test/test.py @@ -74,7 +74,7 @@ import sys,os,time from include.tests_header import repo_root from test.overlay import overlay_setup -overlay_dir = overlay_setup() +overlay_dir = overlay_setup(repo_root) sys.path.insert(0,overlay_dir) try: os.unlink(os.path.join(repo_root,'my.err')) diff --git a/test/tooltest.py b/test/tooltest.py index de571b59..a4e2e591 100755 --- a/test/tooltest.py +++ b/test/tooltest.py @@ -25,7 +25,7 @@ from subprocess import run,PIPE from include.tests_header import repo_root from test.overlay import overlay_setup -sys.path.insert(0,overlay_setup()) +sys.path.insert(0,overlay_setup(repo_root)) from mmgen.common import * from test.include.common import * diff --git a/test/tooltest2.py b/test/tooltest2.py index bd183c3c..78861d51 100755 --- a/test/tooltest2.py +++ b/test/tooltest2.py @@ -29,7 +29,7 @@ from decimal import Decimal from include.tests_header import repo_root from test.overlay import overlay_setup -sys.path.insert(0,overlay_setup()) +sys.path.insert(0,overlay_setup(repo_root)) from mmgen.common import * from test.include.common import *