LUCENE-2609: Generate jar containing test classes (trunk)

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1064068 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Shai Erera 2011-01-27 10:10:36 +00:00
parent ecea5e669a
commit b24a26b251
3 changed files with 36 additions and 4 deletions

24
dev-tools/testjar/testfiles Executable file
View File

@ -0,0 +1,24 @@
core.test.files=\
org/apache/lucene/util/_TestUtil.java,\
org/apache/lucene/util/LineFileDocs.java,\
org/apache/lucene/util/LuceneJUnitDividingSelector.java,\
org/apache/lucene/util/LuceneJUnitResultFormatter.java,\
org/apache/lucene/util/LuceneTestCase.java,\
org/apache/lucene/util/automaton/AutomatonTestUtil.java,\
org/apache/lucene/search/QueryUtils.java,\
org/apache/lucene/analysis/BaseTokenStreamTestCase.java,\
org/apache/lucene/analysis/MockAnalyzer.java,\
org/apache/lucene/analysis/MockPayloadAnalyzer.java,\
org/apache/lucene/analysis/MockTokenFilter.java,\
org/apache/lucene/analysis/MockTokenizer.java,\
org/apache/lucene/index/MockIndexInput.java,\
org/apache/lucene/index/RandomIndexWriter.java,\
org/apache/lucene/index/DocHelper.java,\
org/apache/lucene/codecs/preflexrw/PreFlexFieldsWriter.java,\
org/apache/lucene/codecs/preflexrw/PreFlexRWCodec.java,\
org/apache/lucene/codecs/preflexrw/TermInfosWriter.java,\
org/apache/lucene/codecs/mockrandom/MockRandomCodec.java,\
org/apache/lucene/store/_TestHelper.java,\
org/apache/lucene/store/MockDirectoryWrapper.java,\
org/apache/lucene/store/MockIndexInputWrapper.java,\
org/apache/lucene/store/MockIndexOutputWrapper.java,\

View File

@ -618,4 +618,16 @@
</rat:report> </rat:report>
</target> </target>
<target name="jar-core-test" depends="compile-test">
<!-- load the list of test files into a property named core.test.files -->
<property file="../dev-tools/testjar/testfiles" />
<!-- copy the files so that we can compile and include both .java and .class in the jar -->
<copy todir="${build.dir}/testjar" >
<fileset dir="src/test" includes="${core.test.files}" />
</copy>
<compile-test-macro srcdir="${build.dir}/testjar" destdir="${build.dir}/testjar"
test.classpath="test.classpath"/>
<jarify basedir="${build.dir}/testjar" destfile="${build.dir}/${final.name}-tests.jar"/>
</target>
</project> </project>

View File

@ -308,10 +308,6 @@
<jarify/> <jarify/>
</target> </target>
<target name="jar-core-test" depends="compile-test">
<jarify basedir="${build.dir}/classes/test" destfile="${build.dir}/${final.name}-tests.jar"/>
</target>
<target name="maven.ant.tasks-check"> <target name="maven.ant.tasks-check">
<fail unless="maven.ant.tasks.present"> <fail unless="maven.ant.tasks.present">
################################################################## ##################################################################