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
|
<!-- Common properties/tasks that are shared by all projects
However, for possible overrides, these are all prefixed by
"_shared.common."
@version: $Date: 2004/05/14 18:54:10 $
-->
<target name="_shared.common.test-all"
depends="init,test-checkDependencies,
_shared.common.test-eut,
_shared.common.test-ut,
_shared.common.test-iut,
_shared.common.test-report,
_shared.common.test-failed,
_shared.common.test-errored" >
<echo>
*** The AIT tests did not run. ***
To run them, execute the target "run-ait-tests"
*** The AIT tests did not run. ***
</echo>
</target>
<target name="_shared.common.test-report"
depends="_shared.common.test-junit.report,
_shared.common.test-coverage.report">
<copy todir="${dirs.work}">
<fileset dir="${dirs.test-output}" includes="*.html" />
<fileset dir="${dirs.coverage}" includes="*.html" />
</copy>
</target>
<target name="_shared.common.test-junit.report">
<junitreport todir="${dirs.test-output}" >
<fileset dir="${dirs.test-output}" >
<include name="TEST-*.xml" />
</fileset>
<report format="noframes" todir="${dirs.test-output}"/>
</junitreport>
</target>
<target name="_shared.common.test-failed" if="tests.failure" >
<fail message="jUnit failure(s)" />
</target>
<target name="_shared.common.test-errored" if="tests.error" >
<fail message="jUnit error(s)" />
</target>
<target name="_shared.common.test-coverage.compile" >
<delete dir="${dirs.coverage}/classes" failonerror="false" />
<mkdir dir="${dirs.coverage}/classes" />
<grobo-instrument logdir="${dirs.coverage}/logs"
logger="single"
destdir="${dirs.coverage}/classes">
<fileset dir="${dirs.classes.dev}">
<include name="*.class" />
<include name="**/*.class" />
<!-- for recursion issues, we can't cover part of the
coverage group -->
<exclude name="**/codecoverage/v2/logger/*.class" />
</fileset>
<measure type="linecount" />
<!-- <measure type="bytecode" /> -->
<!-- <measure type="branch" /> -->
<!-- <measure type="call-pair" /> -->
<!-- <measure type="function" /> -->
<loggerProp key="writes-per-flush" value="-1" />
<loggerProp key="use-cache" value="true" />
<loggerProp key="millis-per-flush" value="0" />
</grobo-instrument>
</target>
<target name="_shared.common.test-coverage.report" >
<grobo-report logdir="${dirs.coverage}/logs">
<logFilter type="single" />
<simple destdir="${dirs.coverage}" />
<source destdir="work/coverage/report"
title="GroboUtils Coverage for ${product}-${version}"
srcdir="${dirs.sources.dev}" />
<failon percentage="60" />
</grobo-report>
</target>
<!-- Setup the classes to test (allows for command-line declaration
of which tests to run) -->
<target name="_shared.common.test-filter"
depends="_shared.common.test-filter.1,_shared.common.test-filter.2" />
<target name="_shared.common.test-filter.1" if="testfilter">
<property name="_shared.testfilter"
value="**/${testfilter}Test.class" />
</target>
<target name="_shared.common.test-filter.2" unless="testfilter">
<property name="_shared.testfilter"
value="**/*Test.class" />
</target>
<target name="_shared.common.test-eut"
depends="init, _shared.common.test-coverage.compile,
_shared.common.test-filter">
<!-- <delete dir="${dirs.test-output}" /> -->
<mkdir dir="${dirs.test-output}" />
<echoproperties destfile="${dirs.test-output}/eut.properties" />
<junit printsummary="yes" fork="yes"
haltonerror="no" haltonfailure="no"
failureProperty="tests.failure"
errorProperty="tests.error"
dir="${dirs.test-output}"
>
<classpath>
<pathelement location="${dirs.coverage}/classes" />
<pathelement location="${output.jar-name.dev}" />
<pathelement location="${output.jar-name.eut}" />
<path refid="classpath.tests" />
<path refid="classpath.bootstrap.grobocoverage.runtime" />
<path refid="classpath.bootstrap.xml" />
<path refid="classpath.bootstrap.core" />
</classpath>
<formatter type="xml" usefile="yes" />
<formatter
classname="net.sourceforge.groboutils.autodoc.v1.junit.AutoDocJUnitFormatter"
extension="ignore" usefile="no" />
<batchtest todir="${dirs.test-output}">
<fileset dir="${dirs.classes.eut}">
<include name="${_shared.testfilter}" />
<exclude name="**/*$$*.class" />
<!-- tests excluded if the test is run in offline mode -->
<patternset refid="testset.onlinetests"/>
<!-- exclude JDK 1.2 specific tests unless we're running
JDK 1.2 compatible JVM -->
<patternset refid="testset.jdk12tests"/>
<!-- exclude JDK 1.3 specific tests unless we're running
JDK 1.3 compatible JVM -->
<patternset refid="testset.jdk13tests"/>
<!-- exclude JDK 1.4 specific tests unless we're running
JDK 1.4 compatible JVM -->
<patternset refid="testset.jdk14tests"/>
</fileset>
</batchtest>
<sysproperty
key="junit.ant.properties"
value="${dirs.test-output}/eut.properties"
/>
</junit>
</target>
<target name="_shared.common.test-ut"
depends="init, _shared.common.test-coverage.compile,
_shared.common.test-filter">
<mkdir dir="${dirs.test-output}" />
<echoproperties destfile="${dirs.test-output}/ut.properties" />
<junit printsummary="yes" fork="yes"
haltonerror="no" haltonfailure="no"
failureProperty="tests.failure"
errorProperty="tests.error"
dir="${dirs.test-output}"
>
<classpath>
<pathelement location="${dirs.coverage}/classes" />
<pathelement location="${output.jar-name.dev}" />
<pathelement location="${output.jar-name.ut}" />
<pathelement location="${output.jar-name.eut}" />
<path refid="classpath.tests" />
<path refid="classpath.bootstrap.grobocoverage.runtime" />
<path refid="classpath.bootstrap.xml" />
<path refid="classpath.bootstrap.core" />
</classpath>
<!--
<formatter type="plain" usefile="no" />
-->
<formatter type="xml" usefile="yes" />
<formatter
classname="net.sourceforge.groboutils.autodoc.v1.junit.AutoDocJUnitFormatter"
extension="ignore" usefile="no" />
<batchtest todir="${dirs.test-output}">
<fileset dir="${dirs.classes.ut}">
<include name="${_shared.testfilter}" />
<exclude name="**/*$$*.class" />
<!-- tests excluded if the test is run in offline mode -->
<patternset refid="testset.onlinetests"/>
<!-- exclude JDK 1.2 specific tests unless we're running
JDK 1.2 compatible JVM -->
<patternset refid="testset.jdk12tests"/>
<!-- exclude JDK 1.3 specific tests unless we're running
JDK 1.3 compatible JVM -->
<patternset refid="testset.jdk13tests"/>
<!-- exclude JDK 1.4 specific tests unless we're running
JDK 1.4 compatible JVM -->
<patternset refid="testset.jdk14tests"/>
</fileset>
</batchtest>
<sysproperty
key="junit.ant.properties"
value="${dirs.test-output}/ut.properties"
/>
</junit>
</target>
<target name="_shared.common.test-iut"
depends="init, _shared.common.test-coverage.compile,
_shared.common.test-filter">
<mkdir dir="${dirs.test-output}" />
<echoproperties destfile="${dirs.test-output}/iut.properties" />
<junit printsummary="yes" fork="yes"
haltonerror="no" haltonfailure="no"
failureProperty="tests.failure"
errorProperty="tests.error"
dir="${dirs.test-output}"
>
<classpath>
<pathelement location="${dirs.coverage}/classes" />
<pathelement location="${output.jar-name.dev}" />
<pathelement location="${output.jar-name.iut}" />
<pathelement location="${output.jar-name.ut}" />
<pathelement location="${output.jar-name.eut}" />
<path refid="classpath.tests" />
<path refid="classpath.bootstrap.grobocoverage.runtime" />
<path refid="classpath.bootstrap.xml" />
<path refid="classpath.bootstrap.core" />
</classpath>
<formatter type="xml" usefile="yes" />
<formatter
classname="net.sourceforge.groboutils.autodoc.v1.junit.AutoDocJUnitFormatter"
extension="ignore" usefile="no" />
<batchtest todir="${dirs.test-output}">
<fileset dir="${dirs.classes.iut}">
<include name="${_shared.testfilter}" />
<exclude name="**/*$$*.class" />
<!-- tests excluded if the test is run in offline mode -->
<patternset refid="testset.onlinetests"/>
<!-- exclude JDK 1.2 specific tests unless we're running
JDK 1.2 compatible JVM -->
<patternset refid="testset.jdk12tests"/>
<!-- exclude JDK 1.3 specific tests unless we're running
JDK 1.3 compatible JVM -->
<patternset refid="testset.jdk13tests"/>
<!-- exclude JDK 1.4 specific tests unless we're running
JDK 1.4 compatible JVM -->
<patternset refid="testset.jdk14tests"/>
</fileset>
</batchtest>
<sysproperty
key="junit.ant.properties"
value="${dirs.test-output}/iut.properties"
/>
</junit>
</target>
<target name="_shared.common.test-ait.function-online"
unless="global.offline" >
<antcall target="_shared.common.test-ait.function" />
</target>
<target name="_shared.common.test-ait.function" >
<!-- entry assertion -->
<fail unless="test-ait.function.name">
Must pass 'test-ait.function.name' to this target to run an AIT test.
</fail>
<mkdir dir="${dirs.test-output}" />
<echoproperties destfile="${dirs.test-output}/ait.properties" />
<junit printsummary="yes" fork="yes"
haltonerror="no" haltonfailure="no"
failureProperty="tests.failure"
errorProperty="tests.error"
dir="${dirs.test-output}"
>
<classpath>
<pathelement location="${dirs.coverage}/classes" />
<pathelement location="${output.jar-name.dev}" />
<pathelement location="${output.jar-name.ait}" />
<pathelement location="${output.jar-name.iut}" />
<pathelement location="${output.jar-name.ut}" />
<pathelement location="${output.jar-name.eut}" />
<path refid="classpath.tests" />
<path refid="classpath.bootstrap.grobocoverage.runtime" />
<path refid="classpath.bootstrap.xml" />
<path refid="classpath.bootstrap.core" />
</classpath>
<formatter type="xml" usefile="yes" />
<formatter
classname="net.sourceforge.groboutils.testing.junitlog.v1.JUnitBugResultFormatter"
extension="ignore" usefile="no" />
<test name="${test-ait.function.name}" todir="${dirs.test-output}" />
<sysproperty
key="junit.ant.properties"
value="${dirs.test-output}/ait.properties"
/>
</junit>
</target>
|