Commit 72aafa41 authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Add test case with optional field in ASN.1

parent 395a3e88
include ../shared.mk
all: test-ada test-llvm
edit:
$(OPENGEODE) og.pr
test-parse:
$(OPENGEODE) og.pr --check
test-ada:
$(OPENGEODE) og.pr --toAda
$(ASN1SCC) -Ada dataview.asn -typePrefix asn1Scc -equal
$(GNATMAKE) -O$(O) -c *.adb
$(GNATBIND) -n og.ali
test-c:
$(OPENGEODE) og.pr --toC
$(ASN1SCC) -c dataview.asn -typePrefix asn1Scc -equal
$(CC) -O$(O) -c *.c
test-python:
$(OPENGEODE) og.pr --shared
$(ASN1SCC) -Ada dataview.asn -typePrefix asn1Scc -equal
$(ASN1SCC) -c dataview.asn -typePrefix asn1Scc -equal
$(GNATMAKE) -O$(O) -gnat2012 -fPIC -c *.adb
$(GNATBIND) -n -Llibog og
$(GNATMAKE) -c -fPIC -gnat2012 b~og.adb
$(CC) -shared -fPIC -o libog.so b~og.o og.o taste_dataview.o adaasn1rtl.o -lgnat
python -c "from ctypes import *; test=CDLL('./libog.so'); test.liboginit()"
simu:
$(OPENGEODE) og.pr --shared
./og_simu.sh
test-llvm:
$(OPENGEODE) og.pr --llvm -O$(O)
$(LLC) *.ll
$(CC) -O$(O) -c *.s
coverage:
coverage run -p $(OPENGEODE) og.pr --toAda
.PHONY: all edit test-parse test-ada test-llvm coverage
TASTE-Dataview DEFINITIONS ::=
BEGIN
Seq ::= SEQUENCE {
a BOOLEAN OPTIONAL
}
--SeqPresent ::= Seq (WITH COMPONENTS {a PRESENT})
--SeqAbsent ::= Seq (WITH COMPONENTS {a ABSENT})
END
SYSTEM og;
/* CIF TEXT (159, 221), (289, 188) */
-- Text area for declarations and comments
use dv comment 'dataview.asn';
signal run;
signal we;
/* CIF ENDTEXT */
CHANNEL c
FROM ENV TO og WITH run;
FROM og TO ENV WITH we;
ENDCHANNEL;
BLOCK og;
SIGNALROUTE r
FROM ENV TO og WITH run;
FROM og TO ENV WITH we;
CONNECT c AND r;
/* CIF PROCESS (225, 50), (150, 75) */
PROCESS og;
/* CIF TEXT (150, 75), (396, 136) */
dcl s1 Seq := { a TRUE };
dcl s2 Seq;
/* CIF ENDTEXT */
/* CIF START (97, 224), (70, 35) */
START;
/* CIF TASK (66, 274), (130, 35) */
TASK s2 := { a FALSE};
/* CIF TASK (74, 324), (114, 35) */
TASK s2!a := TRUE;
/* CIF NEXTSTATE (97, 374), (70, 35) */
NEXTSTATE wait;
/* CIF STATE (97, 374), (70, 35) */
STATE wait;
/* CIF INPUT (89, 429), (84, 35) */
INPUT run;
/* CIF NEXTSTATE (87, 479), (88, 35) */
NEXTSTATE wait;
ENDSTATE;
ENDPROCESS og;
ENDBLOCK;
ENDSYSTEM;
\ No newline at end of file
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