mirror of https://github.com/apache/lucene.git
LUCENE-1769: Improve clover analysis and separate core / bw tests. Also verify that assertions are enabled.
git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@891897 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
0de0bc8ce2
commit
1658315c35
|
@ -134,7 +134,8 @@
|
|||
<!-- run tag tests against trunk jar -->
|
||||
<test-macro dataDir="${tags.dir}/${tag}/src/test"
|
||||
tempDir="${build.dir}/${tag}"
|
||||
junit.classpath="tag.junit.classpath"/>
|
||||
junit.classpath="tag.junit.classpath"
|
||||
junit.output.dir="${junit.output.dir.tag}" />
|
||||
</sequential>
|
||||
</target>
|
||||
|
||||
|
|
|
@ -95,7 +95,9 @@
|
|||
<property name="jflex.home" location="${common.dir}"/>
|
||||
|
||||
<property name="junit.output.dir" location="${build.dir}/test"/>
|
||||
<property name="junit.output.dir.tag" location="${build.dir}/bw-test"/>
|
||||
<property name="junit.reports" location="${build.dir}/test/reports"/>
|
||||
<property name="junit.reports.tag" location="${build.dir}/bw-test/reports"/>
|
||||
<property name="junit.includes" value="**/Test*.java,**/*Test.java"/>
|
||||
<property name="junit.excludes" value=""/>
|
||||
|
||||
|
@ -507,16 +509,22 @@
|
|||
<fileset dir="src/test" id="clover.test.src.files">
|
||||
<include name="**/*.java" />
|
||||
</fileset>
|
||||
<fileset dir="${build.dir}" id="clover.test.result.files">
|
||||
<include name="**/test/TEST-*.xml" />
|
||||
<!-- do not include BW tests -->
|
||||
</fileset>
|
||||
<clover-report>
|
||||
<current outfile="${clover.report.dir}" title="${final.name}">
|
||||
<format type="html"/>
|
||||
<testsources refid="clover.test.src.files"/>
|
||||
<testsources refid="clover.contrib.test.src.files"/>
|
||||
<testresults refid="clover.test.result.files"/>
|
||||
</current>
|
||||
<current outfile="${clover.report.dir}/clover.xml" title="${final.name}">
|
||||
<format type="xml"/>
|
||||
<testsources refid="clover.test.src.files"/>
|
||||
<testsources refid="clover.contrib.test.src.files"/>
|
||||
<testresults refid="clover.test.result.files"/>
|
||||
</current>
|
||||
</clover-report>
|
||||
</target>
|
||||
|
@ -532,6 +540,17 @@
|
|||
</fileset>
|
||||
<report format="frames" todir="${junit.reports}"/>
|
||||
</junitreport>
|
||||
|
||||
<mkdir dir="${junit.reports.tag}"/>
|
||||
<junitreport todir="${junit.output.dir.tag}">
|
||||
<!-- this fileset let's the task work for individual contribs,
|
||||
as well as the project as a whole
|
||||
-->
|
||||
<fileset dir="${build.dir}">
|
||||
<include name="**/bw-test/TEST-*.xml"/>
|
||||
</fileset>
|
||||
<report format="frames" todir="${junit.reports.tag}"/>
|
||||
</junitreport>
|
||||
</target>
|
||||
|
||||
<target name="jar" depends="jar-core">
|
||||
|
|
|
@ -0,0 +1,32 @@
|
|||
package org.apache.lucene;
|
||||
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import org.apache.lucene.util.LuceneTestCase;
|
||||
|
||||
public class TestAssertions extends LuceneTestCase {
|
||||
|
||||
public void test() {
|
||||
try {
|
||||
assert Boolean.FALSE.booleanValue();
|
||||
fail("assertions are not enabled!");
|
||||
} catch (AssertionError e) {
|
||||
}
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue