mirror of https://github.com/VLSIDA/OpenRAM.git
Fix unit tests running on docker with a hack for now
This commit is contained in:
parent
2e7206343e
commit
316f75861b
|
|
@ -10,6 +10,21 @@ import sys, os, glob
|
||||||
import pdb
|
import pdb
|
||||||
import traceback
|
import traceback
|
||||||
import time
|
import time
|
||||||
|
# FIXME: This is a hack for unit tests running on docker.
|
||||||
|
try:
|
||||||
|
import openram
|
||||||
|
except:
|
||||||
|
# If openram library isn't found as a python package,
|
||||||
|
# import it from the $OPENRAM_HOME path.
|
||||||
|
import importlib.util
|
||||||
|
OPENRAM_HOME = os.getenv("OPENRAM_HOME")
|
||||||
|
# Import using spec since the directory can be named something
|
||||||
|
# other than "openram".
|
||||||
|
spec = importlib.util.spec_from_file_location("openram", "{}/../__init__.py".format(OPENRAM_HOME))
|
||||||
|
module = importlib.util.module_from_spec(spec)
|
||||||
|
sys.modules["openram"] = module
|
||||||
|
spec.loader.exec_module(module)
|
||||||
|
import openram
|
||||||
from openram import debug
|
from openram import debug
|
||||||
from openram import OPTS
|
from openram import OPTS
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue