formatting; fix junitreport by enabling XML formatter; parameterize junit forking

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/collections/branches/collections_jdk5_branch@738939 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Matthew Jason Benson 2009-01-29 17:51:26 +00:00
parent b8a5292f3b
commit b1311a218c
1 changed files with 55 additions and 52 deletions

107
build.xml
View File

@ -112,6 +112,7 @@ limitations under the License.
<!-- JUnit --> <!-- JUnit -->
<property name="test.failonerror" value="true"/> <property name="test.failonerror" value="true"/>
<property name="test.fork" value="true"/>
<!-- Maven --> <!-- Maven -->
<property name="maven.repo" value="${user.home}/.maven/repository" /> <property name="maven.repo" value="${user.home}/.maven/repository" />
@ -307,19 +308,20 @@ limitations under the License.
description="Run unit tests" /> description="Run unit tests" />
<path id="build.path"> <path id="build.path">
<pathelement location="${build.classes}" /> <pathelement location="${build.classes}" />
</path> </path>
<target name="instrument"
depends="compile.tests" <target name="instrument"
description="Instruments the compiled classes and moves them to the instrumentation directory"> depends="compile.tests"
<emma> description="Instruments the compiled classes and moves them to the instrumentation directory">
<instr instrpathref="build.path" <emma>
destdir="${build.instrumented}" <instr instrpathref="build.path"
metadatafile="${build.reports.coverage}/coverage.emma" destdir="${build.instrumented}"
merge="true"> metadatafile="${build.reports.coverage}/coverage.emma"
</instr> merge="true">
</emma> </instr>
</target> </emma>
</target>
<!-- Runs all tests --> <!-- Runs all tests -->
<target name="-test-all" depends="instrument" unless="testcase"> <target name="-test-all" depends="instrument" unless="testcase">
@ -337,8 +339,9 @@ limitations under the License.
<jvmarg value="-Demma.coverage.out.merge=true" /> <jvmarg value="-Demma.coverage.out.merge=true" />
<jvmarg value="-Demma.verbosity.level=quiet" /> <jvmarg value="-Demma.verbosity.level=quiet" />
<formatter type="xml" />
<formatter type="plain" /> <formatter type="plain" />
<batchtest fork="yes" todir="${build.reports.test}"> <batchtest fork="${test.fork}" todir="${build.reports.test}">
<fileset dir="${source.test}"> <fileset dir="${source.test}">
<include name="**/Test*.java"/> <include name="**/Test*.java"/>
<exclude name="**/TestAll*.java"/> <exclude name="**/TestAll*.java"/>
@ -348,15 +351,17 @@ limitations under the License.
<exclude name="**/TestHashMap.java"/> <exclude name="**/TestHashMap.java"/>
<exclude name="**/TestTreeMap.java"/> <exclude name="**/TestTreeMap.java"/>
<exclude name="**/TestTypedCollection.java"/> <exclude name="**/TestTypedCollection.java"/>
<exclude name="**/TestAnyAllOnePredicate.java"/>
<exclude name="**/TestCompositePredicate.java"/>
</fileset> </fileset>
</batchtest> </batchtest>
</junit> </junit>
<junitreport todir="${build.reports.test}"> <junitreport todir="${build.reports.test}">
<fileset dir="${build.reports.test}"> <fileset dir="${build.reports.test}">
<include name="TEST-*.xml" /> <include name="TEST-*.xml" />
</fileset> </fileset>
<report format="frames" todir="${build.reports.test}/html" /> <report format="frames" todir="${build.reports.test}/html" />
</junitreport> </junitreport>
</target> </target>
<!-- Runs a single test --> <!-- Runs a single test -->
@ -369,25 +374,24 @@ limitations under the License.
<path refid="test.support.path"/> <path refid="test.support.path"/>
</classpath> </classpath>
<test name="${testcase}" fork="yes"> <test name="${testcase}" fork="${test.fork}">
<formatter type="brief" usefile="false" /> <formatter type="brief" usefile="false" />
</test> </test>
</junit> </junit>
</target> </target>
<target name="coverage.report" <target name="coverage.report"
depends="test" depends="test"
description="Generates the coverage report for the code that has been run"> description="Generates the coverage report for the code that has been run">
<emma> <emma>
<report sourcepath="${source.java}"> <report sourcepath="${source.java}">
<fileset dir="${build.reports.coverage}"> <fileset dir="${build.reports.coverage}">
<include name="*" /> <include name="*" />
</fileset> </fileset>
<html outfile="${build.reports.coverage}/coverage.html" /> <html outfile="${build.reports.coverage}/coverage.html" />
</report> </report>
</emma> </emma>
</target> </target>
<!-- ====================================================================== --> <!-- ====================================================================== -->
@ -401,7 +405,7 @@ limitations under the License.
<path refid="test.support.path"/> <path refid="test.support.path"/>
</classpath> </classpath>
<batchtest fork="yes"> <batchtest fork="${test.fork}">
<fileset dir="${source.test}"> <fileset dir="${source.test}">
<include name="**/TestAllPackages.java"/> <include name="**/TestAllPackages.java"/>
</fileset> </fileset>
@ -420,17 +424,17 @@ limitations under the License.
<delete dir="${build.docs}"/> <delete dir="${build.docs}"/>
<mkdir dir="${build.docs}"/> <mkdir dir="${build.docs}"/>
<javadoc sourcepath="${source.java}" <javadoc sourcepath="${source.java}"
destdir="${build.docs}" destdir="${build.docs}"
packagenames="${component.package}.*" packagenames="${component.package}.*"
access="${javadoc.access}" access="${javadoc.access}"
author="true" author="true"
version="true" version="true"
use="true" use="true"
link="${javadoc.links}" link="${javadoc.links}"
overview="${source.java}/org/apache/commons/collections/overview.html" overview="${source.java}/org/apache/commons/collections/overview.html"
doctitle="${component.title} ${component.version} API;" doctitle="${component.title} ${component.version} API;"
windowtitle="${component.title} ${component.version} API" windowtitle="${component.title} ${component.version} API"
bottom="Copyright &amp;copy; 2001-${year} Apache Software Foundation. All Rights Reserved."> bottom="Copyright &amp;copy; 2001-${year} Apache Software Foundation. All Rights Reserved.">
</javadoc> </javadoc>
</target> </target>
@ -475,10 +479,10 @@ limitations under the License.
<delete dir="${tf.build.tf}"/> <delete dir="${tf.build.tf}"/>
<mkdir dir="${tf.build.tf}"/> <mkdir dir="${tf.build.tf}"/>
<javac srcdir="${source.test}" <javac srcdir="${source.test}"
destdir="${tf.build.tf}" destdir="${tf.build.tf}"
debug="true" debug="true"
deprecation="false" deprecation="false"
optimize="false"> optimize="false">
<patternset refid="tf.patternset.validate" /> <patternset refid="tf.patternset.validate" />
<classpath> <classpath>
<path refid="test.support.path"/> <path refid="test.support.path"/>
@ -565,8 +569,7 @@ limitations under the License.
</copy> </copy>
</target> </target>
<target name="dist.create" depends="jar,testjar,tf.validate,tf.jar,dist.bin,dist.src"> <target name="dist.create" depends="jar,testjar,tf.validate,tf.jar,dist.bin,dist.src" />
</target>
<target name="dist.bin"> <target name="dist.bin">
<copy todir="${build.src}"> <copy todir="${build.src}">