Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJuergen Haug2019-01-12 06:29:57 -0500
committerJuergen Haug2019-01-12 06:30:29 -0500
commit8d023fb6af978b7da56d7f39376699d417279e9e (patch)
tree887f0c30577b1c260254b492becf59cde3de7ee6 /tests
parent322931d01d3fdf0411b2756f5aad5f582eddeed0 (diff)
downloadorg.eclipse.etrice-8d023fb6af978b7da56d7f39376699d417279e9e.tar.gz
org.eclipse.etrice-8d023fb6af978b7da56d7f39376699d417279e9e.tar.xz
org.eclipse.etrice-8d023fb6af978b7da56d7f39376699d417279e9e.zip
Bug 540562 - Support var args for operations
Diffstat (limited to 'tests')
-rw-r--r--tests/org.eclipse.etrice.generator.common.tests/build.gradle2
-rw-r--r--tests/org.eclipse.etrice.generator.common.tests/models/CompileTests.room3
-rw-r--r--tests/org.eclipse.etrice.generator.common.tests/models/VarargsTest.room36
3 files changed, 39 insertions, 2 deletions
diff --git a/tests/org.eclipse.etrice.generator.common.tests/build.gradle b/tests/org.eclipse.etrice.generator.common.tests/build.gradle
index 8064212dd..db760ff3d 100644
--- a/tests/org.eclipse.etrice.generator.common.tests/build.gradle
+++ b/tests/org.eclipse.etrice.generator.common.tests/build.gradle
@@ -12,7 +12,7 @@ def tests = [
choicePointTestExtended: ['models/ChoicePointTestExtended.room', genericPhysical],
dataDrivenTest: ['models/DataDrivenTest.room', genericPhysical],
/* enumTest: ['models/EnumTest.room', genericPhysical], not supported in c++ */
- compileTests: ['models/CompileTests.room', genericPhysical, 'models/StatemachineInterfaceTest.room', 'models/StatemachineInterfaceInheritedTest.room', 'models/StatemachineInterfaceTest.room', 'models/ContinuationTransitionTest.room'],
+ compileTests: ['models/CompileTests.room', genericPhysical, 'models/StatemachineInterfaceTest.room', 'models/StatemachineInterfaceInheritedTest.room', 'models/StatemachineInterfaceTest.room', 'models/ContinuationTransitionTest.room', 'models/VarargsTest.room'],
handlerTest: ['models/HandlerTest.room', genericPhysical],
operationInheritanceTest: ['models/OperationInheritanceTest.room', genericPhysical],
diff --git a/tests/org.eclipse.etrice.generator.common.tests/models/CompileTests.room b/tests/org.eclipse.etrice.generator.common.tests/models/CompileTests.room
index 37698c77b..e2790656b 100644
--- a/tests/org.eclipse.etrice.generator.common.tests/models/CompileTests.room
+++ b/tests/org.eclipse.etrice.generator.common.tests/models/CompileTests.room
@@ -6,6 +6,7 @@ RoomModel CompileTests {
import StatemachineInterfaceTestModel.StatemachineInterfaceTest from "StatemachineInterfaceTest.room"
import StatemachineInterfaceTestInheritedModel.StatemachineInterfaceInheritedTest from "StatemachineInterfaceInheritedTest.room"
import ContinuationTransitionTest.ContinuationTransitionTest from "ContinuationTransitionTest.room"
+ import VarargsTest.* from "VarargsTest.room"
ActorClass CompileTests {
@TestInstance
@@ -16,6 +17,7 @@ RoomModel CompileTests {
ActorRef statemachineInterfaceTest : StatemachineInterfaceTest
ActorRef statemachineInterfaceInheritedTest : StatemachineInterfaceInheritedTest
ActorRef continuationTransitionTest : ContinuationTransitionTest
+ ActorRef varargsTest : AVarargs
}
Behavior {
ctor {
@@ -34,5 +36,4 @@ RoomModel CompileTests {
}
}
}
-
} \ No newline at end of file
diff --git a/tests/org.eclipse.etrice.generator.common.tests/models/VarargsTest.room b/tests/org.eclipse.etrice.generator.common.tests/models/VarargsTest.room
new file mode 100644
index 000000000..dde861c7c
--- /dev/null
+++ b/tests/org.eclipse.etrice.generator.common.tests/models/VarargsTest.room
@@ -0,0 +1,36 @@
+RoomModel VarargsTest {
+
+ import room.basic.types.* from "../../../runtime/${etModellib}/model/Types.room"
+
+ ActorClass AVarargs {
+ Structure {
+ Port port: PVarargs
+ Attribute attr: DVarargs
+ }
+ Behavior {
+
+ // varargs keyword is hidden in proposals -> internal use
+ Operation log(format: string, args: string varargs) ''''''
+ Operation single(args: string varargs) ''''''
+ }
+ }
+
+ ProtocolClass PVarargs {
+ incoming {
+ Message dummy()
+ }
+ regular PortClass
+ {
+ Operation log(format: string, args: string varargs) ''''''
+ Operation single(args: string varargs) ''''''
+ }
+ }
+
+ DataClass DVarargs {
+ Attribute dummy: boolean
+
+ // varargs keyword is hidden in proposals -> internal use
+ Operation log(format: string, args: string varargs) ''''''
+ Operation single(args: string varargs) ''''''
+ }
+} \ No newline at end of file

Back to the top