Lines 48-81
Link Here
|
48 |
</target> |
48 |
</target> |
49 |
<target name="-prepare-execution"> |
49 |
<target name="-prepare-execution"> |
50 |
<macrodef name="junit-template"> |
50 |
<macrodef name="junit-template"> |
51 |
<element name="test-spec" implicit="yes"/> |
51 |
<!-- This macros is intended to be used in conjunction with the |
|
|
52 |
org.apache.tools.ant.module.spi.AntLogger. Note, the last task |
53 |
deletes just created test report. --> |
54 |
<element name="extra-args" implicit="yes" optional="yes"/> |
52 |
<sequential> |
55 |
<sequential> |
53 |
<translate-classpath classpath="${classpath}" targetProperty="classpath-translated" /> |
56 |
<translate-classpath classpath="${classpath}" targetProperty="classpath-translated" /> |
54 |
<property name="run.jvmargs" value="" /> |
57 |
<property name="run.jvmargs" value="" /> |
55 |
<property name="work.dir" value="${basedir}"/> |
58 |
<property name="work.dir" value="${basedir}"/> |
56 |
<junit showoutput="true" fork="true" dir="${work.dir}" jvm="${platform.java}"> |
59 |
<!-- needed in order to display test names: --> |
57 |
<test-spec/> |
60 |
<property name="test.result.file" location="${java.io.tmpdir}/TEST-${classname}.xml"/> |
58 |
<classpath path="${classpath-translated}" /> |
61 |
<java classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner" fork="true" dir="${work.dir}" jvm="${platform.java}"> |
|
|
62 |
<classpath> |
63 |
<fileset dir="${ant.home}" includes="patches/*.jar"/> |
64 |
<path path="${ant.home}/lib/ant.jar:${ant.home}/lib/ant-junit.jar"/> |
65 |
<path path="${classpath-translated}"/> |
66 |
</classpath> |
59 |
<jvmarg value="-ea"/> |
67 |
<jvmarg value="-ea"/> |
60 |
<jvmarg line="${run.jvmargs}"/> |
68 |
<jvmarg line="${run.jvmargs}"/> |
61 |
<formatter type="brief" usefile="false"/> |
69 |
<arg value="${classname}"/> |
|
|
70 |
<arg value="filtertrace=true"/> |
71 |
<arg value="haltOnError=false"/> |
72 |
<arg value="haltOnFailure=false"/> |
73 |
<arg value="showoutput=true"/> |
74 |
<arg value="outputtoformatters=true"/> |
75 |
<arg value="logtestlistenerevents=true"/> |
76 |
<arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.BriefJUnitResultFormatter"/> |
77 |
<arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,${test.result.file}"/> |
78 |
<extra-args/> |
62 |
<syspropertyset> |
79 |
<syspropertyset> |
63 |
<propertyref prefix="test-sys-prop."/> |
80 |
<propertyref prefix="test-sys-prop."/> |
64 |
<mapper from="test-sys-prop.*" to="*" type="glob"/> |
81 |
<mapper from="test-sys-prop.*" to="*" type="glob"/> |
65 |
</syspropertyset> |
82 |
</syspropertyset> |
66 |
</junit> |
83 |
</java> |
|
|
84 |
<delete file="${test.result.file}" deleteonexit="true" /> |
67 |
</sequential> |
85 |
</sequential> |
68 |
</macrodef> |
86 |
</macrodef> |
69 |
<translate-classpath classpath="${classpath}" targetProperty="classpath-translated"/> |
87 |
<translate-classpath classpath="${classpath}" targetProperty="classpath-translated"/> |
70 |
</target> |
88 |
</target> |
71 |
<target name="-test-class" depends="-prepare-execution" unless="methodname"> |
89 |
<target name="-test-class" depends="-prepare-execution" unless="methodname"> |
72 |
<junit-template> |
90 |
<junit-template /> |
73 |
<test name="${classname}"/> |
|
|
74 |
</junit-template> |
75 |
</target> |
91 |
</target> |
76 |
<target name="-test-method" depends="-check-run-test-single-method-supported,-prepare-execution" if="methodname"> |
92 |
<target name="-test-method" depends="-check-run-test-single-method-supported,-prepare-execution" if="methodname"> |
77 |
<junit-template> |
93 |
<junit-template> |
78 |
<test name="${classname}" methods="${methodname}"/> |
94 |
<arg value="methods=${methodname}"/> |
79 |
</junit-template> |
95 |
</junit-template> |
80 |
</target> |
96 |
</target> |
81 |
<target name="test" depends="-test-class,-test-method"/> |
97 |
<target name="test" depends="-test-class,-test-method"/> |