Commit 4c6e51dc authored by Thanassis Tsiodras's avatar Thanassis Tsiodras
Browse files

Apparently, relative imports and coverage don't mix well.

parent f514ae18
......@@ -224,7 +224,6 @@ types). This used to cover Dumpable C/Ada Types and OG headers.'''
def main():
sys.path.append(os.path.abspath(os.path.dirname(sys.argv[0])))
sys.path.append(os.path.abspath(os.path.dirname(sys.argv[0]) + os.sep + '..'))
if sys.argv.count("-o") != 0:
idx = sys.argv.index("-o")
try:
......@@ -362,10 +361,10 @@ def main():
if modelingLanguage.lower() in ["gui_ri", "gui_pi", "vhdl", "rhapsody"]:
modelingLanguage = "C"
backendFilename = modelingLanguage.lower() + "_B_mapper.py"
backendFilename = "." + modelingLanguage.lower() + "_B_mapper.py"
inform("Parsing %s...", backendFilename)
try:
backend = import_module(backendFilename[:-3])
backend = import_module(backendFilename[:-3], 'aadl2glueC')
if backendFilename[:-3] not in loadedBackends:
loadedBackends[backendFilename[:-3]] = 1
if commonPy.configMT.verbose:
......@@ -467,10 +466,10 @@ def main():
def mappers(lang):
if lang.lower() in ["gui_pi", "gui_ri"]:
return [import_module("python_B_mapper", "aadl2glueC"),
import_module("pyside_B_mapper", "aadl2glueC")]
return [import_module(".python_B_mapper", "aadl2glueC"),
import_module(".pyside_B_mapper", "aadl2glueC")]
elif lang.lower() == "vhdl": # pragma: no cover
return [import_module("vhdl_B_mapper", "aadl2glueC")] # pragma: no cover
return [import_module(".vhdl_B_mapper", "aadl2glueC")] # pragma: no cover
for si in [x for x in SystemsAndImplementations if x[2] is not None and x[2].lower() in ["gui_ri", "gui_pi", "vhdl"]]:
# We do, start the work
......
......@@ -64,7 +64,6 @@ def usage(argsToTools):
def main():
sys.path.append(os.path.abspath(os.path.dirname(sys.argv[0])))
sys.path.append(os.path.abspath(os.path.dirname(sys.argv[0]) + os.sep + '..'))
sys.path.append('commonPy')
argsToTools = {
......@@ -160,10 +159,10 @@ def main():
# For each ASN.1 grammar file referenced in the system level description
for arg, modelingLanguage in argsToTools.iteritems():
if locals()[arg]:
backendFilename = modelingLanguage.lower() + "_A_mapper.py"
backendFilename = "." + modelingLanguage.lower() + "_A_mapper.py"
inform("Parsing %s...", backendFilename)
try:
backend = import_module(backendFilename[:-3])
backend = import_module(backendFilename[:-3], 'asn2dataModel')
if backendFilename[:-3] not in loadedBackends:
loadedBackends[backendFilename[:-3]] = 1
if commonPy.configMT.verbose:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment