-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.xml
executable file
·79 lines (67 loc) · 3.68 KB
/
build.xml
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
<project name="plugin-Telemac" default="test" basedir=".">
<property name="code.name" value="Telemac" />
<property name="install.dir" value="${basedir}/Funz-${code.name}" />
<property name="build_plugin.xml" location="../funz-profile/build_plugin.xml" />
<import file="${build_plugin.xml}"/>
<property file="${code.name}.properties"/>
<target name="dist" depends="dist-iopluginjar"/> <!-- dist-ioplugin: copy the plugin jar files -->
<target name="test" depends="test-iopluginjar"> <!-- test-iopluginjar: test the java plugin -->
<property name="unit.test.jar" value="../funz-profile/lib/concutest-junit-4.7-withrt.jar" />
<javac deprecation="true"
source="${java.compiler.version}"
target="${java.compiler.version}"
srcdir="${test.dir}"
destdir="${build.dir}"
encoding="ISO-8859-1"
debug="true">
<classpath refid="plugin.classpath" />
<classpath path="${build.dir}" />
<classpath path="${unit.test.jar}" />
</javac>
<fileset id="tests" dir="${build.dir}" includes="**/*Test.class" />
<!--property name="tests.p" refid="tests"/>
<echo message="${tests.p}"/-->
<pathconvert pathsep="${line.separator}" property="testclass.list" refid="tests">
<map from="${build.dir}/" to=""/>
</pathconvert>
<!--echo message="${tests.list}"/>
<echo message="================"/-->
<for list="${testclass.list}" param="test.class" delimiter="${line.separator}">
<sequential>
<echo message="@{test.class}"/>
<echo message="========================================="/>
<echo message="============= @{test.class} ============="/>
<echo message="========================================="/>
<propertyregex property="test.class" input="@{test.class}" regexp="\.class" replace="" global="true" override="true"/>
<!--echo message="${test.class}"/-->
<propertyregex property="test.class.id" input="${test.class}" regexp="[/\\]" replace="\." global="true" override="true"/>
<!--echo message="${test.class.id}"/-->
<!--record name="${test.class.id}.txt" action="start" /-->
<!--<jacoco:coverage>-->
<java classname="${test.class.id}" fork="true" timeout="360000" failonerror="false" resultproperty="@{test.class}.failed">
<sysproperty key="app.home" value="${dist.dir}"/> <!-- setup root dir for static dependencies (eg. jar) -->
<classpath refid="plugin.classpath" />
<classpath path="${build.dir}" />
<classpath path="${unit.test.jar}" />
<assertions>
<enable/>
</assertions>
</java>
<!--</jacoco:coverage>-->
<!--record name="${test.class.id}.txt" action="stop"/-->
<if>
<equals arg1="${@{test.class}.failed}" arg2="0" />
<then>
</then>
<else>
<property name="failed" value="1" />
</else>
</if>
</sequential>
</for>
<fail message="Test failure detected, check test results." if="failed" />
</target>
<target name="install" depends="install-plugin"/> <!-- test-ioplugin: test the plugin ascii files -->
<target name="super.clean" depends="clean"/>
<target name="super.run-reference-cases" depends="run-reference-cases"/>
</project>