Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 75186023b05d88b3e0036e41c275189859213e61 (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
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
<?xml version="1.0"?>
<!--
	Ant makefile for building and running of tests.
	This includes invocation of the Java code generator and conversion of the etunit
	results into xunit xml.
	
	To work locally you should define in your environment
	ETRICE_TARGET_PLATFORM=path to the eclipse folder of your Juno installation
	ETRICE_C_RUNTIME=path to the org.eclipse.etrice.runtime.c folder (relative path doesn't work)
	ETRICE_GCC_PATH=folder where gcc resides
	
	@author Henrik Rentz-Reichert
-->
<project name="project" default="all">
	
	<property name="c.tests.model.path" value="./models"/>
	<property name="modellib.path" value="../../runtime/org.eclipse.etrice.modellib.c"/>
	<property name="runtime.path" value="../../runtime/org.eclipse.etrice.runtime.c"/>
	<property name="bin.path" value="./bin"/>
	<property name="xml.output" value="./tmp"/>
	<property name="output" value="./output"/>
	<property environment="env"/>

	
	<!--
		all: copies the models, generates, compiles, runs, converts and copies the results
	-->
	<target name="all" depends="convert,copy_results">
		<echo>done with org.eclipse.etrice.generator.c.tests</echo>
	</target>

	<!--
		set_tp: get the target.platform property from the environment var ETRICE_TARGET_PLATFORM if not set already
	-->
	<target name="set_tp" unless="target.platform">
		<echo>using local target platform</echo>
		<property name="target.platform" value="${env.ETRICE_TARGET_PLATFORM}"/>
	</target>

	<!--
		set_tr: sets the test.result property if not set already
	-->
	<target name="set_tr" unless="test.results">
		<echo>using local test result folder</echo>
		<property name="test.results" value="./results"/>
	</target>

	<!--
		set_platform: sets the runtime.platform property if not set already
	-->
	<target name="set_platform" unless="runtime.platform">
		<echo>using MinGW runtime platform</echo>
		<!--
		<property name="runtime.platform" value="MT_WIN_MinGW"/>
		-->
		<property name="runtime.platform" value="MT_POSIX_GENERIC_GCC"/>
	</target>

	<!--
		set_rp: sets the runtime.path from the ETRICE_C_RUNTIME environment variable property if not set already
	-->
	<target name="set_rp" unless="c-runtime.path">
		<echo>using local runtime folder</echo>
		<property name="c-runtime.path" value="${env.ETRICE_C_RUNTIME}"/>
	</target>

	<!--
		set_gcc_path: sets the gcc.path property from the ETRICE_GCC_PATH environment variable property if not set already
	-->
	<target name="set_gcc_path" unless="gcc.path">
		<echo>using gcc from path</echo>
		<property name="gcc.path" value="${env.ETRICE_GCC_PATH}"/>
	</target>
	
	<!--
		clean: deletes all folders created by this script
	-->
	<target name="clean" depends="set_tr,set_rp">
		<delete dir="${bin.path}"/>
		<delete dir="${c-runtime.path}/bin"/>
		<delete dir="models"/>
		<delete dir="${output}"/>
		<delete dir="src-gen"/>
		<delete dir="tmp"/>
	</target>
	
	<!--
		copy_models: copies the models from their original folders to the build location
	-->
	<target name="copy_models">
		<copy todir="models" >
			<fileset dir="../org.eclipse.etrice.generator.common.tests/models">
				<include name="*.room"/>
				<include name="*.config"/>
				<include name="*.etmap"/>
				<include name="*.etphys"/>
			</fileset>
			<fileset dir="${modellib.path}/model">
				<include name="TimingService.room"/>
				<include name="Types.room"/>
				<include name="Language.room"/>
			</fileset>
		</copy>
		<move file="models/StaticConfigTest_C.room" toFile="models/StaticConfigTest.room"/>
	</target>
	
	<!--
		generate: invokes the Java generator for the ROOM models
	-->
	<target name="generate" depends="set_tp,copy_models">
		<mkdir dir="${output}"/>
		<path id="clspath">
			<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.common/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/bin"/>
			<fileset dir="${target.platform}/plugins/">
				<include name="org.eclipse.emf.ecore_2.9*.jar" />
				<include name="org.eclipse.emf.common_2.9*.jar" />
				<include name="org.eclipse.emf.ecore.xmi_2.9*.jar" />
				<include name="org.eclipse.xtext_2.4*.jar" />
				<include name="com.google.inject_*.jar" />
				<include name="com.google.guava_1*.jar" />
				<include name="org.eclipse.equinox.common_3.6.*.jar" />
				<include name="org.eclipse.xtext.util_2.4*.jar" />
				<include name="org.eclipse.xtext.common.types_2.4*.jar" />
				<include name="org.eclipse.xtend.lib_2.4*.jar" />
				<include name="org.eclipse.xtext.xbase.lib_2.4*.jar" />
				<include name="org.apache.log4j_1.2*.jar" />
				<include name="org.antlr.runtime_3.2*.jar" />
				<include name="javax.inject_1.0*.jar" />
			</fileset>
		</path>

		<java output="${output}/generate.txt" error="${output}/generate_err.txt" classname="org.eclipse.etrice.generator.c.Main" fork="true" failonerror="true">
			<arg value="${c.tests.model.path}/generator.c.tests.etmap"/>
			<arg value="${c.tests.model.path}/generator.c.tests.config"/>
			<classpath refid="clspath"/>
		</java>
	</target>
	
	<!--
		compile_runtime: compiles the C runtime library
	-->
	<target name="compile_runtime" depends="clean,set_rp,set_gcc_path,set_platform">
		<mkdir dir="${c-runtime.path}/bin"/>
		<mkdir dir="${output}"/>
		<exec dir="${c-runtime.path}/bin" executable="${gcc.path}/gcc" failonerror="true" output="${output}/compile_runtime.txt">
			<arg value="-I${c-runtime.path}/src/common"/>
			<arg value="-I${c-runtime.path}/src/config"/>
			<arg value="-I${c-runtime.path}/src/platforms/${runtime.platform}"/>
			<arg value="-c"/>
			<arg value="-g3"/>
			<arg value="-O0"/>
			<arg value="-Wall"/>
			<!--<arg value="-ansi"/>-->
			<arg value="../src/common/debugging/etMSCLogger.c"/>
			<arg value="../src/common/etUnit/etUnit.c"/>
			<arg value="../src/common/messaging/etMessage.c"/>
			<arg value="../src/common/messaging/etMessageQueue.c"/>
			<arg value="../src/common/messaging/etMessageService.c"/>
			<arg value="../src/common/messaging/etSystemProtocol.c"/>
			<arg value="../src/common/helpers/etTimeHelpers.c"/>
			<arg value="../src/common/runtime/etRuntime.c"/>
			<arg value="../src/common/modelbase/etActor.c"/>
			<arg value="../src/common/modelbase/etPort.c"/>
			<arg value="../src/platforms/${runtime.platform}/etLogger.c"/>
			<arg value="../src/platforms/${runtime.platform}/etMutex.c"/>
			<arg value="../src/platforms/${runtime.platform}/etPlatformLifecycle.c"/>
			<arg value="../src/platforms/${runtime.platform}/etSema.c"/>
			<arg value="../src/platforms/${runtime.platform}/etThread.c"/>
			<arg value="../src/platforms/${runtime.platform}/etTime.c"/>
			<arg value="../src/platforms/${runtime.platform}/etTimer.c"/>
		</exec>
		<exec dir="${c-runtime.path}/bin" executable="ar" failonerror="true" output="${output}/compile_runtime.txt" append="true">
			<arg value="-r"/>
			<arg value="liborg.eclipse.etrice.runtime.c.a"/>
			<arg value="etActor.o"/>
			<arg value="etLogger.o"/>
			<arg value="etMessage.o"/>
			<arg value="etMessageQueue.o"/>
			<arg value="etMessageService.o"/>
			<arg value="etSystemProtocol.o"/>
			<arg value="etTimeHelpers.o"/>
			<arg value="etRuntime.o"/>
			<arg value="etMSCLogger.o"/>
			<arg value="etMutex.o"/>
			<arg value="etPlatformLifecycle.o"/>
			<arg value="etPort.o"/>
			<arg value="etSema.o"/>
			<arg value="etThread.o"/>
			<arg value="etTime.o"/>
			<arg value="etTimer.o"/>
			<arg value="etUnit.o"/>
		</exec>
	</target>
	
	<!--
		build: compiles and links the generated C sources
	-->
	<target name="build" depends="set_rp,set_gcc_path,set_platform,compile_runtime,generate">

		<!-- compile and link HandlerTest -->
		<mkdir dir="bin/HandlerTest"/>
		<exec dir="bin/HandlerTest" executable="${gcc.path}/gcc" failonerror="true" output="${output}/build.txt">
			<arg value="-I../../src-gen/"/>
			<arg value="-I../../src-gen/room/basic/service/timing/"/>
			<arg value="-I${c-runtime.path}/src/common"/>
			<arg value="-I${c-runtime.path}/src/config"/>
			<arg value="-I${c-runtime.path}/src/platforms/${runtime.platform}"/>
			<arg value="-c"/>
			<arg value="-g3"/>
			<arg value="-O0"/>
			<arg value="-Wall"/>
			<!--<arg value="-ansi"/>-->
			<arg value="../../src-gen/HandlerTest/HandlerTest_Top.c"/>
			<arg value="../../src-gen/HandlerTest/HandlerUser.c"/>
			<arg value="../../src-gen/HandlerTest/node3_hdTest.c"/>
			<arg value="../../src-gen/HandlerTest/node3_hdTest_Runner.c"/>
			<arg value="../../src-gen/HandlerTest/Tester.c"/>
			<arg value="../../src-gen/HandlerTest/TestProtocol.c"/>
			<arg value="../../src-gen/room/basic/service/timing/ATimingService.c"/>
			<arg value="../../src-gen/room/basic/service/timing/PTimer.c"/>
		</exec>
		<exec dir="bin/HandlerTest" executable="${gcc.path}/gcc" failonerror="true" output="${output}/build.txt" append="true">
			<arg value="-L${c-runtime.path}/bin"/>
			<arg value="-oHandlerTest.exe"/>
			<arg value="HandlerTest_Top.o"/>
			<arg value="HandlerUser.o"/>
			<arg value="Tester.o"/>
			<arg value="TestProtocol.o"/>
			<arg value="node3_hdTest.o"/>
			<arg value="node3_hdTest_Runner.o"/>
			
			<!-- library has to be in the last position -->
			<arg value="-lorg.eclipse.etrice.runtime.c"/>
			<arg value="-lpthread"/>
			<arg value="-lrt"/>
		</exec>
		
		<!-- compile and link ChoicepointTest -->
		<mkdir dir="bin/ChoicePointTest"/>
		<exec dir="bin/ChoicePointTest" executable="${gcc.path}/gcc" failonerror="true" output="${output}/build.txt" append="true">
			<arg value="-I../../src-gen/"/>
			<arg value="-I${c-runtime.path}/src/common"/>
			<arg value="-I${c-runtime.path}/src/config"/>
			<arg value="-I${c-runtime.path}/src/platforms/${runtime.platform}"/>
			<arg value="-c"/>
			<arg value="-g3"/>
			<arg value="-O0"/>
			<arg value="-Wall"/>
			<!--<arg value="-ansi"/>-->
			<arg value="../../src-gen/ChoicePointTest/CPTest_Top.c"/>
			<arg value="../../src-gen/ChoicePointTest/CPTester.c"/>
			<arg value="../../src-gen/ChoicePointTest/CPUser.c"/>
			<arg value="../../src-gen/ChoicePointTest/node1_cpTest.c"/>
			<arg value="../../src-gen/ChoicePointTest/node1_cpTest_Runner.c"/>
			<arg value="../../src-gen/ChoicePointTest/TestProtocol.c"/>
		</exec>
		<exec dir="bin/ChoicePointTest" executable="${gcc.path}/gcc" failonerror="true" output="${output}/build.txt" append="true">
			<arg value="-L${c-runtime.path}/bin"/>
			<arg value="-oChoicePointTest.exe"/>
			<arg value="CPTest_Top.o"/>
			<arg value="CPTester.o"/>
			<arg value="CPUser.o"/>
			<arg value="node1_cpTest.o"/>
			<arg value="node1_cpTest_Runner.o"/>
			<arg value="TestProtocol.o"/>
			
			<!-- library has to be in the last position -->
			<arg value="-lorg.eclipse.etrice.runtime.c"/>
			<arg value="-lpthread"/>
			<arg value="-lrt"/>
		</exec>
		
		<!-- compile and link ChoicepointTestExtended -->
		<mkdir dir="bin/ChoicePointTestExtended"/>
		<exec dir="bin/ChoicePointTestExtended" executable="${gcc.path}/gcc" failonerror="true" output="${output}/build.txt" append="true">
			<arg value="-I../../src-gen/"/>
			<arg value="-I${c-runtime.path}/src/common"/>
			<arg value="-I${c-runtime.path}/src/config"/>
			<arg value="-I${c-runtime.path}/src/platforms/${runtime.platform}"/>
			<arg value="-c"/>
			<arg value="-g3"/>
			<arg value="-O0"/>
			<arg value="-Wall"/>
			<!--<arg value="-ansi"/>-->
			<arg value="../../src-gen/ChoicePointTestExtended/Testee_event.c"/>
			<arg value="../../src-gen/ChoicePointTestExtended/Testee_inherited_event.c"/>
			<arg value="../../src-gen/ChoicePointTestExtended/Tester_event.c"/>
			<arg value="../../src-gen/ChoicePointTestExtended/node6_cpExtTest.c"/>
			<arg value="../../src-gen/ChoicePointTestExtended/node6_cpExtTest_Runner.c"/>
			<arg value="../../src-gen/ChoicePointTestExtended/CPTestProtocol_event.c"/>
			<arg value="../../src-gen/ChoicePointTestExtended/CPTestProtocol_inherited_event.c"/>
			<arg value="../../src-gen/ChoicePointTestExtended/NavigationProtocol_event.c"/>
		</exec>
		<exec dir="bin/ChoicePointTestExtended" executable="${gcc.path}/gcc" failonerror="true" output="${output}/build.txt" append="true">
			<arg value="-L${c-runtime.path}/bin"/>
			<arg value="-oChoicePointTestExtended.exe"/>
			<arg value="Tester_event.o"/>
			<arg value="Testee_inherited_event.o"/>
			<arg value="Testee_event.o"/>
			<arg value="node6_cpExtTest.o"/>
			<arg value="node6_cpExtTest_Runner.o"/>
			<arg value="CPTestProtocol_event.o"/>
			<arg value="CPTestProtocol_inherited_event.o"/>
			<arg value="NavigationProtocol_event.o"/>
			
			<!-- library has to be in the last position -->
			<arg value="-lorg.eclipse.etrice.runtime.c"/>
			<arg value="-lpthread"/>
			<arg value="-lrt"/>
		</exec>
		
		<!-- compile and link SendingDataTestC -->
		<mkdir dir="bin/SendingDataTestC"/>
		<exec dir="bin/SendingDataTestC" executable="${gcc.path}/gcc" failonerror="true" output="${output}/build.txt" append="true">
			<arg value="-I../../src-gen/"/>
			<arg value="-I${c-runtime.path}/src/common"/>
			<arg value="-I${c-runtime.path}/src/config"/>
			<arg value="-I${c-runtime.path}/src/platforms/${runtime.platform}"/>
			<arg value="-c"/>
			<arg value="-g3"/>
			<arg value="-O0"/>
			<arg value="-Wall"/>
			<!--<arg value="-ansi"/>-->
			<arg value="../../src-gen/SendingDataTestC/MrPing.c"/>
			<arg value="../../src-gen/SendingDataTestC/MrPong.c"/>
			<arg value="../../src-gen/SendingDataTestC/PingPongData.c"/>
			<arg value="../../src-gen/SendingDataTestC/PingPongDataDeep.c"/>
			<arg value="../../src-gen/SendingDataTestC/PingPongDataDerived.c"/>
			<arg value="../../src-gen/SendingDataTestC/PingPongProtocol.c"/>
			<arg value="../../src-gen/SendingDataTestC/SendingDataTop.c"/>
			<arg value="../../src-gen/SendingDataTestC/node4_sdTest.c"/>
			<arg value="../../src-gen/SendingDataTestC/node4_sdTest_Runner.c"/>
		</exec>
		<exec dir="bin/SendingDataTestC" executable="${gcc.path}/gcc" failonerror="true" output="${output}/build.txt" append="true">
			<arg value="-L${c-runtime.path}/bin"/>
			<arg value="-oSendingDataTestC.exe"/>
			<arg value="MrPing.o"/>
			<arg value="MrPong.o"/>
			<arg value="PingPongData.o"/>
			<arg value="PingPongDataDeep.o"/>
			<arg value="PingPongDataDerived.o"/>
			<arg value="PingPongProtocol.o"/>
			<arg value="SendingDataTop.o"/>
			<arg value="node4_sdTest.o"/>
			<arg value="node4_sdTest_Runner.o"/>
			
			<!-- library has to be in the last position -->
			<arg value="-lorg.eclipse.etrice.runtime.c"/>
			<arg value="-lpthread"/>
			<arg value="-lrt"/>
		</exec>
		
		<!-- compile and link StaticConfigTest-->
		<mkdir dir="bin/StaticConfigTest"/>
		<exec dir="bin/StaticConfigTest" executable="${gcc.path}/gcc" failonerror="true" output="${output}/build.txt" append="true">
			<arg value="-I../../src-gen/"/>
			<arg value="-I${c-runtime.path}/src/common"/>
			<arg value="-I${c-runtime.path}/src/config"/>
			<arg value="-I${c-runtime.path}/src/platforms/${runtime.platform}"/>
			<arg value="-c"/>
			<arg value="-g3"/>
			<arg value="-O0"/>
			<arg value="-Wall"/>
			<!--<arg value="-ansi"/>-->
			<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/TestProtocolAttributes.c"/>
			<arg value="../../src-gen/StaticConfigTest/TestProtocolWithDataClass.c"/>
			<arg value="../../src-gen/StaticConfigTest/Top_ac.c"/>
			<arg value="../../src-gen/StaticConfigTest/node5_scTest.c"/>
			<arg value="../../src-gen/StaticConfigTest/node5_scTest_Runner.c"/>
		</exec>
		<exec dir="bin/StaticConfigTest" executable="${gcc.path}/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="TestProtocolAttributes.o"/>
			<arg value="TestProtocolWithDataClass.o"/>
			<arg value="Top_ac.o"/>
			<arg value="node5_scTest.o"/>
			<arg value="node5_scTest_Runner.o"/>
			
			<!-- library has to be in the last position -->
			<arg value="-lorg.eclipse.etrice.runtime.c"/>
			<arg value="-lpthread"/>
			<arg value="-lrt"/>
		</exec>
		
		<!-- compile and link DataDrivenTest-->
		<mkdir dir="bin/DataDrivenTest"/>
		<exec dir="bin/DataDrivenTest" executable="${gcc.path}/gcc" failonerror="true" output="${output}/build.txt" append="true">
			<arg value="-I../../src-gen/"/>
			<arg value="-I${c-runtime.path}/src/common"/>
			<arg value="-I${c-runtime.path}/src/config"/>
			<arg value="-I${c-runtime.path}/src/platforms/${runtime.platform}"/>
			<arg value="-c"/>
			<arg value="-g3"/>
			<arg value="-O0"/>
			<arg value="-Wall"/>
			<!--<arg value="-ansi"/>-->
			<arg value="../../src-gen/DataDrivenTest/Tester.c"/>
			<arg value="../../src-gen/DataDrivenTest/Testee.c"/>
			<arg value="../../src-gen/DataDrivenTest/Appl.c"/>
			<arg value="../../src-gen/DataDrivenTest/DC.c"/>
			<arg value="../../src-gen/DataDrivenTest/PC.c"/>
			<arg value="../../src-gen/DataDrivenTest/node2_ddTest.c"/>
			<arg value="../../src-gen/DataDrivenTest/node2_ddTest_Runner.c"/>
			<arg value="../../src-gen/room/basic/service/timing/ATimingService.c"/>
			<arg value="../../src-gen/room/basic/service/timing/PTimer.c"/>
		</exec>
		<exec dir="bin/DataDrivenTest" executable="${gcc.path}/gcc" failonerror="true" output="${output}/build.txt" append="true">
			<arg value="-L../../../../runtime/org.eclipse.etrice.runtime.c/bin"/>
			<arg value="-oDataDrivenTest.exe"/>
			<arg value="Tester.o"/>
			<arg value="Testee.o"/>
			<arg value="Appl.o"/>
			<arg value="DC.o"/>
			<arg value="PC.o"/>
			<arg value="node2_ddTest.o"/>
			<arg value="node2_ddTest_Runner.o"/>
			<arg value="ATimingService.o"/>
			<arg value="PTimer.o"/>
			
			<!-- library has to be in the last position -->
			<arg value="-lorg.eclipse.etrice.runtime.c"/>
			<arg value="-lpthread"/>
			<arg value="-lrt"/>
		</exec>
	</target>

	<!--
		run: runs all executables
	-->
	<target name="run" depends="build">
		<mkdir dir="tmp/log"/>
		<echo>start HandlerTest</echo>
		<exec dir="./" resolveexecutable="true" executable="./bin/HandlerTest/HandlerTest.exe">
			<arg value="-run_as_test"/>
		</exec>
		<echo>end   HandlerTest</echo>
		<echo>start ChoicePointTest</echo>
		<exec dir="./" resolveexecutable="true" executable="./bin/ChoicePointTest/ChoicePointTest.exe">
			<arg value="-run_as_test"/>
		</exec>
		<echo>end   ChoicePointTest</echo>
		<!--
		<echo>start SendingDataTestC</echo>
		<exec dir="./" resolveexecutable="true" executable="./bin/SendingDataTestC/SendingDataTestC.exe">
			<arg value="-run_as_test"/>
		</exec>
		<echo>end   SendingDataTestC</echo>
		-->
		<echo>start StaticConfigTest</echo>
		<exec dir="./" resolveexecutable="true" executable="./bin/StaticConfigTest/StaticConfigTest.exe">
			<arg value="-run_as_test"/>
		</exec>
		<echo>end   StaticConfigTest</echo>
		<echo>start DataDrivenTest</echo>
		<exec dir="./" resolveexecutable="true" executable="./bin/DataDrivenTest/DataDrivenTest.exe">
			<arg value="-run_as_test"/>
		</exec>
		<echo>end   DataDrivenTest</echo>
	</target>
	
	<!--
		convert: converts etu- into xunit xml-format
	-->
	<target name="convert" depends="run,set_tp">
		<path id="clspath">
			<pathelement location="../../plugins/org.eclipse.etrice.etunit.converter/bin"/>
			<fileset dir="${target.platform}/plugins/">
				<include name="org.eclipse.core.runtime_3.9*.jar" />
				<include name="org.eclipse.emf.ecore_2.9*.jar" />
				<include name="org.eclipse.emf.ecore.xmi_2.9*.jar" />
				<include name="org.eclipse.emf.common_2.9*.jar" />
			</fileset>
		</path>

		<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.ChoicePointTest"/>
			<arg value="./tmp/ChoicePointTest.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.HandlerTest"/>
			<arg value="./tmp/HandlerTest.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.SendingDataTestC"/>
			<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>
		
		<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.DataDrivenTest"/>
			<arg value="./tmp/DataDrivenTest.etu"/>
			<classpath refid="clspath"/>
		</java>
	</target>
	
	<!--
		copy_results: copies the *.xml results to their final destination
	-->
	<target name="copy_results" depends="set_tr">
		<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/CStaticConfigTest.xml"/>
		<move file="./tmp/DataDrivenTest.xml" tofile="./tmp/CDataDrivenTest.xml"/>
		<copy todir="${test.results}" >
			<fileset dir="./tmp">
				<include name="*.xml"/>
			</fileset>
		</copy>
	</target>
	
</project>

Back to the top