Commit ef456dcc authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Add test case with joint SDL/Property files

parent 5a87d0eb
include ../shared.mk
all: test-ada test-llvm
clean:
rm -rf build
edit:
$(OPENGEODE) orchestrator.pr
test-parse:
$(OPENGEODE) orchestrator.pr --check
test-ada:
mkdir -p build && cp *.pr test.adb *.asn properties build && cd build && \
../../../../opengeode/opengeode.py orchestrator.pr --shared && \
$(ASN1SCC) -Ada dataview-uniq.asn -typePrefix asn1Scc -equal && \
taste-properties -d -s properties orchestrator.pr && \
gnat make test && ./test
simu: test-ada
cd build && make -f Makefile.properties && \
./orchestrator_simu.sh
test-c:
echo 'No test for C'
test-llvm: orchestrator.o
coverage:
coverage run -p $(OPENGEODE) orchestrator.pr system_structure.pr --toAda
.PHONY: all edit test-parse test-ada test-c simu test-llvm coverage
TASTE-BasicTypes DEFINITIONS ::=
BEGIN
T-Int ::= INTEGER (0..4)
T-SeqOf ::= SEQUENCE (SIZE (1..4)) OF T-Int
END
SYSTEM orchestrator;
/* CIF TEXT (880, 108), (315, 128) */
use datatypes comment 'dataview-uniq.asn';
signal pulse (t_int);
signal arr (t_seqof);
signal paramless;
/* CIF ENDTEXT */
CHANNEL c
FROM ENV TO orchestrator WITH pulse,
arr,
paramless;
ENDCHANNEL;
BLOCK orchestrator;
SIGNALROUTE r
FROM ENV TO orchestrator WITH pulse,
arr,
paramless;
CONNECT c AND r;
/* CIF PROCESS (465, 158), (265, 176) */
PROCESS orchestrator;
/* CIF TEXT (920, 71), (268, 140) */
-- Text area for declarations and comments
dcl t t_int := 0;
dcl counter t_int := 0;
dcl seqof t_seqof;
/* CIF ENDTEXT */
/* CIF START (444, 48), (70, 34) */
START;
/* CIF PROCEDURECALL (373, 102), (211, 35) */
CALL writeln( 'Orchestrator startup');
/* CIF NEXTSTATE (445, 152), (67, 35) */
NEXTSTATE wait;
/* CIF STATE (693, 94), (70, 35) */
STATE running;
/* CIF INPUT (693, 149), (70, 35) */
INPUT *;
/* CIF NEXTSTATE (693, 204), (70, 35) */
NEXTSTATE wait;
ENDSTATE;
/* CIF STATE (445, 152), (67, 35) */
STATE wait;
/* CIF INPUT (190, 207), (70, 35) */
INPUT pulse(t);
/* CIF DECISION (190, 262), (70, 50) */
DECISION t;
/* CIF ANSWER (145, 332), (70, 23) */
(0):
/* CIF NEXTSTATE (145, 375), (70, 35) */
NEXTSTATE wait;
/* CIF ANSWER (235, 332), (70, 23) */
else:
/* CIF NEXTSTATE (235, 375), (70, 35) */
NEXTSTATE running;
ENDDECISION;
/* CIF INPUT (373, 207), (83, 35) */
INPUT arr(seqof);
/* CIF TASK (314, 262), (202, 35) */
TASK counter := (counter + 1) mod 4;
/* CIF DECISION (355, 317), (121, 50) */
DECISION seqof = {4,4,4,4}
and counter = 0;
/* CIF ANSWER (336, 387), (70, 23) */
(true):
/* CIF ANSWER (426, 387), (70, 23) */
(false):
/* CIF TASK (409, 430), (103, 35) */
TASK seqof(1) := 1;
ENDDECISION;
/* CIF NEXTSTATE (380, 480), (70, 35) */
NEXTSTATE -;
/* CIF INPUT (532, 207), (83, 35) */
INPUT paramless;
/* CIF TASK (525, 262), (97, 38) */
TASK counter := 0,
t := 1;
/* CIF NEXTSTATE (539, 320), (70, 35) */
NEXTSTATE running;
ENDSTATE;
ENDPROCESS orchestrator;
ENDBLOCK;
ENDSYSTEM;
\ No newline at end of file
stop if seqof = { 4,4,4,4 } and state = wait;
with orchestrator;
with orchestrator_stop_conditions;
with ada.text_io;
use ada.text_io;
procedure test is
begin
put_line("hello");
orchestrator.startup;
end;
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