Commit 1c512a25 authored by Maxime Perrotin's avatar Maxime Perrotin

Add testcase template to address TAS UK request

parent fc5228f7
include ../shared.mk
ROOT_MODEL=toto.pr
all: test-ada test-llvm
edit:
$(OPENGEODE) toto.pr
test-parse:
$(OPENGEODE) toto.pr --check
test-qgen-parse:
$(TESTQGEN_PARSE) $(ROOT_MODEL)
test-qgen-ada:
$(TESTQGEN_ADA) $(ROOT_MODEL)
test-qgen-c:
$(TESTQGEN_C) $(ROOT_MODEL)
test-qgen-gt-ada:
$(TESTQGEN_GT_ADA) $(ROOT_MODEL)
test-qgen-gt-c:
$(TESTQGEN_GT_C) $(ROOT_MODEL)
test-ada:
mkdir -p src && cd src && ../$(OPENGEODE) ../toto.pr --toAda && \
mono $(ASN1SCC) -Ada -typePrefix asn1Scc -equal ../dataview.asn
mkdir -p obj && cd obj && gnat make -O$(O) ../src/toto.adb
test-c:
$(OPENGEODE) toto.pr --toC
mono $(ASN1SCC) -c -typePrefix asn1Scc -equal dataview.asn
$(CC) -O$(O) -c *.c
test-llvm:
$(OPENGEODE) toto.pr --llvm -O$(O)
$(LLC) *.ll
$(CC) -O$(O) -c *.s
coverage:
coverage run -p $(OPENGEODE) toto.pr --toAda
.PHONY: all edit test-parse test-ada test-llvm coverage
DV DEFINITIONS ::=
BEGIN
MyChoice ::= CHOICE {
foo BOOLEAN,
bar INTEGER (0 .. 255)
}
MyEnum ::= ENUMERATED { foo, bar }
END
system toto;
/* CIF TEXT (810, 226), (304, 292) */
-- Text area for declarations and comments
use dataview comment 'dataview.asn';
signal hello;
/* CIF ENDTEXT */
channel c
from env to toto with hello;
endchannel;
block toto;
signalroute r
from env to toto with hello;
connect c and r;
/* CIF PROCESS (360, 132), (231, 231) */
process toto;
/* CIF TEXT (693, 124), (394, 239) */
-- Model used to demonstrate how to work with enumerated
-- and choice determinants
dcl val MyChoice, det MyEnum;
/* CIF ENDTEXT */
/* CIF START (240, 89), (70, 35) */
START;
/* CIF decision (222, 144), (106, 50) */
decision present (val);
/* CIF ANSWER (195, 214), (70, 24) */
(foo):
/* CIF ANSWER (285, 214), (70, 24) */
(bar):
enddecision;
/* CIF decision (222, 253), (106, 50) */
decision present (val);
/* CIF ANSWER (241, 323), (70, 24) */
else:
enddecision;
/* CIF NEXTSTATE (243, 362), (64, 35) */
NEXTSTATE hop;
/* CIF state (528, 360), (70, 35) */
state hop;
endstate;
endprocess toto;
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