LUCENE-8170: Improve OpenClover reports (separate test from production code); enable coverage reports inside test-frameworks

This commit is contained in:
Uwe Schindler 2018-02-11 19:24:22 +01:00
parent 130a0c0907
commit 95e94ab9d9
4 changed files with 14 additions and 4 deletions

View File

@ -524,14 +524,21 @@ File | Project Structure | Platform Settings | SDKs):
<fileset dir="." id="clover.test.result.files">
<include name="*/build/**/test/TEST-*.xml"/>
</fileset>
<fileset dir="." id="clover.test.src.files">
<include name="**/src/test/**/*.java"/>
<!-- test framework source files are all test code: -->
<include name="*/test-framework/src/**/*.java"/>
</fileset>
<clover-report projectName="Apache Lucene/Solr">
<current outfile="${clover.report.dir}" title="Apache Lucene/Solr ${version}" numThreads="0">
<format type="html" filter="assert"/>
<testresults refid="clover.test.result.files"/>
<testsources refid="clover.test.src.files"/>
</current>
<current outfile="${clover.report.dir}/clover.xml" title="Apache Lucene/Solr ${version}">
<format type="xml" filter="assert"/>
<testresults refid="clover.test.result.files"/>
<testsources refid="clover.test.src.files"/>
</current>
</clover-report>
<echo>You can find the merged Lucene/Solr Clover report in '${clover.report.dir}'.</echo>

View File

@ -192,6 +192,9 @@ Other
* LUCENE-8169: Migrated build to use OpenClover 4.2.1 for checking code coverage.
(Uwe Schindler)
* LUCENE-8170: Improve OpenClover reports (separate test from production code);
enable coverage reports inside test-frameworks. (Uwe Schindler)
Build
* LUCENE-8168: Moved Groovy scripts in build files to separate files.

View File

@ -40,6 +40,9 @@
<target name="-check-forbidden-tests"/>
<target name="-check-forbidden-sysout"/>
<!-- disable clover -->
<target name="-clover.setup" if="run.clover"/>
<!--
Specialize compile-core to not depend on clover, to exclude a
classpath reference when compiling, and to not attempt to copy

View File

@ -37,7 +37,7 @@
</ant>
</target>
<target name="compile-core" depends="resolve, compile-solr-core, compile-test-framework">
<target name="compile-core" depends="resolve, clover, compile-solr-core, compile-test-framework">
<!-- TODO: why does test-framework override compile-core to use this special classpath? -->
<compile srcdir="${src.dir}" destdir="${build.dir}/classes/java">
<classpath refid="test.base.classpath"/>
@ -49,9 +49,6 @@
</copy>
</target>
<!-- redefine the clover setup, because we dont want to run clover for the test-framework -->
<target name="-clover.setup" if="run.clover"/>
<!-- redefine the forbidden apis for tests, as we check ourselves -->
<target name="-check-forbidden-tests" depends="-init-forbidden-apis,compile-core">
<forbidden-apis suppressAnnotation="**.SuppressForbidden" signaturesFile="${common.dir}/tools/forbiddenApis/tests.txt" classpathref="forbidden-apis.allclasses.classpath">