summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuergen Haug2012-12-02 10:53:16 (EST)
committerJuergen Haug2012-12-02 10:53:16 (EST)
commit771bf9fcd7f57013960c934c2addf2f37bd091e7 (patch)
tree1020908dde3690880b384bb14ba7ac371ddbaaac
parent6a8e70e44eb919b4fd328a7113357ae7999e3558 (diff)
downloadorg.eclipse.etrice-771bf9fcd7f57013960c934c2addf2f37bd091e7.zip
org.eclipse.etrice-771bf9fcd7f57013960c934c2addf2f37bd091e7.tar.gz
org.eclipse.etrice-771bf9fcd7f57013960c934c2addf2f37bd091e7.tar.bz2
[CQ][tests] java and c tests updated for StaticConfigTestrefs/changes/95/8995/1
-rw-r--r--tests/org.eclipse.etrice.generator.c.tests/make.xml66
-rw-r--r--tests/org.eclipse.etrice.generator.java.tests/make.xml31
-rw-r--r--tests/org.eclipse.etrice.generator.java.tests/src/StaticConfigTest/External_Type_Test.java9
3 files changed, 84 insertions, 22 deletions
diff --git a/tests/org.eclipse.etrice.generator.c.tests/make.xml b/tests/org.eclipse.etrice.generator.c.tests/make.xml
index 3100791..98c6b1e 100644
--- a/tests/org.eclipse.etrice.generator.c.tests/make.xml
+++ b/tests/org.eclipse.etrice.generator.c.tests/make.xml
@@ -71,6 +71,7 @@
<copy todir="models" >
<fileset dir="../org.eclipse.etrice.generator.common.tests/models">
<include name="*.room"/>
+ <include name="*.config"/>
</fileset>
<fileset dir="${modellib.path}/model">
<include name="TimingService.room"/>
@@ -78,6 +79,7 @@
<include name="Language.room"/>
</fileset>
</copy>
+ <move file="models/StaticConfigTest_C.room" toFile="models/StaticConfigTest.room"/>
</target>
<!--
@@ -89,6 +91,7 @@
<pathelement location="../../plugins/org.eclipse.etrice.generator.c/bin"/>
<pathelement location="../../plugins/org.eclipse.etrice.generator.doc/bin"/>
<pathelement location="../../plugins/org.eclipse.etrice.generator/bin"/>
+ <pathelement location="../../plugins/org.eclipse.etrice.generator.config/bin"/>
<pathelement location="../../plugins/org.eclipse.etrice.core.room/bin"/>
<pathelement location="../../plugins/org.eclipse.etrice.core.etphys/bin"/>
<pathelement location="../../plugins/org.eclipse.etrice.core.etmap/bin"/>
@@ -115,6 +118,8 @@
<arg value="${c.tests.model.path}/ChoicePointTest.room"/>
<arg value="${c.tests.model.path}/HandlerTest.room"/>
<arg value="${c.tests.model.path}/SendingDataTestC.room"/>
+ <arg value="${c.tests.model.path}/StaticConfigTest.room"/>
+ <arg value="${c.tests.model.path}/StaticConfigTest.config"/>
<!-- modelib.c -->
<!-- not needed yet
@@ -177,6 +182,7 @@
<arg value="-I../../src-gen/ChoicePointTest"/>
<arg value="-I../../src-gen/HandlerTest"/>
<arg value="-I../../src-gen/SendingDataTestC"/>
+ <arg value="-I../../src-gen/StaticConfigTest"/>
<arg value="-I${c-runtime.path}/src/common"/>
<arg value="-I${c-runtime.path}/src/config"/>
<arg value="-I${c-runtime.path}/src/platforms/generic"/>
@@ -211,6 +217,7 @@
<arg value="-I../../src-gen/ChoicePointTest"/>
<arg value="-I../../src-gen/HandlerTest"/>
<arg value="-I../../src-gen/SendingDataTestC"/>
+ <arg value="-I../../src-gen/StaticConfigTest"/>
<arg value="-I${c-runtime.path}/src/common"/>
<arg value="-I${c-runtime.path}/src/config"/>
<arg value="-I${c-runtime.path}/src/platforms/generic"/>
@@ -245,6 +252,7 @@
<arg value="-I../../src-gen/ChoicePointTest"/>
<arg value="-I../../src-gen/HandlerTest"/>
<arg value="-I../../src-gen/SendingDataTestC"/>
+ <arg value="-I../../src-gen/StaticConfigTest"/>
<arg value="-I${c-runtime.path}/src/common"/>
<arg value="-I${c-runtime.path}/src/config"/>
<arg value="-I${c-runtime.path}/src/platforms/generic"/>
@@ -278,6 +286,55 @@
<!-- library has to be in the last position -->
<arg value="-lorg.eclipse.etrice.runtime.c"/>
</exec>
+
+ <!-- compile and link StaticConfigTest-->
+ <mkdir dir="bin/StaticConfigTest"/>
+ <exec dir="bin/StaticConfigTest" executable="gcc" failonerror="true" output="${output}/build.txt" append="true">
+ <arg value="-I../../src-gen/ChoicePointTest"/>
+ <arg value="-I../../src-gen/HandlerTest"/>
+ <arg value="-I../../src-gen/SendingDataTestC"/>
+ <arg value="-I../../src-gen/StaticConfigTest"/>
+ <arg value="-I${c-runtime.path}/src/common"/>
+ <arg value="-I${c-runtime.path}/src/config"/>
+ <arg value="-I${c-runtime.path}/src/platforms/generic"/>
+ <arg value="-c"/>
+ <arg value="-g3"/>
+ <arg value="-O0"/>
+ <arg value="-Wall"/>
+ <arg value="../../src-gen/StaticConfigTest/Tester_ac.c"/>
+ <arg value="../../src-gen/StaticConfigTest/Testee_1_ac.c"/>
+ <arg value="../../src-gen/StaticConfigTest/Testee_2_ac.c"/>
+ <arg value="../../src-gen/StaticConfigTest/Testee_Super2_ac.c"/>
+ <arg value="../../src-gen/StaticConfigTest/Data_1_dc.c"/>
+ <arg value="../../src-gen/StaticConfigTest/Data_Super1_dc.c"/>
+ <arg value="../../src-gen/StaticConfigTest/Data_2_dc.c"/>
+ <arg value="../../src-gen/StaticConfigTest/Data_3_dc.c"/>
+ <arg value="../../src-gen/StaticConfigTest/TestProtocol.c"/>
+ <arg value="../../src-gen/StaticConfigTest/TestProtocolWithDataClass.c"/>
+ <arg value="../../src-gen/StaticConfigTest/Top_ac.c"/>
+ <arg value="../../src-gen/StaticConfigTest/SubSystem_StaticConfigTest.c"/>
+ <arg value="../../src-gen/StaticConfigTest/SubSystem_StaticConfigTest_Runner.c"/>
+ </exec>
+ <exec dir="bin/StaticConfigTest" executable="gcc" failonerror="true" output="${output}/build.txt" append="true">
+ <arg value="-L../../../../runtime/org.eclipse.etrice.runtime.c/bin"/>
+ <arg value="-oStaticConfigTest.exe"/>
+ <arg value="Tester_ac.o"/>
+ <arg value="Testee_1_ac.o"/>
+ <arg value="Testee_2_ac.o"/>
+ <arg value="Testee_Super2_ac.o"/>
+ <arg value="Data_1_dc.o"/>
+ <arg value="Data_Super1_dc.o"/>
+ <arg value="Data_2_dc.o"/>
+ <arg value="Data_3_dc.o"/>
+ <arg value="TestProtocol.o"/>
+ <arg value="TestProtocolWithDataClass.o"/>
+ <arg value="Top_ac.o"/>
+ <arg value="SubSystem_StaticConfigTest.o"/>
+ <arg value="SubSystem_StaticConfigTest_Runner.o"/>
+
+ <!-- library has to be in the last position -->
+ <arg value="-lorg.eclipse.etrice.runtime.c"/>
+ </exec>
</target>
<!--
@@ -288,6 +345,7 @@
<exec dir="./" resolveexecutable="true" executable="./bin/HandlerTest/HandlerTest.exe"/>
<exec dir="./" resolveexecutable="true" executable="./bin/ChoicePointTest/ChoicePointTest.exe"/>
<exec dir="./" resolveexecutable="true" executable="./bin/SendingDataTestC/SendingDataTestC.exe"/>
+ <exec dir="./" resolveexecutable="true" executable="./bin/StaticConfigTest/StaticConfigTest.exe"/>
</target>
<!--
@@ -324,6 +382,13 @@
<arg value="./tmp/SendingDataTestC.etu"/>
<classpath refid="clspath"/>
</java>
+
+ <java output="${output}/convert.txt" append="true" classname="org.eclipse.etrice.etunit.converter.EtUnitReportConverter" fork="true" failonerror="true">
+ <arg value="-suite"/>
+ <arg value="org.eclipse.etrice.generator.c.tests.StaticConfigTest"/>
+ <arg value="./tmp/StaticConfigTest.etu"/>
+ <classpath refid="clspath"/>
+ </java>
</target>
<!--
@@ -333,6 +398,7 @@
<move file="./tmp/HandlerTest.xml" tofile="./tmp/CHandlerTest.xml"/>
<move file="./tmp/ChoicePointTest.xml" tofile="./tmp/CChoicePointTest.xml"/>
<move file="./tmp/SendingDataTestC.xml" tofile="./tmp/CSendingDataTest.xml"/>
+ <move file="./tmp/StaticConfigTest.xml" tofile="./tmp/StaticConfigTest.xml"/>
<copy todir="${test.results}" >
<fileset dir="./tmp">
<include name="*.xml"/>
diff --git a/tests/org.eclipse.etrice.generator.java.tests/make.xml b/tests/org.eclipse.etrice.generator.java.tests/make.xml
index 2e5ca73..c9d2693 100644
--- a/tests/org.eclipse.etrice.generator.java.tests/make.xml
+++ b/tests/org.eclipse.etrice.generator.java.tests/make.xml
@@ -51,7 +51,6 @@
<delete dir="${output}"/>
<delete dir="${test.results}"/>
<delete dir="src-gen"/>
- <delete dir="src-gen2"/>
<delete dir="tmp"/>
</target>
@@ -72,6 +71,7 @@
<include name="Language.room"/>
</fileset>
</copy>
+ <move file="models/StaticConfigTest_Java.room" toFile="models/StaticConfigTest.room"/>
</target>
<!--
@@ -84,6 +84,7 @@
<pathelement location="../../plugins/org.eclipse.etrice.generator.config/bin"/>
<pathelement location="../../plugins/org.eclipse.etrice.generator.doc/bin"/>
<pathelement location="../../plugins/org.eclipse.etrice.generator/bin"/>
+ <pathelement location="../../plugins/org.eclipse.etrice.generator.config/bin"/>
<pathelement location="../../plugins/org.eclipse.etrice.core.room/bin"/>
<pathelement location="../../plugins/org.eclipse.etrice.core.etphys/bin"/>
<pathelement location="../../plugins/org.eclipse.etrice.core.etmap/bin"/>
@@ -113,18 +114,8 @@
<arg value="${java.tests.model.path}/PingPongThreadReplPortTest.room"/>
<arg value="${java.tests.model.path}/SendingDataTestJava.room"/>
<arg value="${java.tests.model.path}/TCPTest.room"/>
- <classpath refid="clspath"/>
- </java>
-
- <!-- the following is a work-around for the configuration which doesn't work in the prsence of a LogicalSystems.
- When all models are generated together, there is a logical system.
- So we have to move awy src-gen since this is cleared by the generator and compile src-gen and src-gen2 separately
- -->
- <deltree dir="src-gen2"/>
- <move file="src-gen" tofile="src-gen2"/>
-
- <java output="${output}/generate.txt" append="true" error="${output}/generate_err.txt" classname="org.eclipse.etrice.generator.java.Main" fork="true" failonerror="true">
- <arg value="${java.tests.model.path}/ConfigTest.config"/>
+ <arg value="${java.tests.model.path}/StaticConfigTest.room"/>
+ <arg value="${java.tests.model.path}/StaticConfigTest.config"/>
<classpath refid="clspath"/>
</java>
</target>
@@ -134,12 +125,7 @@
-->
<target name="compile" depends="generate">
<mkdir dir="${bin.path}"/>
- <javac srcdir="src-gen"
- destdir="${bin.path}"
- classpath="${runtime.path}/bin"
- debug="on"
- />
- <javac srcdir="src-gen2"
+ <javac srcdir="src-gen:src"
destdir="${bin.path}"
classpath="${runtime.path}/bin"
debug="on"
@@ -151,7 +137,7 @@
-->
<target name="run" depends="compile">
<mkdir dir="tmp/log"/>
- <java output="${output}/runConfigTest.txt" classname="ConfigTest.SubSystemConfigTestRunner" fork="true" failonerror="true">
+ <java output="${output}/runStaticConfigTest.txt" classname="StaticConfigTest.SubSystem_StaticConfigTestRunner" fork="true" failonerror="true">
<arg value="-run_as_test"/>
<classpath path="${bin.path};${runtime.path}/bin;${modellib.path}/bin"/>
</java>
@@ -239,8 +225,8 @@
<java output="${output}/convert.txt" append="true" classname="org.eclipse.etrice.etunit.converter.EtUnitReportConverter" fork="true" failonerror="true">
<arg value="-suite"/>
- <arg value="org.eclipse.etrice.generator.java.tests.ConfigPTest"/>
- <arg value="./tmp/ConfigTest.etu"/>
+ <arg value="org.eclipse.etrice.generator.java.tests.StaticConfigTest"/>
+ <arg value="./tmp/StaticConfigTest.etu"/>
<classpath refid="clspath"/>
</java>
</target>
@@ -251,6 +237,7 @@
<target name="copy_results" depends="set_tr">
<move file="./tmp/HandlerTest.xml" tofile="./tmp/JavaHandlerTest.xml"/>
<move file="./tmp/ChoicePointTest.xml" tofile="./tmp/JavaChoicePointTest.xml"/>
+ <move file="./tmp/StaticConfigTest.xml" tofile="./tmp/StaticConfigTest.xml"/>
<copy todir="${test.results}" >
<fileset dir="./tmp">
<include name="*.xml"/>
diff --git a/tests/org.eclipse.etrice.generator.java.tests/src/StaticConfigTest/External_Type_Test.java b/tests/org.eclipse.etrice.generator.java.tests/src/StaticConfigTest/External_Type_Test.java
new file mode 100644
index 0000000..c9f1dc3
--- /dev/null
+++ b/tests/org.eclipse.etrice.generator.java.tests/src/StaticConfigTest/External_Type_Test.java
@@ -0,0 +1,9 @@
+package StaticConfigTest;
+
+public class External_Type_Test {
+
+ // deep copy
+ public External_Type_Test deepCopy() {
+ return new External_Type_Test();
+ }
+}