overlay_setup(): use passed value of repo_root

This commit is contained in:
The MMGen Project 2021-10-05 11:57:34 +00:00
commit 554670b713
Signed by: mmgen
GPG key ID: 3F8B1861E32B7DA2
7 changed files with 7 additions and 8 deletions

View file

@ -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'] = '.'

View file

@ -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 *

View file

@ -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'

View file

@ -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)

View file

@ -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'))

View file

@ -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 *

View file

@ -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 *