Commit bd70835a authored by Daniel Tuulik's avatar Daniel Tuulik Committed by Daniel Tuulik

Generate ASN1 types from multiple files

If there was more then one .asn file it was ignored in QGen tests before.
Also generate ASN1 types for C in the Ada test if there is a main file
specified (in C).
parent b9f75914
......@@ -62,6 +62,7 @@ def run_test(op):
gentypes = False
lang=''
asnlang=''
asn_path=''
if op.rule == 'test-qgen-parse':
lang = 'xmi_ada'
......@@ -109,10 +110,10 @@ def run_test(op):
if not gentypes:
asn_files = glob.glob ('*.asn')
asn_path = asn_files[0] if asn_files else None
if asn_path and os.path.isfile(asn_path):
if asn_files:
asn_call = ['asn1.exe', "-equal", '-o', outfolder, asnlang,
'--type-prefix', 'asn1Scc', asn_path]
'--type-prefix', 'asn1Scc'] + asn_files
p0 = subprocess.Popen(asn_call,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
......@@ -122,6 +123,18 @@ def run_test(op):
if errcode != 0:
return (errcode, stdout, stderr, op.root_model, op.rule)
if op.rule == 'test-qgen-ada' and os.path.isfile ("test_qgen_ada.c"):
asn_call = ['asn1.exe', "-equal", '-o', outfolder, "-c",
'--type-prefix', 'asn1Scc'] + asn_files
print (asn_call)
p0 = subprocess.Popen(asn_call,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
stdout, stderr = p0.communicate()
errcode = p0.wait()
if errcode != 0:
return (errcode, stdout, stderr, op.root_model, op.rule)
if lang in ('ada', 'c'):
errcode, stdout, stderr = _compile (lang, outfolder)
......
Markdown is supported
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