leif 02/01/24 19:58:38
Modified: . build.xml
Log:
Simplified build by merging check and test-report tasks.
Add a test-subset tast to allow running of a subset of tests.
Revision Changes Path
1.90 +31 -30 jakarta-avalon-excalibur/build.xml
Index: build.xml
===================================================================
RCS file: /home/cvs/jakarta-avalon-excalibur/build.xml,v
retrieving revision 1.89
retrieving revision 1.90
diff -u -r1.89 -r1.90
--- build.xml 24 Jan 2002 15:50:10 -0000 1.89
+++ build.xml 25 Jan 2002 03:58:38 -0000 1.90
@@ -292,14 +292,16 @@
</target>
+ <!-- Run all of the tests and generate an html report -->
<target name="test" depends="check"/>
-
<target name="check" depends="compile" description="perform unit tests">
+ <mkdir dir="${build.testdocs}"/>
<mkdir dir="${build.reports}"/>
<echo message="Performing Unit Tests" />
<junit fork="true" printsummary="yes" dir="${build.reports}">
- <formatter type="plain"/>
+ <formatter type="xml"/> <!-- xml reports for junitreport -->
+ <formatter type="plain"/> <!-- text reports for humans -->
<classpath>
<path refid="test.class.path"/>
<pathelement location="${build.classes}"/>
@@ -308,11 +310,13 @@
<batchtest todir="${build.reports}">
<fileset dir="${build.classes}">
<exclude name="**/test/Abstract*TestCase.class"/>
- <exclude
name="org/apache/avalon/excalibur/datasource/test/DataSourceTestCase.class"/>
+ <exclude
name="org/apache/avalon/excalibur/datasource/test/DataSourceTestCase.class"
unless="test.jdbc"/>
+ <!-- Should these be excluded?
<exclude
name="org/apache/avalon/excalibur/naming/rmi/test/RMIContextTestCase.class"/>
<exclude
name="org/apache/avalon/excalibur/logger/test/LogKitManagementTestCase.class"/>
<exclude
name="org/apache/avalon/excalibur/concurrent/test/ReadWriteLockTestCase.class"/>
<exclude
name="org/apache/avalon/excalibur/monitor/test/MonitorTestCase.class"/>
+ -->
<include name="**/test/*Profile.class" if="test.profile"/>
<include name="**/test/*TestCase.class"/>
</fileset>
@@ -324,17 +328,30 @@
</fileset>
</batchtest>
</junit>
-
+
+ <junitreport todir="${build.reports}">
+ <fileset dir="${build.reports}">
+ <include name="TEST-*.xml"/>
+ </fileset>
+ <report format="frames" todir="${build.testdocs}"/>
+ </junitreport>
+
+ <!-- Clean up the xml reports used by the junitreport task -->
+ <delete>
+ <fileset dir="${build.reports}" includes="TEST-*.xml"/>
+ <fileset dir="${build.reports}" includes="TESTS-*.xml"/>
+ </delete>
</target>
-
-
- <target name="test-report" depends="compile" >
- <mkdir dir="${build.testdocs}"/>
+
+ <!-- Run a subset of the tests -->
+ <target name="test-subset-check" unless="junit.test">
+ <fail message="junit.test not specified. Example usage: build
-Djunit.test=**/ResourceLimiting*TestCase.class test-subset" />
+ </target>
+ <target name="test-subset" depends="test-subset-check, compile"
description="perferm a subset of unit tests">
<mkdir dir="${build.reports}"/>
-
- <echo message="Performing Unit Tests" />
+
<junit fork="true" printsummary="yes" dir="${build.reports}">
- <formatter type="xml"/>
+ <formatter type="plain"/> <!-- text reports for humans -->
<classpath>
<path refid="test.class.path"/>
<pathelement location="${build.classes}"/>
@@ -342,29 +359,13 @@
</classpath>
<batchtest todir="${build.reports}">
<fileset dir="${build.classes}">
- <exclude name="**/test/Abstract*TestCase.class"/>
- <exclude
name="org/apache/avalon/excalibur/datasource/test/DataSourceTestCase.class"
unless="test.jdbc"/>
- <include name="**/test/*Profile.class" if="test.profile"/>
- <include name="**/test/*TestCase.class"/>
+ <include name="${junit.test}"/>
</fileset>
<fileset dir="${build.scratchpad}">
- <include
name="org/apache/avalon/excalibur/i18n/test/AbstractBundleTestCase.class"/>
- </fileset>
- <fileset dir="${build.scratchpad}">
- <exclude name="**/test/Abstract*TestCase.class"/>
- <include name="**/test/*Profile.class" if="test.profile"/>
- <include name="**/test/*TestCase.class"/>
- <exclude name="**/test/*PerformanceTestCase.class"
unless="test.profile"/>
+ <include name="${junit.test}"/>
</fileset>
</batchtest>
</junit>
-
- <junitreport todir="${build.reports}">
- <fileset dir="${build.reports}">
- <include name="TEST-*.xml"/>
- </fileset>
- <report format="frames" todir="${build.testdocs}"/>
- </junitreport>
</target>
<!-- Creates the clutil.jar file -->
@@ -569,7 +570,7 @@
</target>
<!-- Create the distribution -->
- <target name="dist-base" depends="all,javadocs,test-report">
+ <target name="dist-base" depends="all,javadocs,test">
<mkdir dir="${dist.dir}"/>
<copy file="${build.lib}/avalon-excalibur.jar"
tofile="${dist.dir}/avalon-excalibur-${version}.jar"/>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>