Commit c99d9bf4 authored by dbarbera's avatar dbarbera
Browse files

Added simple test case

parent 58a65ea5
#!/usr/bin/env python
# ASN.1 Data model
asn1Files = []
asn1Modules = []
exportedTypes = {}
exportedVariables = {}
importedModules = {}
types = {}
asn1Files.append("./dataview-uniq.asn")
asn1Modules.append("TASTE-Dataview")
exportedTypes["TASTE-Dataview"] = ["Number"]
exportedVariables["TASTE-Dataview"] = []
importedModules["TASTE-Dataview"] = []
types["Number"] = type("Number", (object,), {
"Line": 4, "CharPositionInLine": 0, "type": type("Number_type", (object,), {
"Line": 4, "CharPositionInLine": 14, "kind": "IntegerType", "Min": "0", "Max": "255"
})
})
all: compile
generate-ada:
../../../opengeode.py adder.pr system_structure.pr --check --toAda
compile-ada: generate-ada
asn1.exe -Ada dataview-uniq.asn -typePrefix asn1Scc -equal
gnatmake -c *.adb
gcc -c test.c
gnatbind -n adder.ali
gnatlink -o testcase test.o adder.ali -lgnat -lm
./testcase | diff expected - && echo 'All OK!'
generate-llvm:
../../../opengeode.py adder.pr system_structure.pr --check --llvm
parse:
../../../opengeode.py adder.pr system_structure.pr --check
clean:
rm -rf *.adb *.ads *.pyc runSpark.sh spark.idx *.o *.ali gnat.cfg examiner bin *.wrn *.gpr testcase
/* CIF PROCESS (150, 150), (150, 75) */
PROCESS adder;
/* CIF TEXT (176, -127), (198, 140) */
-- Declare your variables
DCL n Number;
/* CIF ENDTEXT */
/* CIF START (-86, -394), (100, 50) */
START;
/* CIF TASK (-102, -323), (133, 50) */
TASK n := 1;
/* CIF NEXTSTATE (-86, -258), (100, 50) */
NEXTSTATE Wait;
/* CIF STATE (-86, -258), (100, 50) */
STATE Wait;
/* CIF INPUT (-85, -188), (100, 50) */
INPUT run;
/* CIF TASK (-117, -123), (164, 49) */
TASK n := n + 1;
/* CIF PROCEDURECALL (-85, -59), (100, 35) */
CALL writeln(n);
/* CIF NEXTSTATE (-85, -9), (100, 50) */
NEXTSTATE Wait;
ENDSTATE;
ENDPROCESS adder;
TASTE-Dataview DEFINITIONS ::=
BEGIN
Number ::= INTEGER (0..255)
END
/* CIF Keep Specific Geode ASNFilename 'dataview-uniq.asn' */
USE Datamodel;
SYSTEM adder;
SIGNAL run;
CHANNEL c
FROM ENV TO adder WITH run;
ENDCHANNEL;
BLOCK adder;
SIGNALROUTE r
FROM ENV TO adder WITH run;
CONNECT c and r;
PROCESS adder REFERENCED;
ENDBLOCK;
ENDSYSTEM;
extern void adder_run();
int main() {
adder_run();
adder_run();
adder_run();
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