Skip to content

Commit 894644a

Browse files
Merge branch 'main' of github01.hclpnp.com:Modeling/rtistic-pub-doc
2 parents 5d59017 + fc264e8 commit 894644a

18 files changed

Lines changed: 1602 additions & 9 deletions

File tree

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{ "folders": [
2+
{
3+
"path": "TestUtils"
4+
},
5+
{
6+
"path": "tests/delegation_connector"
7+
},
8+
{
9+
"path": "tests/delegation_connector_nested"
10+
},
11+
{
12+
"path": "tests/send_to_owner_in_initial_transition"
13+
}
14+
]
15+
}

art-comp-test/tests/delegation_connector/delegation_connector.art

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ capsule Top {
1010
connect p with thePart.p;
1111

1212
statemachine {
13-
state State1, State2;
13+
state State1;
1414
initial -> State1
15-
`
15+
`
1616
p.ping().send();
17-
`;
17+
`;
1818
};
1919
};
2020

@@ -28,12 +28,7 @@ capsule A {
2828
};
2929
};
3030

31-
3231
capsule B {
33-
[[rt::impl_preface]]
34-
`
35-
#include "testlib.art.h"
36-
`
3732
service behavior port p~ : Proto;
3833
statemachine {
3934
state State, Done;
@@ -43,4 +38,4 @@ capsule B {
4338
PASS();
4439
`;
4540
};
46-
};
41+
};

art-comp-test/tests/delegation_connector/top.tcjs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ let tc = TCF.define(TCF.ART_TO_CPP);
22
tc.topCapsule = 'Top';
33
tc.prerequisites = ["../../TestUtils/testlib.tcjs"];
44
tc.targetFolder = 'delegation_connector_target';
5+
tc.commonPreface = `
6+
#include "testlib.art.h"
7+
`;
58

69
/*tc.compileArguments = '$(DEBUG_TAG)';
710
tc.linkArguments = '/DEBUG';
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
protocol Prot {
2+
out m(`int`);
3+
};
4+
5+
capsule PCAP {
6+
/* Ports */
7+
service behavior port p~ : Prot;
8+
statemachine {
9+
state State;
10+
initial -> State;
11+
};
12+
};
13+
14+
capsule A {
15+
plugin part plu : PCAP[0..1];
16+
behavior port pp : Prot;
17+
connect pp with plu.p;
18+
19+
service behavior port p2 : Prot;
20+
service behavior port p : Prot;
21+
service behavior port p3 : Prot;
22+
statemachine {
23+
state S1;
24+
initial -> S1
25+
`
26+
printf("[%s:A] starting\n", this->getName());
27+
p.m(1).send();
28+
`;
29+
};
30+
};
31+
32+
capsule Top {
33+
[[rt::decl]]
34+
`
35+
unsigned int count = 0;
36+
static constexpr int N = 5;
37+
`
38+
39+
behavior port p~ : Prot[100];
40+
behavior port frame : Frame;
41+
optional part a : A[100];
42+
43+
connect a.p with p;
44+
statemachine {
45+
state State1 {
46+
received: on p.m
47+
`
48+
count++;
49+
printf("received %d\n", count);
50+
if (count == N) {
51+
PASS();
52+
}
53+
`;
54+
};
55+
initial -> State1
56+
`
57+
for (int i = 0; i < N; i++)
58+
frame.incarnate(a);
59+
`;
60+
};
61+
};
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
---
2+
group: cpp_code_generation
3+
---
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
let tc = TCF.define(TCF.ART_TO_CPP);
2+
tc.topCapsule = 'Top';
3+
tc.targetProject = 'send_to_owner_in_initial_transition_target';
4+
tc.prerequisites = [
5+
'../../TestUtils/testlib.tcjs'
6+
];
7+
tc.commonPreface = `
8+
#include "testlib.art.h"
9+
#include <stdio.h>
10+
`;
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>delegation_connector</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>com.ibm.xtools.umldt.core.internal.builders.UMLDevelopmentBuilder</name>
10+
<triggers>clean,full,incremental,</triggers>
11+
<arguments>
12+
</arguments>
13+
</buildCommand>
14+
</buildSpec>
15+
<natures>
16+
<nature>com.ibm.xtools.umldt.core.internal.natures.MDDProjectNature</nature>
17+
</natures>
18+
</projectDescription>
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
eclipse.preferences.version=1
2+
encoding/<project>=UTF-8

art-comp-test/testsEmx/delegation_connector/delegation_connector.emx

Lines changed: 395 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
let tc = TCF.define(TCF.CPP_TRANSFORM);
2+
tc.sources = [
3+
'platform:/resource/delegation_connector/delegation_connector.emx#_Ar3QgEj7Ee-mV-UQTNJH8A',
4+
];
5+
tc.commonPreface = '#include <iostream>';
6+
tc.compilationMakeType = MakeType.GNU_make;
7+
tc.createTargetProject = true;
8+
tc.targetConfiguration = 'WinT.x64-MinGw-12.2.0';
9+
tc.targetProject = 'delegation_connector_target';
10+
tc.topCapsule = 'platform:/resource/delegation_connector/delegation_connector.emx#_O-Ex4Ej7Ee-mV-UQTNJH8A';

0 commit comments

Comments
 (0)