Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Belle2017-09-12 11:52:53 +0000
committerJan Belle2017-09-12 11:52:53 +0000
commit9e42fbde145d3de9dabbb4ee88d100ce6d5efcb7 (patch)
tree2c20e0cb780a19c2cda75cb746e332a5c27c81d6 /tests/org.eclipse.etrice.generator.common.tests
parent9c159513eea9d2ac0588ffb0b93c51aaeff22f21 (diff)
downloadorg.eclipse.etrice-9e42fbde145d3de9dabbb4ee88d100ce6d5efcb7.tar.gz
org.eclipse.etrice-9e42fbde145d3de9dabbb4ee88d100ce6d5efcb7.tar.xz
org.eclipse.etrice-9e42fbde145d3de9dabbb4ee88d100ce6d5efcb7.zip
[generator.common.tests] gradle build for common generator tests
Diffstat (limited to 'tests/org.eclipse.etrice.generator.common.tests')
-rw-r--r--tests/org.eclipse.etrice.generator.common.tests/build.gradle34
-rw-r--r--tests/org.eclipse.etrice.generator.common.tests/log/c/log/testlog/readme.txt0
-rw-r--r--tests/org.eclipse.etrice.generator.common.tests/log/cpp/log/testlog/readme.txt0
-rw-r--r--tests/org.eclipse.etrice.generator.common.tests/log/java/log/testlog/readme.txt0
-rw-r--r--tests/org.eclipse.etrice.generator.common.tests/models/ActorCommunicationTest.room6
-rw-r--r--tests/org.eclipse.etrice.generator.common.tests/models/ChoicePointTest.room10
-rw-r--r--tests/org.eclipse.etrice.generator.common.tests/models/ChoicePointTestExtended.room6
-rw-r--r--tests/org.eclipse.etrice.generator.common.tests/models/CompileTests.room12
-rw-r--r--tests/org.eclipse.etrice.generator.common.tests/models/ContinuationTransitionTest.room4
-rw-r--r--tests/org.eclipse.etrice.generator.common.tests/models/DataDrivenTest.room8
-rw-r--r--tests/org.eclipse.etrice.generator.common.tests/models/DetailExpressionTest.room6
-rw-r--r--tests/org.eclipse.etrice.generator.common.tests/models/EnumTest.room10
-rw-r--r--tests/org.eclipse.etrice.generator.common.tests/models/GenericPhysical.etphys43
-rw-r--r--tests/org.eclipse.etrice.generator.common.tests/models/HandlerTest.room9
-rw-r--r--tests/org.eclipse.etrice.generator.common.tests/models/OperationInheritanceTest.room9
-rw-r--r--tests/org.eclipse.etrice.generator.common.tests/models/PingPongThread.etphys2
-rw-r--r--tests/org.eclipse.etrice.generator.common.tests/models/PingPongThreadReplPortTest.etmap2
-rw-r--r--tests/org.eclipse.etrice.generator.common.tests/models/PingPongThreadReplPortTest.room6
-rw-r--r--tests/org.eclipse.etrice.generator.common.tests/models/PingPongThreadTest.etmap2
-rw-r--r--tests/org.eclipse.etrice.generator.common.tests/models/PingPongThreadTest.room6
-rw-r--r--tests/org.eclipse.etrice.generator.common.tests/models/StatemachineInterfaceInheritedTest.room2
-rw-r--r--tests/org.eclipse.etrice.generator.common.tests/models/StatemachineInterfaceTest.room2
-rw-r--r--tests/org.eclipse.etrice.generator.common.tests/models/sendingData/SendingDataTestC.room6
-rw-r--r--tests/org.eclipse.etrice.generator.common.tests/models/sendingData/SendingDataTestCpp.room6
-rw-r--r--tests/org.eclipse.etrice.generator.common.tests/models/sendingData/SendingDataTestJava.room6
-rw-r--r--tests/org.eclipse.etrice.generator.common.tests/test.gradle98
26 files changed, 244 insertions, 51 deletions
diff --git a/tests/org.eclipse.etrice.generator.common.tests/build.gradle b/tests/org.eclipse.etrice.generator.common.tests/build.gradle
new file mode 100644
index 000000000..7da84045e
--- /dev/null
+++ b/tests/org.eclipse.etrice.generator.common.tests/build.gradle
@@ -0,0 +1,34 @@
+plugins {
+ id 'c'
+ id 'cpp'
+ id 'java-base'
+}
+
+apply from: "test.gradle"
+
+def genericPhysical = 'models/GenericPhysical.etphys'
+
+def tests = [
+ actorCommunicationTest: ['models/ActorCommunicationTest.room', genericPhysical],
+ choicePointTest: ['models/ChoicePointTest.room', genericPhysical],
+ choicePointTestExtended: ['models/ChoicePointTestExtended.room', genericPhysical],
+ dataDrivenTest: ['models/DataDrivenTest.room', genericPhysical],
+ //enumTest: ['models/EnumTest.room', genericPhysical],
+ compileTests: ['models/CompileTests.room', genericPhysical, 'models/DetailExpressionTest.room', 'models/StatemachineInterfaceTest.room', 'models/StatemachineInterfaceInheritedTest.room', 'models/StatemachineInterfaceTest.room', 'models/ContinuationTransitionTest.room'],
+ handlerTest: ['models/HandlerTest.room', genericPhysical],
+ operationInheritanceTest: ['models/OperationInheritanceTest.room', genericPhysical],
+ pingPongThreadTest: ['models/PingPongThreadTest.etmap', 'models/PingPongThreadTest.room'],
+ pingPongThreadReplPortTest: ['models/PingPongThreadReplPortTest.etmap', 'models/PingPongThreadReplPortTest.room']
+]
+
+tests.each { key, value ->
+ def testTasks = [
+ addTest('c', key, value),
+ addTest('cpp', key, value),
+ addTest('java', key, value)
+ ]
+
+ tasks.create(name: key, dependsOn: testTasks, group: 'verification')
+}
+
+clean.delete 'src-gen', fileTree('log') { exclude '**/readme.txt' } \ No newline at end of file
diff --git a/tests/org.eclipse.etrice.generator.common.tests/log/c/log/testlog/readme.txt b/tests/org.eclipse.etrice.generator.common.tests/log/c/log/testlog/readme.txt
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/tests/org.eclipse.etrice.generator.common.tests/log/c/log/testlog/readme.txt
diff --git a/tests/org.eclipse.etrice.generator.common.tests/log/cpp/log/testlog/readme.txt b/tests/org.eclipse.etrice.generator.common.tests/log/cpp/log/testlog/readme.txt
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/tests/org.eclipse.etrice.generator.common.tests/log/cpp/log/testlog/readme.txt
diff --git a/tests/org.eclipse.etrice.generator.common.tests/log/java/log/testlog/readme.txt b/tests/org.eclipse.etrice.generator.common.tests/log/java/log/testlog/readme.txt
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/tests/org.eclipse.etrice.generator.common.tests/log/java/log/testlog/readme.txt
diff --git a/tests/org.eclipse.etrice.generator.common.tests/models/ActorCommunicationTest.room b/tests/org.eclipse.etrice.generator.common.tests/models/ActorCommunicationTest.room
index ff81f30e0..263c1b7e2 100644
--- a/tests/org.eclipse.etrice.generator.common.tests/models/ActorCommunicationTest.room
+++ b/tests/org.eclipse.etrice.generator.common.tests/models/ActorCommunicationTest.room
@@ -1,8 +1,8 @@
RoomModel ActorCommunicationTest {
- import room.basic.types.* from "Types.room"
- import room.basic.test.* from "Tests.room"
- import room.basic.service.timing.* from "TimingService.room"
+ import room.basic.types.* from "../../../runtime/${etModellib}/model/Types.room"
+ import room.basic.test.* from "../../../runtime/${etModellib}/model/Tests.room"
+ import room.basic.service.timing.* from "../../../runtime/${etModellib}/model/TimingService.room"
SubSystemClass SubSystem_ActorCommunicationTest {
@TestInstance
diff --git a/tests/org.eclipse.etrice.generator.common.tests/models/ChoicePointTest.room b/tests/org.eclipse.etrice.generator.common.tests/models/ChoicePointTest.room
index 3274047fe..9c0ac4794 100644
--- a/tests/org.eclipse.etrice.generator.common.tests/models/ChoicePointTest.room
+++ b/tests/org.eclipse.etrice.generator.common.tests/models/ChoicePointTest.room
@@ -1,10 +1,14 @@
RoomModel ChoicePointTest {
- import room.basic.test.* from "Tests.room"
- import room.basic.types.* from "Types.room"
+ import room.basic.types.* from "../../../runtime/${etModellib}/model/Types.room"
+ import room.basic.test.* from "../../../runtime/${etModellib}/model/Tests.room"
- ActorClass CPTest_Top {
+ SubSystemClass SubSystem_ChoicePointTest {
@TestInstance
+ ActorRef cptest_top : CPTest_Top
+ }
+
+ ActorClass CPTest_Top {
Structure {
ActorRef cp_tester: CPTester
ActorRef cp_user: CPUser
diff --git a/tests/org.eclipse.etrice.generator.common.tests/models/ChoicePointTestExtended.room b/tests/org.eclipse.etrice.generator.common.tests/models/ChoicePointTestExtended.room
index fd23b8bde..d24f6030d 100644
--- a/tests/org.eclipse.etrice.generator.common.tests/models/ChoicePointTestExtended.room
+++ b/tests/org.eclipse.etrice.generator.common.tests/models/ChoicePointTestExtended.room
@@ -1,9 +1,9 @@
RoomModel ChoicePointTestExtended {
- import room.basic.test.* from "Tests.room"
- import room.basic.types.* from "Types.room"
+ import room.basic.types.* from "../../../runtime/${etModellib}/model/Types.room"
+ import room.basic.test.* from "../../../runtime/${etModellib}/model/Tests.room"
- SubSystemClass SubSystem_CPTestExtended {
+ SubSystemClass SubSystem_ChoicePointTestExtended {
@TestInstance
ActorRef tester_event: Tester_event
}
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 fe6547c4c..83befe64b 100644
--- a/tests/org.eclipse.etrice.generator.common.tests/models/CompileTests.room
+++ b/tests/org.eclipse.etrice.generator.common.tests/models/CompileTests.room
@@ -1,14 +1,18 @@
-RoomModel CompileTestsModel {
+RoomModel CompileTests {
- import room.basic.types.* from "Types.room"
- import room.basic.test.* from "Tests.room"
+ import room.basic.types.* from "../../../runtime/${etModellib}/model/Types.room"
+ import room.basic.test.* from "../../../runtime/${etModellib}/model/Tests.room"
import DetailExpressionTestModel.DetailExpressionTest from "DetailExpressionTest.room"
import StatemachineInterfaceTestModel.StatemachineInterfaceTest from "StatemachineInterfaceTest.room"
import StatemachineInterfaceTestInheritedModel.StatemachineInterfaceInheritedTest from "StatemachineInterfaceInheritedTest.room"
import ContinuationTransitionTest.ContinuationTransitionTest from "ContinuationTransitionTest.room"
- ActorClass CompileTests {
+ SubSystemClass SubSystem_CompileTests {
@TestInstance
+ ActorRef compileTests : CompileTests
+ }
+
+ ActorClass CompileTests {
Structure {
Attribute caseId : int32
diff --git a/tests/org.eclipse.etrice.generator.common.tests/models/ContinuationTransitionTest.room b/tests/org.eclipse.etrice.generator.common.tests/models/ContinuationTransitionTest.room
index b5d4c79e5..e17ab03dd 100644
--- a/tests/org.eclipse.etrice.generator.common.tests/models/ContinuationTransitionTest.room
+++ b/tests/org.eclipse.etrice.generator.common.tests/models/ContinuationTransitionTest.room
@@ -1,7 +1,7 @@
RoomModel ContinuationTransitionTest {
- import room.basic.types.* from "Types.room"
- import room.basic.test.* from "Tests.room"
+ import room.basic.types.* from "../../../runtime/${etModellib}/model/Types.room"
+ import room.basic.test.* from "../../../runtime/${etModellib}/model/Tests.room"
ActorClass ContinuationTransitionTest {
Structure {
diff --git a/tests/org.eclipse.etrice.generator.common.tests/models/DataDrivenTest.room b/tests/org.eclipse.etrice.generator.common.tests/models/DataDrivenTest.room
index 2cd9b1aba..4d3698ac2 100644
--- a/tests/org.eclipse.etrice.generator.common.tests/models/DataDrivenTest.room
+++ b/tests/org.eclipse.etrice.generator.common.tests/models/DataDrivenTest.room
@@ -1,10 +1,10 @@
RoomModel DataDrivenTest {
- import room.basic.test.* from "Tests.room"
- import room.basic.types.* from "Types.room"
- import room.basic.service.timing.* from "TimingService.room"
+ import room.basic.types.* from "../../../runtime/${etModellib}/model/Types.room"
+ import room.basic.test.* from "../../../runtime/${etModellib}/model/Tests.room"
+ import room.basic.service.timing.* from "../../../runtime/${etModellib}/model/TimingService.room"
- SubSystemClass SubSystem_DataDriven {
+ SubSystemClass SubSystem_DataDrivenTest {
@TestInstance
ActorRef appl: Appl
ActorRef timing: ATimingService
diff --git a/tests/org.eclipse.etrice.generator.common.tests/models/DetailExpressionTest.room b/tests/org.eclipse.etrice.generator.common.tests/models/DetailExpressionTest.room
index ad1887cd4..a3297bce9 100644
--- a/tests/org.eclipse.etrice.generator.common.tests/models/DetailExpressionTest.room
+++ b/tests/org.eclipse.etrice.generator.common.tests/models/DetailExpressionTest.room
@@ -1,8 +1,8 @@
RoomModel DetailExpressionTestModel {
- import room.basic.types.* from "Types.room"
- import room.basic.test.* from "Tests.room"
- import room.basic.service.timing.* from "TimingService.room"
+ import room.basic.types.* from "../../../runtime/${etModellib}/model/Types.room"
+ import room.basic.test.* from "../../../runtime/${etModellib}/model/Tests.room"
+ import room.basic.service.timing.* from "../../../runtime/${etModellib}/model/TimingService.room"
async ActorClass DetailExpressionTest {
Interface {
diff --git a/tests/org.eclipse.etrice.generator.common.tests/models/EnumTest.room b/tests/org.eclipse.etrice.generator.common.tests/models/EnumTest.room
index f8d9f6b22..80eaf7d66 100644
--- a/tests/org.eclipse.etrice.generator.common.tests/models/EnumTest.room
+++ b/tests/org.eclipse.etrice.generator.common.tests/models/EnumTest.room
@@ -1,10 +1,14 @@
RoomModel EnumTest {
- import room.basic.test.* from "Tests.room"
- import room.basic.types.* from "Types.room"
+ import room.basic.types.* from "../../../runtime/${etModellib}/model/Types.room"
+ import room.basic.test.* from "../../../runtime/${etModellib}/model/Tests.room"
- ActorClass EnumTest_Top {
+ SubSystemClass SubSystem_EnumTest {
@TestInstance
+ ActorRef enumTest_top : EnumTest_Top
+ }
+
+ ActorClass EnumTest_Top {
Structure {
ActorRef user: EnumUser
}
diff --git a/tests/org.eclipse.etrice.generator.common.tests/models/GenericPhysical.etphys b/tests/org.eclipse.etrice.generator.common.tests/models/GenericPhysical.etphys
new file mode 100644
index 000000000..9e9a2cc3f
--- /dev/null
+++ b/tests/org.eclipse.etrice.generator.common.tests/models/GenericPhysical.etphys
@@ -0,0 +1,43 @@
+PhysicalModel room.generic.physical {
+
+ PhysicalSystem GenericPhysicalSystem {
+ NodeRef node : GenericNodeClass
+ }
+
+ NodeClass GenericNodeClass {
+ runtime = DefaultRuntimeClass
+ priomin = 1
+ priomax = 10
+
+ DefaultThread DefaultPhysicalThread {
+ execmode = mixed
+ interval = 100ms
+ prio = 5
+ stacksize = 1024
+ msgblocksize = 64
+ msgpoolsize = 100
+ }
+
+ Thread BlockedThread {
+ execmode = blocked
+ prio = 5
+ stacksize = 1024
+ msgblocksize = 64
+ msgpoolsize = 100
+ }
+
+ Thread PolledThread {
+ execmode = polled
+ interval = 100ms
+ prio = 5
+ stacksize = 1024
+ msgblocksize = 64
+ msgpoolsize = 100
+ }
+ }
+
+ RuntimeClass DefaultRuntimeClass {
+ model = multiThreaded
+ }
+
+} \ No newline at end of file
diff --git a/tests/org.eclipse.etrice.generator.common.tests/models/HandlerTest.room b/tests/org.eclipse.etrice.generator.common.tests/models/HandlerTest.room
index 3c4601bcd..8276547dd 100644
--- a/tests/org.eclipse.etrice.generator.common.tests/models/HandlerTest.room
+++ b/tests/org.eclipse.etrice.generator.common.tests/models/HandlerTest.room
@@ -1,11 +1,14 @@
RoomModel HandlerTest {
- import room.basic.types.* from "Types.room"
- import room.basic.test.* from "Tests.room"
+ import room.basic.types.* from "../../../runtime/${etModellib}/model/Types.room"
+ import room.basic.test.* from "../../../runtime/${etModellib}/model/Tests.room"
+ SubSystemClass SubSystem_HandlerTest {
+ @TestInstance
+ ActorRef handlerTest_top : HandlerTest_Top
+ }
ActorClass HandlerTest_Top {
- @TestInstance
Structure {
ActorRef tester: Tester
ActorRef handlerUser: HandlerUser
diff --git a/tests/org.eclipse.etrice.generator.common.tests/models/OperationInheritanceTest.room b/tests/org.eclipse.etrice.generator.common.tests/models/OperationInheritanceTest.room
index d59508a84..face41b4c 100644
--- a/tests/org.eclipse.etrice.generator.common.tests/models/OperationInheritanceTest.room
+++ b/tests/org.eclipse.etrice.generator.common.tests/models/OperationInheritanceTest.room
@@ -1,11 +1,14 @@
RoomModel OperationInheritanceTest {
- import room.basic.types.* from "Types.room"
+ import room.basic.types.* from "../../../runtime/${etModellib}/model/Types.room"
+ import room.basic.test.* from "../../../runtime/${etModellib}/model/Tests.room"
- import room.basic.test.* from "Tests.room"
+ SubSystemClass SubSystem_OperationInheritanceTest {
+ @TestInstance
+ ActorRef top_test : OperationInheritanceTest
+ }
async ActorClass OperationInheritanceTest extends BaseActor {
- @TestInstance
Structure {
Attribute testDataClass: SubDataClass
}
diff --git a/tests/org.eclipse.etrice.generator.common.tests/models/PingPongThread.etphys b/tests/org.eclipse.etrice.generator.common.tests/models/PingPongThread.etphys
index 1215b84c6..aaf01df01 100644
--- a/tests/org.eclipse.etrice.generator.common.tests/models/PingPongThread.etphys
+++ b/tests/org.eclipse.etrice.generator.common.tests/models/PingPongThread.etphys
@@ -1,7 +1,7 @@
PhysicalModel PingPongThread {
PhysicalSystem Sys {
- NodeRef node1: PC
+ NodeRef node: PC
}
NodeClass PC {
diff --git a/tests/org.eclipse.etrice.generator.common.tests/models/PingPongThreadReplPortTest.etmap b/tests/org.eclipse.etrice.generator.common.tests/models/PingPongThreadReplPortTest.etmap
index 9b8d078af..0ea6ddfab 100644
--- a/tests/org.eclipse.etrice.generator.common.tests/models/PingPongThreadReplPortTest.etmap
+++ b/tests/org.eclipse.etrice.generator.common.tests/models/PingPongThreadReplPortTest.etmap
@@ -4,7 +4,7 @@ MappingModel PingPongThreadReplPortTest {
import PingPongThread.* from "PingPongThread.etphys"
Mapping System_PingPongReplPort -> Sys {
- SubSystemMapping main -> node1 {
+ SubSystemMapping ref_SubSystem_PingPongThreadReplPortTest -> node {
ThreadMapping mrPingThread -> DfltThread
ThreadMapping mrPong1Thread -> Thread1
ThreadMapping mrPong2Thread -> Thread2
diff --git a/tests/org.eclipse.etrice.generator.common.tests/models/PingPongThreadReplPortTest.room b/tests/org.eclipse.etrice.generator.common.tests/models/PingPongThreadReplPortTest.room
index 856ba8855..4fe552769 100644
--- a/tests/org.eclipse.etrice.generator.common.tests/models/PingPongThreadReplPortTest.room
+++ b/tests/org.eclipse.etrice.generator.common.tests/models/PingPongThreadReplPortTest.room
@@ -1,10 +1,10 @@
RoomModel PingPongThreadReplPortTest {
- import room.basic.service.timing.* from "TimingService.room"
- import room.basic.types.* from "Types.room"
+ import room.basic.types.* from "../../../runtime/${etModellib}/model/Types.room"
+ import room.basic.service.timing.* from "../../../runtime/${etModellib}/model/TimingService.room"
LogicalSystem System_PingPongReplPort{
- SubSystemRef main : SubSystem_PingPongReplPort
+ SubSystemRef ref_SubSystem_PingPongThreadReplPortTest : SubSystem_PingPongReplPort
}
SubSystemClass SubSystem_PingPongReplPort {
diff --git a/tests/org.eclipse.etrice.generator.common.tests/models/PingPongThreadTest.etmap b/tests/org.eclipse.etrice.generator.common.tests/models/PingPongThreadTest.etmap
index 4aa1aaaeb..caaf06032 100644
--- a/tests/org.eclipse.etrice.generator.common.tests/models/PingPongThreadTest.etmap
+++ b/tests/org.eclipse.etrice.generator.common.tests/models/PingPongThreadTest.etmap
@@ -5,7 +5,7 @@ MappingModel PingPongThreadTest {
import PingPongThread.* from "PingPongThread.etphys"
Mapping System_PingPong -> Sys {
- SubSystemMapping main -> node1 {
+ SubSystemMapping ref_SubSystem_PingPongThreadTest -> node {
ThreadMapping mrPingThread -> DfltThread
ThreadMapping mrPong1Thread -> Thread1
ThreadMapping mrPong2Thread -> Thread2
diff --git a/tests/org.eclipse.etrice.generator.common.tests/models/PingPongThreadTest.room b/tests/org.eclipse.etrice.generator.common.tests/models/PingPongThreadTest.room
index 68ba1634d..cf3f23e65 100644
--- a/tests/org.eclipse.etrice.generator.common.tests/models/PingPongThreadTest.room
+++ b/tests/org.eclipse.etrice.generator.common.tests/models/PingPongThreadTest.room
@@ -1,10 +1,10 @@
RoomModel PingPongThreadTest {
- import room.basic.service.timing.* from "TimingService.room"
- import room.basic.types.* from "Types.room"
+ import room.basic.types.* from "../../../runtime/${etModellib}/model/Types.room"
+ import room.basic.service.timing.* from "../../../runtime/${etModellib}/model/TimingService.room"
LogicalSystem System_PingPong{
- SubSystemRef main : SubSystem_PingPong
+ SubSystemRef ref_SubSystem_PingPongThreadTest : SubSystem_PingPong
}
SubSystemClass SubSystem_PingPong {
diff --git a/tests/org.eclipse.etrice.generator.common.tests/models/StatemachineInterfaceInheritedTest.room b/tests/org.eclipse.etrice.generator.common.tests/models/StatemachineInterfaceInheritedTest.room
index a32d0f09a..4a23a2d4c 100644
--- a/tests/org.eclipse.etrice.generator.common.tests/models/StatemachineInterfaceInheritedTest.room
+++ b/tests/org.eclipse.etrice.generator.common.tests/models/StatemachineInterfaceInheritedTest.room
@@ -1,6 +1,6 @@
RoomModel StatemachineInterfaceTestInheritedModel {
- import room.basic.types.* from "Types.room"
+ import room.basic.types.* from "../../../runtime/${etModellib}/model/Types.room"
import StatemachineInterfaceTestModel.* from "StatemachineInterfaceTest.room"
ActorClass StatemachineInterfaceInheritedTest {
diff --git a/tests/org.eclipse.etrice.generator.common.tests/models/StatemachineInterfaceTest.room b/tests/org.eclipse.etrice.generator.common.tests/models/StatemachineInterfaceTest.room
index 962ecaacf..c1e2e0b0f 100644
--- a/tests/org.eclipse.etrice.generator.common.tests/models/StatemachineInterfaceTest.room
+++ b/tests/org.eclipse.etrice.generator.common.tests/models/StatemachineInterfaceTest.room
@@ -1,6 +1,6 @@
RoomModel StatemachineInterfaceTestModel {
- import room.basic.types.* from "Types.room"
+ import room.basic.types.* from "../../../runtime/${etModellib}/model/Types.room"
ActorClass StatemachineInterfaceTest {
Structure {
diff --git a/tests/org.eclipse.etrice.generator.common.tests/models/sendingData/SendingDataTestC.room b/tests/org.eclipse.etrice.generator.common.tests/models/sendingData/SendingDataTestC.room
index a44f54c1d..9c4691ee5 100644
--- a/tests/org.eclipse.etrice.generator.common.tests/models/sendingData/SendingDataTestC.room
+++ b/tests/org.eclipse.etrice.generator.common.tests/models/sendingData/SendingDataTestC.room
@@ -1,8 +1,8 @@
RoomModel SendingDataTestC {
- import room.basic.test.* from "../Tests.room"
- import room.basic.types.* from "../Types.room"
- import room.basic.language.* from "../Language.room"
+ import room.basic.test.* from "../../../../runtime/org.eclipse.etrice.modellib.c/model/Tests.room"
+ import room.basic.types.* from "../../../../runtime/org.eclipse.etrice.modellib.c/model/Types.room"
+ import room.basic.language.* from "../../../../runtime/org.eclipse.etrice.modellib.c/model/Language.room"
ActorClass SendingDataTop {
@TestInstance
diff --git a/tests/org.eclipse.etrice.generator.common.tests/models/sendingData/SendingDataTestCpp.room b/tests/org.eclipse.etrice.generator.common.tests/models/sendingData/SendingDataTestCpp.room
index a7e4a9a12..6094b11d8 100644
--- a/tests/org.eclipse.etrice.generator.common.tests/models/sendingData/SendingDataTestCpp.room
+++ b/tests/org.eclipse.etrice.generator.common.tests/models/sendingData/SendingDataTestCpp.room
@@ -1,8 +1,8 @@
RoomModel SendingDataTestCpp {
- import room.basic.test.* from "../Tests.room"
- import room.basic.types.* from "../Types.room"
- import room.basic.language.* from "../Language.room"
+ import room.basic.test.* from "../../../../runtime/org.eclipse.etrice.modellib.cpp/model/Tests.room"
+ import room.basic.types.* from "../../../../runtime/org.eclipse.etrice.modellib.cpp/model/Types.room"
+ import room.basic.language.* from "../../../../runtime/org.eclipse.etrice.modellib.cpp/model/Language.room"
ActorClass SendingDataTop {
@TestInstance
diff --git a/tests/org.eclipse.etrice.generator.common.tests/models/sendingData/SendingDataTestJava.room b/tests/org.eclipse.etrice.generator.common.tests/models/sendingData/SendingDataTestJava.room
index aafe3bb69..007b3242c 100644
--- a/tests/org.eclipse.etrice.generator.common.tests/models/sendingData/SendingDataTestJava.room
+++ b/tests/org.eclipse.etrice.generator.common.tests/models/sendingData/SendingDataTestJava.room
@@ -1,8 +1,8 @@
RoomModel SendingDataTestJava {
- import room.basic.test.* from "../Tests.room"
- import room.basic.types.* from "../Types.room"
- import room.basic.language.* from "../Language.room"
+ import room.basic.test.* from "../../../../runtime/org.eclipse.etrice.modellib.java/model/Tests.room"
+ import room.basic.types.* from "../../../../runtime/org.eclipse.etrice.modellib.java/model/Types.room"
+ import room.basic.language.* from "../../../../runtime/org.eclipse.etrice.modellib.java/model/Language.room"
ActorClass SendingDataTop {
@TestInstance
diff --git a/tests/org.eclipse.etrice.generator.common.tests/test.gradle b/tests/org.eclipse.etrice.generator.common.tests/test.gradle
new file mode 100644
index 000000000..e585a73a2
--- /dev/null
+++ b/tests/org.eclipse.etrice.generator.common.tests/test.gradle
@@ -0,0 +1,98 @@
+
+ext.addTest = { lang, name, genArgs ->
+ def nameCap = name.capitalize()
+ def langCap = lang.capitalize()
+ def testName = "$name$langCap"
+ def testNameCap = testName.capitalize()
+ def genDir = "src-gen/$lang/$name"
+ def logDir = "log/$lang"
+ def exeFile = "$buildDir/exe/$testName/$testName"
+ def mainClass = "${nameCap}.Node_node_ref_SubSystem_${nameCap}Runner"
+ def etuFile = "$logDir/log/testlog/${nameCap}.etu"
+ def xmlFile = "$logDir/log/testlog/${nameCap}.xml"
+ def modellib = ":runtime:org.eclipse.etrice.modellib.$lang"
+ def generator = ":plugins:org.eclipse.etrice.generator.$lang"
+ def etUnitConverter = ':plugins:org.eclipse.etrice.etunit.converter'
+
+ def generateTask = tasks.create(name: "generate$testNameCap", type: JavaExec) {
+ dependsOn "$generator:classes"
+ main = project(generator).mainClassName
+ classpath = project(generator).classpath
+ args '-msc_instr', '-genDir', genDir
+ args genArgs
+ environment 'etModellib', "org.eclipse.etrice.modellib.$lang"
+ inputs.files genArgs
+ outputs.dir genDir
+ }
+
+ def runTask
+
+ if(lang == 'c' || lang == 'cpp') {
+ model {
+ components {
+ "$testName"(NativeExecutableSpec) {
+ sources."$lang" {
+ builtBy generateTask
+ source {
+ srcDirs = [genDir]
+ include "**/*.$lang"
+ }
+ exportedHeaders {
+ srcDirs = [genDir]
+ }
+ lib project: ":runtime:org.eclipse.etrice.modellib.$lang", library: "etrice_modellib_$lang", linkage: 'static'
+ if(lang == 'cpp') lib project: ':runtime:org.eclipse.etrice.runtime.cpp', library: 'etrice_runtime_cpp', linkage: 'static'
+ lib project: ':runtime:org.eclipse.etrice.runtime.c', library: 'etrice_runtime_c', linkage: 'static'
+ }
+ binaries.all {
+ cCompiler.args '-g3'
+ cppCompiler.args '-g3'
+ }
+ }
+ }
+ }
+
+ runTask = tasks.create(name: "run$testNameCap", type: Exec) {
+ dependsOn "${testName}Executable"
+ commandLine exeFile, '-run_as_test'
+ inputs.file exeFile
+ outputs.file etuFile
+ workingDir = logDir
+ }
+ }
+
+ else if(lang == 'java') {
+ def testSourceSet = sourceSets.create(name) {
+ java.srcDirs = [genDir]
+ }
+
+ dependencies {
+ add "${name}Compile", project(':runtime:org.eclipse.etrice.modellib.java')
+ add "${name}Compile", project(':runtime:org.eclipse.etrice.runtime.java')
+ }
+
+ tasks.getByName("compile${nameCap}Java").dependsOn generateTask
+
+ runTask = tasks.create(name: "run$testName", type: JavaExec) {
+ dependsOn "${name}Classes"
+ main = mainClass
+ classpath = testSourceSet.runtimeClasspath
+ args '-run_as_test'
+ outputs.file etuFile
+ workingDir = logDir
+ }
+ }
+
+ def convertTask = tasks.create(name: "convert$testNameCap", type: JavaExec) {
+ dependsOn runTask, "$etUnitConverter:classes"
+ main = project(etUnitConverter).mainClassName
+ classpath = project(etUnitConverter).classpath
+ args etuFile
+ inputs.file etuFile
+ outputs.file xmlFile
+ }
+
+ def testTask = tasks.create(name: testName, dependsOn: convertTask, group: 'verification')
+ check.dependsOn testTask
+ return testTask
+} \ No newline at end of file

Back to the top