mirror of https://github.com/apache/lucene.git
add task "test-deprecated" to run deprecated test cases.
git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@150695 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
c0b059bf97
commit
a48937b2c5
66
build.xml
66
build.xml
|
@ -59,6 +59,12 @@
|
|||
<pathelement location="${build.dir}/classes/test"/>
|
||||
</path>
|
||||
|
||||
<!-- classpath for deprecated test cases, should be removed when moving from 1.9 to 2.0 -->
|
||||
<path id="test-deprecated.classpath">
|
||||
<path refid="demo.classpath"/>
|
||||
<pathelement location="${build.dir}/classes/test-deprecated"/>
|
||||
</path>
|
||||
|
||||
<path id="junit.classpath">
|
||||
<pathelement location="${build.dir}/classes/test"/>
|
||||
<pathelement location="${build.dir}/classes/java"/>
|
||||
|
@ -69,6 +75,17 @@
|
|||
<pathelement path="${java.class.path}"/>
|
||||
</path>
|
||||
|
||||
<!-- junit classpath for deprecated test cases, should be removed when moving from 1.9 to 2.0 -->
|
||||
<path id="junit-deprecated.classpath">
|
||||
<pathelement location="${build.dir}/classes/test-deprecated"/>
|
||||
<pathelement location="${build.dir}/classes/java"/>
|
||||
<pathelement location="${build.dir}/classes/demo"/>
|
||||
<fileset dir="lib">
|
||||
<include name="*.jar"/>
|
||||
</fileset>
|
||||
<pathelement path="${java.class.path}"/>
|
||||
</path>
|
||||
|
||||
<path id="anakia.classpath">
|
||||
<fileset dir="${jakarta.site2.home}/lib">
|
||||
<include name="*.jar"/>
|
||||
|
@ -225,6 +242,55 @@
|
|||
</target>
|
||||
|
||||
|
||||
<!-- ================================================================== -->
|
||||
<!-- B U I L D D E P R E C A T E D T E S T -->
|
||||
<!-- ================================================================== -->
|
||||
<!-- should be removed when moving from lucene 1.9 to 2.0 -->
|
||||
<!-- ================================================================== -->
|
||||
<target name="compile-test-deprecated" depends="compile-core,compile-demo">
|
||||
<mkdir dir="${build.dir}/classes/test-deprecated"/>
|
||||
<javac
|
||||
encoding="${build.encoding}"
|
||||
srcdir="src/test-deprecated"
|
||||
includes="**/*.java"
|
||||
destdir="${build.dir}/classes/test-deprecated"
|
||||
debug="true">
|
||||
<classpath refid="test-deprecated.classpath"/>
|
||||
</javac>
|
||||
</target>
|
||||
|
||||
<!-- ================================================================== -->
|
||||
<!-- R U N D E P R E C A T E D T E S T S -->
|
||||
<!-- ================================================================== -->
|
||||
<!-- should be removed when moving from lucene 1.9 to 2.0 -->
|
||||
<!-- ================================================================== -->
|
||||
<target name="test-deprecated" depends="compile-test-deprecated" description="Runs deprecated unit tests">
|
||||
<fail unless="junit.present">
|
||||
##################################################################
|
||||
JUnit not found.
|
||||
Please make sure junit.jar is in ANT_HOME/lib, or made available
|
||||
to Ant using other mechanisms like -lib or CLASSPATH.
|
||||
##################################################################
|
||||
</fail>
|
||||
<mkdir dir="${junit.output.dir}"/>
|
||||
<junit printsummary="off" haltonfailure="no"
|
||||
errorProperty="tests.failed" failureProperty="tests.failed">
|
||||
<classpath refid="junit-deprecated.classpath"/>
|
||||
<sysproperty key="dataDir" file="src/test-deprecated"/>
|
||||
<sysproperty key="tempDir" file="${build.dir}/test-deprecated"/>
|
||||
<formatter type="xml"/>
|
||||
<formatter type="brief" usefile="false"/>
|
||||
<batchtest fork="yes" todir="${junit.output.dir}" unless="testcase">
|
||||
<fileset dir="src/test-deprecated" includes="**/Test*.java"/>
|
||||
</batchtest>
|
||||
<batchtest fork="yes" todir="${junit.output.dir}" if="testcase">
|
||||
<fileset dir="src/test-deprecated" includes="**/${testcase}.java"/>
|
||||
</batchtest>
|
||||
</junit>
|
||||
|
||||
<fail if="tests.failed">Tests failed!</fail>
|
||||
</target>
|
||||
|
||||
<!-- ================================================================== -->
|
||||
<!-- B U I L D T E S T -->
|
||||
<!-- ================================================================== -->
|
||||
|
|
Loading…
Reference in New Issue