Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 63b4ab7d3f68fb3df746464fa642768db32102a3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
<?xml version="1.0"?>
<project name="org.eclipse.etrice.generator.common.tests">

	<target name="testing" depends="copyModels">

		<!-- add test here, testid==testSuiteFileName -->
		<test testid="ActorCommunicationTest" models="${models.path}/ActorCommunicationTest.room ${models.path}/GenericPhysical.etphys ${models.path}/TimingService.room" />
		<test testid="ChoicePointTest" models="${models.path}/ChoicePointTest.room ${models.path}/GenericPhysical.etphys" />
		<test testid="ChoicePointTestExtended" models="${models.path}/ChoicePointTestExtended.room ${models.path}/GenericPhysical.etphys" />
		<test testid="DataDrivenTest" models="${models.path}/DataDrivenTest.room ${models.path}/GenericPhysical.etphys ${models.path}/TimingService.room" />
		<test testid="EnumTest" models="${models.path}/EnumTest.room ${models.path}/GenericPhysical.etphys" />
		<test testid="CompileTests" models="${models.path}/CompileTests.room ${models.path}/GenericPhysical.etphys ${models.path}/DetailExpressionTest.room ${models.path}/StatemachineInterfaceTest.room ${models.path}/StatemachineInterfaceInheritedTest.room ${models.path}/StatemachineInterfaceTest.room ${models.path}/ContinuationTransitionTest.room ${models.path}/TimingService.room" />
		<test testid="HandlerTest" models="${models.path}/HandlerTest.room ${models.path}/GenericPhysical.etphys" />
		<test testid="OperationInheritanceTest" models="${models.path}/OperationInheritanceTest.room ${models.path}/GenericPhysical.etphys" />
		<test testid="PingPongThreadTest" models="${models.path}/PingPongThreadTest.etmap ${models.path}/PingPongThreadTest.room ${models.path}/TimingService.room" />
		<test testid="PingPongThreadReplPortTest" models="${models.path}/PingPongThreadReplPortTest.etmap ${models.path}/PingPongThreadReplPortTest.room ${models.path}/TimingService.room" />


		<echo>done with ${ant.project.name}</echo>
	</target>

	<target name="copyModels" depends="setVars">
		<copy todir="${models.path}">
			<fileset dir="../org.eclipse.etrice.generator.common.tests/models"/>
		</copy>
		<copy todir="${models.path}" >
			<fileset dir="${modellib.path}/model">
				<include name="*.room"/>
				<include name="*.etphys"/>
			</fileset>
		</copy>
	</target>

	<!-- ################################################################ -->

	<!-- global properties -->
	<!-- test.results, target.platform -->

	<!-- private properties-->
	<property name="models.path" value="./models"/>
	<property name="testlog.path" value="./log/testlog"/>
	<property name="output" value="./output"/>
	<property name="bin.path" value="./bin"/>

	<property name="run.msTimout" value="5000"/>

	<!-- show ALL used variables -->
	<target name="showVars">
		<echo>   ant.project.name               = ${ant.project.name}                 </echo>
		<echo>   runtime.path                   = ${runtime.path}                     </echo>
		<echo>   testlog.path                   = ${testlog.path}                     </echo>
		<echo>   test.results                   = ${test.results}                     </echo>
		<echo>   output                         = ${output}                           </echo>
		<echo>   bin.path                       = ${bin.path}                         </echo>
		<echo>   target.platform                = ${target.platform}                  </echo>
		<echo>   modellib.path                  = ${modellib.path}                    </echo>
		<echo>   models.path                    = ${models.path}                      </echo>
		<echo>   basedir                        = ${basedir}                          </echo>
		
		<echo>   org.eclipse.emf.ecore          = ${org.eclipse.emf.ecore}            </echo>
		<echo>   org.eclipse.emf.common         = ${org.eclipse.emf.common}           </echo>
		<echo>   org.eclipse.emf.ecore.xmi      = ${org.eclipse.emf.ecore.xmi}        </echo>
		<echo>   com.google.inject              = ${com.google.inject}                </echo>
		<echo>   com.google.guava               = ${com.google.guava}                 </echo>
		<echo>   org.eclipse.equinox.common     = ${org.eclipse.equinox.common}       </echo>
		<echo>   org.eclipse.xtext              = ${org.eclipse.xtext}                </echo>
        <echo>   org.eclipse.xtext.util         = ${org.eclipse.xtext.util}           </echo>
		<echo>   org.eclipse.xtext.common.types = ${org.eclipse.xtext.common.types}   </echo>
		<echo>   org.eclipse.xtend.lib          = ${org.eclipse.xtend.lib}            </echo>
		<echo>   org.eclipse.xtext.xbase.lib    = ${org.eclipse.xtext.xbase.lib}      </echo>
		<echo>   org.apache.log4j               = ${org.apache.log4j}                 </echo>
		<echo>   org.antlr.runtime              = ${org.antlr.runtime}                </echo>
		<echo>   javax.inject                   = ${javax.inject}                     </echo>
		
		<pathconvert property="classpathProp" refid="etrice.clspath"/>
		<echo>   etrice.clspath                 = ${classpathProp}                    </echo>
	</target>

	<!-- set global properties if not set-->
	<target name="set_local_tr" unless="test.results">
		<property name="test.results" value="./results"/>
	</target>
	<target name="set_local_tp" unless="target.platform">
		<property name="target.platform" value="${eclipse.home}"/>
	</target>

	<target name="setVars" depends="set_local_tp,set_local_tr,set_etrice_clspath,showVars"/>

	<target name="set_etrice_clspath">
		<path id="etrice.clspath">
			<pathelement location="../../plugins/org.eclipse.etrice.generator.c/bin"/>
			<pathelement location="../../plugins/org.eclipse.etrice.generator.java/bin"/>
			<pathelement location="../../plugins/org.eclipse.etrice.generator.cpp/bin"/>
			<pathelement location="../../plugins/org.eclipse.etrice.etunit.converter/bin"/>
			<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.fsm/bin" />
			<pathelement location="../../plugins/org.eclipse.etrice.generator/bin"/>
			<pathelement location="../../plugins/org.eclipse.etrice.generator.gnuplot/bin"/>
			<pathelement location="../../plugins/org.eclipse.etrice.core.common/bin"/>
			<pathelement location="../../plugins/org.eclipse.etrice.core.fsm/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"/>
			<pathelement location="../../plugins/org.eclipse.etrice.core.config/bin"/>
			<pathelement location="../../plugins/org.eclipse.etrice.core.genmodel.fsm/bin" />
			<pathelement location="../../plugins/org.eclipse.etrice.core.genmodel/bin"/>
			
			<!-- resolve dependencies using Oomph util in properties of launch config -->
			<pathelement location="${org.eclipse.emf.ecore}"/>
			<pathelement location="${org.eclipse.emf.common}"/>
			<pathelement location="${org.eclipse.emf.ecore.xmi}"/>
			<pathelement location="${com.google.inject}"/>
			<pathelement location="${com.google.guava}"/>
			<pathelement location="${org.eclipse.equinox.common}"/>
			<pathelement location="${org.eclipse.xtext}"/>
			<pathelement location="${org.eclipse.xtext.util}"/>
			<pathelement location="${org.eclipse.xtext.common.types}"/>
			<pathelement location="${org.eclipse.xtend.lib}"/>
			<pathelement location="${org.eclipse.xtext.xbase.lib}"/>
			<pathelement location="${org.apache.log4j}"/>
			<pathelement location="${org.antlr.runtime}"/>
			<pathelement location="${javax.inject}"/>
			
			<!-- resolve if used from Buckminster Ant task -->
			<fileset dir="${target.platform}/plugins/">
				<include name="org.eclipse.emf.ecore_2.1*.jar" />
				<include name="org.eclipse.emf.common_2.1*.jar" />
				<include name="org.eclipse.emf.ecore.xmi_2.1*.jar" />
				<include name="com.google.inject_*.jar" />
				<include name="com.google.guava_1*.jar" />
				<include name="org.eclipse.equinox.common_3.*.jar" />
				<include name="org.apache.log4j_1.2*.jar" />
				<include name="org.antlr.runtime_3.2*.jar" />
				<include name="javax.inject_1.0*.jar" />

				<!-- Xtext 2.6 -->
				<include name="org.eclipse.xtext_2.6*.jar" />
				<include name="org.eclipse.xtext.util_2.6*.jar" />
				<include name="org.eclipse.xtext.common.types_2.6*.jar" />
				<include name="org.eclipse.xtend.lib_2.6*.jar" />
				<include name="org.eclipse.xtext.xbase.lib_2.6*.jar" />

				<!-- Xtext 2.7 -->
				<include name="org.eclipse.xtext_2.7*.jar" />
				<include name="org.eclipse.xtext.util_2.7*.jar" />
				<include name="org.eclipse.xtext.common.types_2.7*.jar" />
				<include name="org.eclipse.xtend.lib_2.7*.jar" />
				<include name="org.eclipse.xtext.xbase.lib_2.7*.jar" />

				<!-- Xtext 2.8 -->
				<include name="org.eclipse.xtext_2.8*.jar" />
				<include name="org.eclipse.xtext.util_2.8*.jar" />
				<include name="org.eclipse.xtext.common.types_2.8*.jar" />
				<include name="org.eclipse.xtend.lib_2.8*.jar" />
				<include name="org.eclipse.xtext.xbase.lib_2.8*.jar" />

				<!-- Xtext 2.10 -->
				<include name="org.eclipse.xtext_2.10*.jar" />
				<include name="org.eclipse.xtext.util_2.10*.jar" />
				<include name="org.eclipse.xtext.common.types_2.10*.jar" />
				<include name="org.eclipse.xtend.lib_2.10*.jar" />
				<include name="org.eclipse.xtext.xbase.lib_2.10*.jar" />
			</fileset>
		</path>
	</target>

	<!--
		clean: deletes all folders created by this script
	-->
	<target name="clean" depends="setVars">
		<delete dir="${testlog.path}"/>
		<!--deletes resulst from other script on server <delete dir="${test.results}"/>-->
		<delete dir="${output}"/>
		<delete dir="${bin.path}"/>
		<delete dir="${models.path}"/>
		<delete dir="log"/>
		<delete dir="src-gen"/>
	</target>

	<macrodef name="convert">
		<attribute name="testId"/>
		<sequential>
			<java output="${output}/convert.txt" append="true" classname="org.eclipse.etrice.etunit.converter.EtUnitReportConverter" fork="true" failonerror="true">
				<arg value="-suite"/>
				<arg value="${ant.project.name}.@{testId}"/>
				<arg value="${testlog.path}/@{testId}.etu"/>
				<classpath refid="etrice.clspath"/>
			</java>
		</sequential>
	</macrodef>
	
	<macrodef name="convertPre">
		<attribute name="testId"/>
		<sequential>
			<java output="${output}/convert.txt" append="true" classname="org.eclipse.etrice.etunit.converter.EtUnitReportConverter" fork="true" failonerror="true">
				<arg value="-presuite"/>
				<arg value="${ant.project.name}."/>
				<arg value="${testlog.path}/@{testId}.etu"/>
				<classpath refid="etrice.clspath"/>
			</java>
		</sequential>
	</macrodef>

	<!--
		copy_results: copies the *.xml results to their final destination
	-->
	<macrodef name="copyResult">
		<attribute name="testId"/>
		<attribute name="targetId" default=""/>
		<sequential>
			<mkdir dir="${test.results}"/>
			<move file="${testlog.path}/@{testId}.xml" tofile="${test.results}/@{targetId}@{testId}.xml"/>
		</sequential>
	</macrodef>

</project>

Back to the top