Commit 65a2f3dc authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Add test case

parent b284084e
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-uniq.asn -typePrefix asn1Scc -equal
$(GNATMAKE) -O$(O) -c *.adb
$(GNATBIND) -n og.ali
test-c:
$(OPENGEODE) og.pr --toC
$(ASN1SCC) -c dataview-uniq.asn -typePrefix asn1Scc -equal
$(CC) -O$(O) -c *.c
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
MyChoice ::= CHOICE {
a CHOICE {
b CHOICE {
c BOOLEAN,
d BOOLEAN
},
e BOOLEAN
},
f BOOLEAN
}
Some-Thing ::= MyInteger
MyInteger ::= INTEGER (0..255)
My-OctStr ::= OCTET STRING (SIZE (0..20))
SeqOf ::= SEQUENCE (SIZE(0..100)) OF MyInteger
Type1 ::= INTEGER(0..1)
Type2 ::= BOOLEAN
Toto ::= SEQUENCE { elem-1 Type1, elem-2 Type2 }
SeqBool ::= SEQUENCE(SIZE(1..5)) OF BOOLEAN
Enum ::= ENUMERATED {enum1}
default-seqof SeqOf ::= {4,7,9}
default-str My-OctStr ::= 'DEADBEEF'H
END
SYSTEM car;
/* CIF TEXT (159, 221), (356, 248) */
-- Text area for declarations and comments
use dv comment 'dataview-uniq.asn';
--use dv2 comment 'dataview2.asn';
signal dd(Type2);
signal we(Some_Thing);
procedure hehe;
fpar in/out a_param Type2;
external;
/* CIF ENDTEXT */
CHANNEL c
FROM ENV TO car WITH dd;
FROM car TO ENV WITH we;
ENDCHANNEL;
BLOCK car;
SIGNALROUTE r
FROM ENV TO car WITH dd;
FROM car TO ENV WITH we;
CONNECT c AND r;
/* CIF PROCESS (225, 49), (150, 75) */
PROCESS car;
STATE AGGREGATION nominal;
SUBSTRUCTURE
out (battery_discharged);
STATE battery;
SUBSTRUCTURE
out (battery_discharged);
/* CIF TEXT (23, 47), (356, 39) */
dcl charge myinteger := 100;
/* CIF ENDTEXT */
/* CIF START (174, 147), (70, 35) */
START;
/* CIF NEXTSTATE (152, 197), (114, 35) */
NEXTSTATE discharge;
/* CIF STATE (152, 197), (114, 35) */
STATE discharge;
/* CIF PROVIDED (148, 252), (121, 35) */
PROVIDED charge = 0;
/* CIF RETURN (191, 302), (35, 35) */
RETURN battery_discharged;
ENDSTATE;
ENDSUBSTRUCTURE;
/* CIF STATE (219, 274), (98, 35) */
STATE battery;
/* CIF CONNECT (268, 329), (0, 35) */
CONNECT battery_discharged;
/* CIF RETURN (250, 379), (35, 35) */
RETURN battery_discharged;
ENDSTATE;
ENDSUBSTRUCTURE;
/* CIF START (155, 216), (70, 35) */
START;
/* CIF NEXTSTATE (140, 266), (100, 35) */
NEXTSTATE nominal;
/* CIF STATE (614, 272), (95, 35) */
STATE backup;
ENDSTATE;
/* CIF STATE (282, 264), (100, 35) */
STATE nominal;
/* CIF CONNECT (332, 319), (0, 35) */
CONNECT battery_discharged;
/* CIF NEXTSTATE (284, 369), (95, 35) */
NEXTSTATE backup;
ENDSTATE;
ENDPROCESS car;
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