Skip to content

Commit ded4dec

Browse files
elena-volkova-hclGitHub Enterprise
authored andcommitted
RIC-1024: New test case choice_to_exitpoint (#70)
* RIC-1024: New test case choice_to_exitpoint * RIC-1024: New emx model choice_to_exitpoint * RIC-1024: Update choice_to_exitpoint * RIC-1024: Fixed emx version of choice_to_exitpoint
1 parent 510806a commit ded4dec

8 files changed

Lines changed: 533 additions & 0 deletions

File tree

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{ "folders": [
2+
{
3+
"path": "TestUtils"
4+
},
5+
{
6+
"path": "tests/choice_and_junction"
7+
},
8+
{
9+
"path": "tests/choice_guard_exclude"
10+
},
11+
{
12+
"path": "tests/choice_guard_redefinition"
13+
},
14+
{
15+
"path": "tests/choice_inheritance"
16+
},
17+
{
18+
"path": "tests/choice_to_exitpoint"
19+
},
20+
{
21+
"path": "tests/choice_transition_exclude"
22+
}
23+
]
24+
}
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
capsule Top {
2+
behavior port timer : Timing;
3+
statemachine {
4+
initial -> CompositeState.entryPoint
5+
`
6+
timer.informIn(RTTimespec(0, 100));
7+
std::cout << "initial -> CompositeState" << std::endl;
8+
`;
9+
state CompositeState {
10+
entry
11+
`
12+
std::cout << "Entered CompositeState" << std::endl;
13+
`;
14+
entrypoint entryPoint;
15+
exitpoint toGood;
16+
exitpoint toBad;
17+
18+
choice alwaysTrue;
19+
20+
entryPoint -> alwaysTrue
21+
`
22+
std::cout << "entryPoint -> alwaysTrue" << std::endl;
23+
`;
24+
never: alwaysTrue -> toBad when `false`
25+
`
26+
std::cout << "alwaysTrue -> toBad" << std::endl;
27+
`;
28+
always: alwaysTrue -> SubState when `else`
29+
`
30+
std::cout << "alwaysTrue -> SubState" << std::endl;
31+
`;
32+
state SubState {
33+
entry
34+
`
35+
std::cout << "Entered SubState" << std::endl;
36+
`;
37+
};
38+
SubState -> toGood on timer.timeout
39+
`
40+
std::cout << "SubState -> toGood" << std::endl;
41+
`;
42+
};
43+
CompositeState.toBad -> BadState
44+
`
45+
std::cout << "toBad -> BadState" << std::endl;
46+
`;
47+
state BadState {
48+
entry
49+
`
50+
FAIL("Entered BadState");
51+
`;
52+
};
53+
CompositeState.toGood -> GoodState
54+
`
55+
std::cout << "toGood -> GoodState" << std::endl;
56+
`;
57+
state GoodState {
58+
entry
59+
`
60+
std::cout << "Entered GoodState" << std::endl;
61+
PASS();
62+
`;
63+
};
64+
};
65+
};
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
group: cpp_code_generation
3+
---
4+
Test code generation for choice alternative when it goes to exitpoint from composite state. Expect several chain calls to be generated for choice alternative.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
let tc = TCF.define(TCF.ART_TO_CPP);
2+
tc.targetFolder = 'choice_to_exitpoint_target';
3+
tc.topCapsule = 'Top';
4+
tc.prerequisites = ["../../TestUtils/testlib.tcjs"];
5+
tc.commonPreface = `
6+
#include <iostream>
7+
#include "testlib.art.h"
8+
`;
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>choice_to_exitpoint</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/choice_to_exitpoint/choice_to_exitpoint.emx

Lines changed: 399 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
let tc = TCF.define(TCF.CPP_TRANSFORM);
2+
tc.sources = [
3+
'platform:/resource/choice_to_exitpoint/choice_to_exitpoint.emx#_TRO2kHZVEe-ltJuKXXDY4g',
4+
];
5+
tc.commonPreface = `
6+
#include <iostream>
7+
8+
`;
9+
tc.compilationMakeType = MakeType.GNU_make;
10+
tc.createTargetProject = true;
11+
tc.targetConfiguration = 'WinT.x64-MinGw-12.2.0';
12+
tc.targetProject = 'choice_to_exitpoint_target';
13+
tc.topCapsule = 'platform:/resource/choice_to_exitpoint/choice_to_exitpoint.emx#_WSwt4HZVEe-ltJuKXXDY4g';

0 commit comments

Comments
 (0)