Update the test.pathable target. Note that the optional ant junit task is
now used in this file - see comments at head of file for details. git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/logging/trunk@209252 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
81
build.xml
81
build.xml
@@ -16,13 +16,22 @@
|
||||
|
||||
-->
|
||||
|
||||
<project name="Logging" default="compile" basedir=".">
|
||||
|
||||
|
||||
<!--
|
||||
"Logging" component of the Jakarta Commons Subproject
|
||||
$Id$
|
||||
-->
|
||||
- Ant build file for commons-logging.
|
||||
-
|
||||
- Note that this build file uses the optional <junit> task. While the
|
||||
- task "adapter" class comes by default with ant 1.6+, the junit libraries
|
||||
- (3.8.1 or later) are also required to be made available to ant. This
|
||||
- requires that you do one of the following:
|
||||
- * create directory ~/.ant/lib and place the junit jar there
|
||||
- * put the junit jar in $ANT_HOME/lib
|
||||
- * run ant as "ant -lib path-to-junit-jar"
|
||||
- * put the junit jar in $CLASSPATH
|
||||
-
|
||||
- $Id$
|
||||
-->
|
||||
|
||||
<project name="Logging" default="compile" basedir=".">
|
||||
|
||||
|
||||
<!-- ========== Initialize Properties ===================================== -->
|
||||
@@ -582,15 +591,65 @@ limitations under the License.-->'>
|
||||
</target>
|
||||
|
||||
|
||||
<!--
|
||||
- Target to run all unit tests under the "pathable" directory.
|
||||
-
|
||||
- The batchtest task auto-detects what tests are available without
|
||||
- any need to define TestSuite objects in the code to compose
|
||||
- sets of tests to be run.
|
||||
-
|
||||
- Details of the unit test results for each TestCase will appear in
|
||||
- a file in directory ${build.home}/test-reports, together with any
|
||||
- output to stdout or stderr generated by the test code.
|
||||
-
|
||||
- If you're having problems running this target due to the use of
|
||||
- the "junit" task below, see the comments at the head of this file.
|
||||
-
|
||||
- TODO: implement something like the "testmatchpattern" feature
|
||||
- of maven's test task. This would allow people to do something like
|
||||
- ant -Dtestmatchpattern=**/FooTestCase.java test.pathable
|
||||
- in order to run specific test cases, or subsets of test cases.
|
||||
-->
|
||||
<target name="test.pathable" depends="compile.tests"
|
||||
description="Run unit tests specific to Pathable support classes">
|
||||
<echo message="Test output can be found in directory ${build.home}/test-reports."/>
|
||||
<delete dir="${build.home}/test-reports"/>
|
||||
<mkdir dir="${build.home}/test-reports"/>
|
||||
|
||||
<echo message="Pathable tests..."/>
|
||||
<java classname="${test.runner}" fork="yes" failonerror="${test.failonerror}">
|
||||
<arg value="org.apache.commons.logging.pathable.PathableTestCase"/>
|
||||
<classpath refid="test.classpath.jdk14"/>
|
||||
<!--
|
||||
- Note that the fork/forkmode settings define default behaviour for tests.
|
||||
- The <test> and <batchtest> tags can override these settings if needed.
|
||||
- The default settings cause a single VM to be created in which all of
|
||||
- the tests are then run.
|
||||
-->
|
||||
<junit printsummary="off" showoutput="no" fork="yes" forkmode="once">
|
||||
<!-- plain output to file; brief output to console. -->
|
||||
<formatter type="plain"/>
|
||||
<formatter usefile="false" type="brief"/>
|
||||
|
||||
<!--
|
||||
- Provide a set of properties pointing to the logging libs for
|
||||
- the use of the PathableClassLoader class used by some unit tests.
|
||||
-->
|
||||
<syspropertyset refid="test-lib-props"/>
|
||||
</java>
|
||||
<classpath>
|
||||
<pathelement location="${build.home}/tests"/>
|
||||
<pathelement location="${junit.jar}"/>
|
||||
</classpath>
|
||||
|
||||
<!--
|
||||
- Auto-detect the tests to run. Checking the source directory
|
||||
- for java files rather than the ${build.home}/tests directory
|
||||
- for .class files is deliberate; that will pick up any problems
|
||||
- where we haven't correctly compiled all the available unit test
|
||||
- source files.
|
||||
-->
|
||||
<batchtest todir="${build.home}/test-reports">
|
||||
<fileset dir="${test.home}">
|
||||
<include name="**/pathable/*TestCase.java"/>
|
||||
</fileset>
|
||||
</batchtest>
|
||||
</junit>
|
||||
</target>
|
||||
|
||||
<target name="test.jdk14" depends="compile.tests" if="jdk.1.4.present"
|
||||
|
||||
Reference in New Issue
Block a user