Commit 6ca54a82 authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Added test case to validate advanced constructs

parent b3055210
include ../shared.mk
all: test-ada test-llvm
edit:
$(OPENGEODE) orchestrator.pr system_structure.pr
test-parse:
$(OPENGEODE) orchestrator.pr system_structure.pr --check
test-ada: orchestrator.ali dataview-uniq.o | test_ada.o
$(GNATBIND) -n orchestrator.ali
$(GNATLINK) -o test_ada test_ada.o orchestrator.ali -lgnat
./test_ada
test-llvm: orchestrator.o
coverage:
coverage run -p $(OPENGEODE) orchestrator.pr system_structure.pr --toAda
.PHONY: all edit test-parse test-ada test-llvm coverage
TASTE-BasicTypes DEFINITIONS ::=
BEGIN
TASTE-Peek-id ::= INTEGER (0..4294967295)
TASTE-Peek-id-list ::= SEQUENCE (SIZE (1..10)) OF TASTE-Peek-id
VariableString ::= OCTET STRING (SIZE (1..10))
FixedString ::= OCTET STRING (SIZE (5))
END
/* CIF PROCESS (295, 56), (150, 75) */
PROCESS orchestrator
/* CIF COMMENT (405, 192), (71, 35) */
COMMENT 'Hello';
/* CIF TEXT (89, 94), (293, 200) */
dcl seq tastE_Peek_id_list;
dcl fixed FixedString := 'Hello';
dcl variable VariableString := 'Hello';
/* CIF ENDTEXT */
/* CIF START (428, 223), (100, 45) */
START;
/* CIF TASK (415, 283), (126, 38) */
TASK fixed := 'hello';
/* CIF TASK (403, 336), (149, 35) */
TASK variable := 'HELLO';
/* CIF PROCEDURECALL (390, 386), (176, 35) */
CALL writeln(variable // '!!!');
/* CIF PROCEDURECALL (342, 436), (272, 35) */
CALL writeln(variable // variable // variable);
/* CIF TASK (432, 486), (91, 35) */
TASK seq := {1};
/* CIF TASK (401, 536), (153, 35) */
TASK seq := {1} // {2} // {3};
/* CIF TASK (392, 586), (172, 35) */
TASK seq := seq // {2} // {1};
/* CIF NEXTSTATE (419, 636), (118, 50) */
NEXTSTATE Wait_for_GUI;
/* CIF STATE (423, 163), (118, 50) */
STATE Wait_for_GUI;
ENDSTATE;
ENDPROCESS orchestrator;
\ No newline at end of file
/* CIF Keep Specific Geode ASNFilename 'dataview-uniq.asn' */
USE Datamodel;
SYSTEM orchestrator;
SIGNAL pulse;
SIGNAL telemetry;
CHANNEL c
FROM ENV TO orchestrator WITH pulse;
FROM orchestrator TO ENV WITH telemetry;
ENDCHANNEL;
BLOCK orchestrator;
SIGNALROUTE r
FROM ENV TO orchestrator WITH pulse;
FROM orchestrator TO ENV WITH telemetry;
CONNECT c and r;
PROCESS orchestrator REFERENCED;
ENDBLOCK;
ENDSYSTEM;
#include <math.h>
#include <stdio.h>
#include "dataview-uniq.h"
extern void adainit();
void orchestrator_RI_telemetry(void *_){}
void orchestrator_RI_S_SET_GNC_LV_SIM_CONTEXT_FOR_NEXT_MAJOR_CYCLE(void *_){}
void orchestrator_RI_Scheduler(void *_){}
void orchestrator_RI_VESAT_Simulation_Step(void *_){}
void orchestrator_RI_plot(void *_) {}
void orchestrator_RI_S_JUMP_TO_NEXT_MAJOR_CYCLE() {}
void orchestrator_RI_S_GET_GNC_LV_SIM_INPUTS_FOR_NEXT_MAJOR_CYCLE(void *_){}
int main()
{
printf("[C Code] Running test\n");
adainit();
return 0;
}
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