Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Belle2017-09-12 07:52:53 -0400
committerJan Belle2017-09-12 07:52:53 -0400
commit9e42fbde145d3de9dabbb4ee88d100ce6d5efcb7 (patch)
tree2c20e0cb780a19c2cda75cb746e332a5c27c81d6
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
-rw-r--r--gradle.properties1
-rw-r--r--plugins/org.eclipse.etrice.abstractexec.behavior/build.gradle21
-rw-r--r--plugins/org.eclipse.etrice.core.common/build.gradle4
-rw-r--r--plugins/org.eclipse.etrice.core.config/build.gradle4
-rw-r--r--plugins/org.eclipse.etrice.core.etmap/build.gradle4
-rw-r--r--plugins/org.eclipse.etrice.core.etphys/build.gradle4
-rw-r--r--plugins/org.eclipse.etrice.core.fsm/build.gradle4
-rw-r--r--plugins/org.eclipse.etrice.core.room.ui/eTrice-rt.launch3
-rw-r--r--plugins/org.eclipse.etrice.core.room/build.gradle5
-rw-r--r--plugins/org.eclipse.etrice.etunit.converter/build.gradle24
-rw-r--r--plugins/org.eclipse.etrice.generator.c/build.gradle2
-rw-r--r--plugins/org.eclipse.etrice.generator.cpp/build.gradle2
-rw-r--r--plugins/org.eclipse.etrice.generator.java/build.gradle2
-rw-r--r--runtime/org.eclipse.etrice.modellib.c/build.gradle40
-rw-r--r--runtime/org.eclipse.etrice.modellib.cpp/build.gradle39
-rw-r--r--runtime/org.eclipse.etrice.modellib.java/build.gradle32
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/build.gradle23
-rw-r--r--runtime/org.eclipse.etrice.runtime.cpp/build.gradle24
-rw-r--r--runtime/org.eclipse.etrice.runtime.java/build.gradle11
-rw-r--r--runtime/org.eclipse.etrice.runtime.java/src-gen/org/eclipse/etrice/runtime/java/modelbase/RTSystemServicesProtocol.java75
-rw-r--r--settings.gradle15
-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
-rw-r--r--tests/org.eclipse.etrice.generator.java.tests/build.gradle32
48 files changed, 588 insertions, 78 deletions
diff --git a/gradle.properties b/gradle.properties
index ff4df7d85..640d2835c 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -1,3 +1,4 @@
xtext_version = +
+emf_version = +
core_version = +
commons_io_version = + \ No newline at end of file
diff --git a/plugins/org.eclipse.etrice.abstractexec.behavior/build.gradle b/plugins/org.eclipse.etrice.abstractexec.behavior/build.gradle
new file mode 100644
index 000000000..6309d3367
--- /dev/null
+++ b/plugins/org.eclipse.etrice.abstractexec.behavior/build.gradle
@@ -0,0 +1,21 @@
+plugins {
+ id 'java'
+}
+
+dependencies {
+ compile project(':plugins:org.eclipse.etrice.core.common')
+ compile project(':plugins:org.eclipse.etrice.core.fsm')
+ compile project(':plugins:org.eclipse.etrice.core.genmodel.fsm')
+ compile project(':plugins:org.eclipse.etrice.generator.fsm')
+
+ compile "org.eclipse.platform:org.eclipse.core.runtime:$core_version"
+ compile "org.eclipse.xtext:org.eclipse.xtext:$xtext_version"
+}
+
+sourceSets {
+ main {
+ java {
+ srcDirs = ['src']
+ }
+ }
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.etrice.core.common/build.gradle b/plugins/org.eclipse.etrice.core.common/build.gradle
index dc3aad1be..d4a3f77d9 100644
--- a/plugins/org.eclipse.etrice.core.common/build.gradle
+++ b/plugins/org.eclipse.etrice.core.common/build.gradle
@@ -13,5 +13,9 @@ sourceSets {
java {
srcDirs = ['src', 'src-gen', 'xtend-gen']
}
+ resources {
+ srcDirs = ['src', 'src-gen']
+ include '**/*.xtextbin', '**/*.tokens'
+ }
}
} \ No newline at end of file
diff --git a/plugins/org.eclipse.etrice.core.config/build.gradle b/plugins/org.eclipse.etrice.core.config/build.gradle
index e5d4bb91c..4e10d0c3b 100644
--- a/plugins/org.eclipse.etrice.core.config/build.gradle
+++ b/plugins/org.eclipse.etrice.core.config/build.gradle
@@ -12,5 +12,9 @@ sourceSets {
java {
srcDirs = ['src', 'src-gen', 'xtend-gen']
}
+ resources {
+ srcDirs = ['src', 'src-gen']
+ include '**/*.xtextbin', '**/*.tokens'
+ }
}
} \ No newline at end of file
diff --git a/plugins/org.eclipse.etrice.core.etmap/build.gradle b/plugins/org.eclipse.etrice.core.etmap/build.gradle
index 751a74cfa..a49fa9a8b 100644
--- a/plugins/org.eclipse.etrice.core.etmap/build.gradle
+++ b/plugins/org.eclipse.etrice.core.etmap/build.gradle
@@ -16,5 +16,9 @@ sourceSets {
java {
srcDirs = ['src', 'src-gen', 'xtend-gen']
}
+ resources {
+ srcDirs = ['src', 'src-gen']
+ include '**/*.xtextbin', '**/*.tokens'
+ }
}
} \ No newline at end of file
diff --git a/plugins/org.eclipse.etrice.core.etphys/build.gradle b/plugins/org.eclipse.etrice.core.etphys/build.gradle
index 857cc5786..0044dee50 100644
--- a/plugins/org.eclipse.etrice.core.etphys/build.gradle
+++ b/plugins/org.eclipse.etrice.core.etphys/build.gradle
@@ -11,5 +11,9 @@ sourceSets {
java {
srcDirs = ['src', 'src-gen', 'xtend-gen']
}
+ resources {
+ srcDirs = ['src', 'src-gen']
+ include '**/*.xtextbin', '**/*.tokens'
+ }
}
} \ No newline at end of file
diff --git a/plugins/org.eclipse.etrice.core.fsm/build.gradle b/plugins/org.eclipse.etrice.core.fsm/build.gradle
index bacf55a18..1d29137fe 100644
--- a/plugins/org.eclipse.etrice.core.fsm/build.gradle
+++ b/plugins/org.eclipse.etrice.core.fsm/build.gradle
@@ -13,5 +13,9 @@ sourceSets {
java {
srcDirs = ['src', 'src-gen', 'xtend-gen']
}
+ resources {
+ srcDirs = ['src', 'src-gen']
+ include '**/*.xtextbin', '**/*.tokens'
+ }
}
} \ No newline at end of file
diff --git a/plugins/org.eclipse.etrice.core.room.ui/eTrice-rt.launch b/plugins/org.eclipse.etrice.core.room.ui/eTrice-rt.launch
index 63704533c..98fc0beb4 100644
--- a/plugins/org.eclipse.etrice.core.room.ui/eTrice-rt.launch
+++ b/plugins/org.eclipse.etrice.core.room.ui/eTrice-rt.launch
@@ -14,6 +14,9 @@
<stringAttribute key="deselected_workspace_plugins" value="org.eclipse.etrice.example,org.eclipse.etrice.integration.tests"/>
<booleanAttribute key="includeOptional" value="true"/>
<stringAttribute key="location" value="${workspace_loc}/../eTrice-rt"/>
+<mapAttribute key="org.eclipse.debug.core.environmentVariables">
+<mapEntry key="etModellib" value="org.eclipse.etrice.modellib.c"/>
+</mapAttribute>
<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
</listAttribute>
diff --git a/plugins/org.eclipse.etrice.core.room/build.gradle b/plugins/org.eclipse.etrice.core.room/build.gradle
index 92072c02b..bead8b39c 100644
--- a/plugins/org.eclipse.etrice.core.room/build.gradle
+++ b/plugins/org.eclipse.etrice.core.room/build.gradle
@@ -5,6 +5,7 @@ plugins {
dependencies {
compile project(':plugins:org.eclipse.etrice.core.common')
compile project(':plugins:org.eclipse.etrice.core.fsm')
+ runtime project(':plugins:org.eclipse.etrice.abstractexec.behavior')
compile "org.eclipse.platform:org.eclipse.core.runtime:$core_version"
compile "org.eclipse.xtext:org.eclipse.xtext:$xtext_version"
@@ -15,5 +16,9 @@ sourceSets {
java {
srcDirs = ['src', 'src-gen', 'xtend-gen']
}
+ resources {
+ srcDirs = ['src', 'src-gen']
+ include '**/*.xtextbin', '**/*.tokens'
+ }
}
} \ No newline at end of file
diff --git a/plugins/org.eclipse.etrice.etunit.converter/build.gradle b/plugins/org.eclipse.etrice.etunit.converter/build.gradle
new file mode 100644
index 000000000..0309c7d3e
--- /dev/null
+++ b/plugins/org.eclipse.etrice.etunit.converter/build.gradle
@@ -0,0 +1,24 @@
+plugins {
+ id 'application'
+}
+
+dependencies {
+ compile "org.eclipse.platform:org.eclipse.core.runtime:$core_version"
+ compile "org.eclipse.emf:org.eclipse.emf.common:$emf_version"
+ compile "org.eclipse.emf:org.eclipse.emf.ecore:$emf_version"
+ compile "org.eclipse.emf:org.eclipse.emf.ecore.xmi:$emf_version"
+}
+
+sourceSets {
+ main {
+ java {
+ srcDirs = ['src']
+ }
+ }
+}
+
+ext.classpath = sourceSets.main.runtimeClasspath
+
+mainClassName = 'org.eclipse.etrice.etunit.converter.EtUnitReportConverter'
+
+distTar.enabled = false \ No newline at end of file
diff --git a/plugins/org.eclipse.etrice.generator.c/build.gradle b/plugins/org.eclipse.etrice.generator.c/build.gradle
index c25ee5832..77476ec8d 100644
--- a/plugins/org.eclipse.etrice.generator.c/build.gradle
+++ b/plugins/org.eclipse.etrice.generator.c/build.gradle
@@ -25,6 +25,8 @@ sourceSets {
}
}
+ext.classpath = sourceSets.main.runtimeClasspath
+
mainClassName = 'org.eclipse.etrice.generator.c.Main'
distTar.enabled = false \ No newline at end of file
diff --git a/plugins/org.eclipse.etrice.generator.cpp/build.gradle b/plugins/org.eclipse.etrice.generator.cpp/build.gradle
index e3c8f948f..01a614f7a 100644
--- a/plugins/org.eclipse.etrice.generator.cpp/build.gradle
+++ b/plugins/org.eclipse.etrice.generator.cpp/build.gradle
@@ -24,6 +24,8 @@ sourceSets {
}
}
+ext.classpath = sourceSets.main.runtimeClasspath
+
mainClassName = 'org.eclipse.etrice.generator.cpp.Main'
distTar.enabled = false \ No newline at end of file
diff --git a/plugins/org.eclipse.etrice.generator.java/build.gradle b/plugins/org.eclipse.etrice.generator.java/build.gradle
index 161180d1d..ab1d86cba 100644
--- a/plugins/org.eclipse.etrice.generator.java/build.gradle
+++ b/plugins/org.eclipse.etrice.generator.java/build.gradle
@@ -24,6 +24,8 @@ sourceSets {
}
}
+ext.classpath = sourceSets.main.runtimeClasspath
+
mainClassName = 'org.eclipse.etrice.generator.java.Main'
distTar.enabled = false \ No newline at end of file
diff --git a/runtime/org.eclipse.etrice.modellib.c/build.gradle b/runtime/org.eclipse.etrice.modellib.c/build.gradle
new file mode 100644
index 000000000..23ad8e2b0
--- /dev/null
+++ b/runtime/org.eclipse.etrice.modellib.c/build.gradle
@@ -0,0 +1,40 @@
+plugins {
+ id 'c'
+}
+
+def generator = ':plugins:org.eclipse.etrice.generator.c'
+
+task generate(type: JavaExec, group: 'build', dependsOn: "$generator:classes") {
+ main = project(generator).mainClassName
+ classpath = project(generator).classpath
+ inputs.dir 'model'
+ outputs.dir 'src-gen'
+ args '-lib', '-msc_instr', '-genDir', 'src-gen',
+ 'model/PInterrupt.room',
+ 'model/TcpService.room',
+ 'model/TimingService.room'
+}
+
+model {
+ components {
+ etrice_modellib_c(NativeLibrarySpec) {
+ sources.c {
+ builtBy generate
+ source {
+ srcDirs = ['src-gen']
+ include '**/*.c'
+ }
+ exportedHeaders {
+ srcDirs = ['src-gen']
+ }
+ lib project: ':runtime:org.eclipse.etrice.runtime.c', library: 'etrice_runtime_c', linkage: 'api'
+ }
+ binaries {
+ withType(SharedLibraryBinarySpec) { buildable = false }
+ all { cCompiler.args '-g3' }
+ }
+ }
+ }
+}
+
+clean.delete 'src-gen' \ No newline at end of file
diff --git a/runtime/org.eclipse.etrice.modellib.cpp/build.gradle b/runtime/org.eclipse.etrice.modellib.cpp/build.gradle
new file mode 100644
index 000000000..3299defba
--- /dev/null
+++ b/runtime/org.eclipse.etrice.modellib.cpp/build.gradle
@@ -0,0 +1,39 @@
+plugins {
+ id 'cpp'
+}
+
+def generator = ':plugins:org.eclipse.etrice.generator.cpp'
+
+task generate(type: JavaExec, group: 'build', dependsOn: "$generator:classes") {
+ main = project(generator).mainClassName
+ classpath = project(generator).classpath
+ inputs.dir 'model'
+ outputs.dir 'src-gen'
+ args '-lib', '-msc_instr', '-genDir', 'src-gen',
+ 'model/TimingService.room'
+}
+
+model {
+ components {
+ etrice_modellib_cpp(NativeLibrarySpec) {
+ sources.cpp {
+ builtBy generate
+ source {
+ srcDirs = ['src-gen']
+ include '**/*.cpp'
+ }
+ exportedHeaders {
+ srcDirs = ['src-gen']
+ }
+ lib project: ':runtime:org.eclipse.etrice.runtime.c', library: 'etrice_runtime_c', linkage: 'api'
+ lib project: ':runtime:org.eclipse.etrice.runtime.cpp', library: 'etrice_runtime_cpp', linkage: 'api'
+ }
+ binaries {
+ withType(SharedLibraryBinarySpec) { buildable = false }
+ all { cppCompiler.args '-g3' }
+ }
+ }
+ }
+}
+
+clean.delete 'src-gen' \ No newline at end of file
diff --git a/runtime/org.eclipse.etrice.modellib.java/build.gradle b/runtime/org.eclipse.etrice.modellib.java/build.gradle
new file mode 100644
index 000000000..f27641e6f
--- /dev/null
+++ b/runtime/org.eclipse.etrice.modellib.java/build.gradle
@@ -0,0 +1,32 @@
+plugins {
+ id 'java'
+}
+
+def generator = ':plugins:org.eclipse.etrice.generator.java'
+
+task generate(type: JavaExec, group: 'build', dependsOn: "$generator:classes") {
+ main = project(generator).mainClassName
+ classpath = project(generator).classpath
+ inputs.dir 'model'
+ outputs.dir 'src-gen'
+ args '-lib', '-msc_instr', '-genDir', 'src-gen',
+ 'model/ALogService.room',
+ 'model/TcpService.room',
+ 'model/TimingService.room'
+}
+
+dependencies {
+ compile project(':runtime:org.eclipse.etrice.runtime.java')
+}
+
+sourceSets {
+ main {
+ java {
+ srcDirs = ['src-gen']
+ }
+ }
+}
+
+compileJava.dependsOn generate
+
+clean.delete 'src-gen' \ No newline at end of file
diff --git a/runtime/org.eclipse.etrice.runtime.c/build.gradle b/runtime/org.eclipse.etrice.runtime.c/build.gradle
new file mode 100644
index 000000000..ce88e15c8
--- /dev/null
+++ b/runtime/org.eclipse.etrice.runtime.c/build.gradle
@@ -0,0 +1,23 @@
+plugins {
+ id 'c'
+}
+
+model {
+ components {
+ etrice_runtime_c(NativeLibrarySpec) {
+ sources.c {
+ source {
+ srcDirs = ['src/common', 'src/config', 'src/platforms/MT_WIN_MinGW', 'src/util']
+ include '**/*.c'
+ }
+ exportedHeaders {
+ srcDirs = ['src/common', 'src/config', 'src/platforms/MT_WIN_MinGW', 'src/util']
+ }
+ }
+ binaries {
+ withType(SharedLibraryBinarySpec) { buildable = false }
+ all { cCompiler.args '-g3' }
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/runtime/org.eclipse.etrice.runtime.cpp/build.gradle b/runtime/org.eclipse.etrice.runtime.cpp/build.gradle
new file mode 100644
index 000000000..63e95beac
--- /dev/null
+++ b/runtime/org.eclipse.etrice.runtime.cpp/build.gradle
@@ -0,0 +1,24 @@
+plugins {
+ id 'cpp'
+}
+
+model {
+ components {
+ etrice_runtime_cpp(NativeLibrarySpec) {
+ sources.cpp {
+ source {
+ srcDirs = ['src', 'src-gen']
+ include '**/*.cpp'
+ }
+ exportedHeaders {
+ srcDirs = ['src', 'src-gen']
+ }
+ lib project: ':runtime:org.eclipse.etrice.runtime.c', library: 'etrice_runtime_c', linkage: 'api'
+ }
+ binaries {
+ withType(SharedLibraryBinarySpec) { buildable = false }
+ all { cppCompiler.args '-g3' }
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/runtime/org.eclipse.etrice.runtime.java/build.gradle b/runtime/org.eclipse.etrice.runtime.java/build.gradle
new file mode 100644
index 000000000..a38c8a95f
--- /dev/null
+++ b/runtime/org.eclipse.etrice.runtime.java/build.gradle
@@ -0,0 +1,11 @@
+plugins {
+ id 'java'
+}
+
+sourceSets {
+ main {
+ java {
+ srcDirs = ['src', 'src-gen']
+ }
+ }
+} \ No newline at end of file
diff --git a/runtime/org.eclipse.etrice.runtime.java/src-gen/org/eclipse/etrice/runtime/java/modelbase/RTSystemServicesProtocol.java b/runtime/org.eclipse.etrice.runtime.java/src-gen/org/eclipse/etrice/runtime/java/modelbase/RTSystemServicesProtocol.java
index 113008b8b..aee9ab308 100644
--- a/runtime/org.eclipse.etrice.runtime.java/src-gen/org/eclipse/etrice/runtime/java/modelbase/RTSystemServicesProtocol.java
+++ b/runtime/org.eclipse.etrice.runtime.java/src-gen/org/eclipse/etrice/runtime/java/modelbase/RTSystemServicesProtocol.java
@@ -1,6 +1,14 @@
package org.eclipse.etrice.runtime.java.modelbase;
import org.eclipse.etrice.runtime.java.messaging.Message;
+import org.eclipse.etrice.runtime.java.modelbase.EventMessage;
+import org.eclipse.etrice.runtime.java.modelbase.EventWithDataMessage;
+import org.eclipse.etrice.runtime.java.modelbase.IInterfaceItemOwner;
+import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase;
+import org.eclipse.etrice.runtime.java.modelbase.PortBase;
+import org.eclipse.etrice.runtime.java.modelbase.ReplicatedPortBase;
+import org.eclipse.etrice.runtime.java.debugging.DebuggingService;
+import static org.eclipse.etrice.runtime.java.etunit.EtUnit.*;
@@ -34,6 +42,12 @@ public class RTSystemServicesProtocol {
}
public RTSystemServicesProtocolPort(IInterfaceItemOwner actor, String name, int localId, int idx) {
super(actor, name, localId, idx);
+ DebuggingService.getInstance().addPortInstance(this);
+ }
+
+ public void destroy() {
+ DebuggingService.getInstance().removePortInstance(this);
+ super.destroy();
}
@Override
@@ -42,14 +56,15 @@ public class RTSystemServicesProtocol {
return;
EventMessage msg = (EventMessage) m;
if (0 < msg.getEvtId() && msg.getEvtId() < MSG_MAX) {
- if (msg instanceof EventWithDataMessage)
- getActor().receiveEvent(this, msg.getEvtId(), ((EventWithDataMessage)msg).getData());
- else
- getActor().receiveEvent(this, msg.getEvtId(), null);
+ DebuggingService.getInstance().addMessageAsyncIn(getPeerAddress(), getAddress(), messageStrings[msg.getEvtId()]);
+ if (msg instanceof EventWithDataMessage)
+ getActor().receiveEvent(this, msg.getEvtId(), ((EventWithDataMessage)msg).getData());
+ else
+ getActor().receiveEvent(this, msg.getEvtId(), null);
}
}
-
+
// sent messages
}
@@ -59,23 +74,23 @@ public class RTSystemServicesProtocol {
public RTSystemServicesProtocolReplPort(IInterfaceItemOwner actor, String name, int localId) {
super(actor, name, localId);
}
-
+
public int getReplication() {
return getNInterfaceItems();
}
-
+
public int getIndexOf(InterfaceItemBase ifitem){
return ifitem.getIdx();
- }
-
+ }
+
public RTSystemServicesProtocolPort get(int idx) {
return (RTSystemServicesProtocolPort) getInterfaceItem(idx);
}
-
+
protected InterfaceItemBase createInterfaceItem(IInterfaceItemOwner rcv, String name, int lid, int idx) {
return new RTSystemServicesProtocolPort(rcv, name, lid, idx);
}
-
+
// outgoing messages
}
@@ -88,6 +103,12 @@ public class RTSystemServicesProtocol {
}
public RTSystemServicesProtocolConjPort(IInterfaceItemOwner actor, String name, int localId, int idx) {
super(actor, name, localId, idx);
+ DebuggingService.getInstance().addPortInstance(this);
+ }
+
+ public void destroy() {
+ DebuggingService.getInstance().removePortInstance(this);
+ super.destroy();
}
@Override
@@ -96,27 +117,31 @@ public class RTSystemServicesProtocol {
return;
EventMessage msg = (EventMessage) m;
if (0 < msg.getEvtId() && msg.getEvtId() < MSG_MAX) {
- if (msg instanceof EventWithDataMessage)
- getActor().receiveEvent(this, msg.getEvtId(), ((EventWithDataMessage)msg).getData());
- else
- getActor().receiveEvent(this, msg.getEvtId(), null);
+ DebuggingService.getInstance().addMessageAsyncIn(getPeerAddress(), getAddress(), messageStrings[msg.getEvtId()]);
+ if (msg instanceof EventWithDataMessage)
+ getActor().receiveEvent(this, msg.getEvtId(), ((EventWithDataMessage)msg).getData());
+ else
+ getActor().receiveEvent(this, msg.getEvtId(), null);
}
}
-
+
// sent messages
public void executeInitialTransition() {
+ DebuggingService.getInstance().addMessageAsyncOut(getAddress(), getPeerAddress(), messageStrings[IN_executeInitialTransition]);
if (getPeerAddress()!=null)
getPeerMsgReceiver().receive(new EventMessage(getPeerAddress(), IN_executeInitialTransition));
- }
+ }
public void startDebugging() {
+ DebuggingService.getInstance().addMessageAsyncOut(getAddress(), getPeerAddress(), messageStrings[IN_startDebugging]);
if (getPeerAddress()!=null)
getPeerMsgReceiver().receive(new EventMessage(getPeerAddress(), IN_startDebugging));
- }
+ }
public void stopDebugging() {
+ DebuggingService.getInstance().addMessageAsyncOut(getAddress(), getPeerAddress(), messageStrings[IN_stopDebugging]);
if (getPeerAddress()!=null)
getPeerMsgReceiver().receive(new EventMessage(getPeerAddress(), IN_stopDebugging));
- }
+ }
}
// replicated port class
@@ -125,23 +150,23 @@ public class RTSystemServicesProtocol {
public RTSystemServicesProtocolConjReplPort(IInterfaceItemOwner actor, String name, int localId) {
super(actor, name, localId);
}
-
+
public int getReplication() {
return getNInterfaceItems();
}
-
+
public int getIndexOf(InterfaceItemBase ifitem){
return ifitem.getIdx();
- }
-
+ }
+
public RTSystemServicesProtocolConjPort get(int idx) {
return (RTSystemServicesProtocolConjPort) getInterfaceItem(idx);
}
-
+
protected InterfaceItemBase createInterfaceItem(IInterfaceItemOwner rcv, String name, int lid, int idx) {
return new RTSystemServicesProtocolConjPort(rcv, name, lid, idx);
}
-
+
// incoming messages
public void executeInitialTransition(){
for (InterfaceItemBase item : getItems()) {
diff --git a/settings.gradle b/settings.gradle
index 73dda4b9d..58f8783fc 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -1,4 +1,4 @@
-include 'plugins:org.eclipse.etrice.core.common',
+include 'plugins:org.eclipse.etrice.core.common',
'plugins:org.eclipse.etrice.core.fsm',
'plugins:org.eclipse.etrice.core.room',
'plugins:org.eclipse.etrice.core.config',
@@ -13,4 +13,15 @@ include 'plugins:org.eclipse.etrice.core.common',
'plugins:org.eclipse.etrice.generator.gnuplot',
'plugins:org.eclipse.etrice.generator.c',
'plugins:org.eclipse.etrice.generator.cpp',
- 'plugins:org.eclipse.etrice.generator.java' \ No newline at end of file
+ 'plugins:org.eclipse.etrice.generator.java',
+ 'plugins:org.eclipse.etrice.abstractexec.behavior',
+ 'plugins:org.eclipse.etrice.etunit.converter',
+
+ 'runtime:org.eclipse.etrice.modellib.c',
+ 'runtime:org.eclipse.etrice.modellib.cpp',
+ 'runtime:org.eclipse.etrice.modellib.java',
+ 'runtime:org.eclipse.etrice.runtime.c',
+ 'runtime:org.eclipse.etrice.runtime.cpp',
+ 'runtime:org.eclipse.etrice.runtime.java',
+
+ 'tests:org.eclipse.etrice.generator.common.tests' \ No newline at end of file
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
diff --git a/tests/org.eclipse.etrice.generator.java.tests/build.gradle b/tests/org.eclipse.etrice.generator.java.tests/build.gradle
new file mode 100644
index 000000000..6e4f72074
--- /dev/null
+++ b/tests/org.eclipse.etrice.generator.java.tests/build.gradle
@@ -0,0 +1,32 @@
+plugins {
+ id 'java'
+}
+
+dependencies {
+ compile project(':runtime:org.eclipse.etrice.runtime.java')
+ compile project(':runtime:org.eclipse.etrice.modellib.java')
+}
+
+sourceSets {
+ main {
+ java {
+ srcDirs = ['src', 'src-gen']
+ }
+ }
+}
+
+/*def createTestTasks(name, models, options) {
+
+}*/
+
+task gen(type: JavaExec, dependsOn: ':plugins:org.eclipse.etrice.generator.java:classes') {
+ main = 'org.eclipse.etrice.generator.java.Main'
+ classpath = project(':plugins:org.eclipse.etrice.generator.java').sourceSets.main.runtimeClasspath
+ args 'ActorCommunicationTest.room'
+}
+
+task run(type: JavaExec, dependsOn: classes) {
+ main = 'DynamicActorTest1.Node_node_da1TestRunner'
+ classpath = sourceSets.main.runtimeClasspath
+ args '-run_as_test'
+} \ No newline at end of file

Back to the top