MPCLOVER-35: Always generate Clover reports even when there is no coverage data. One of the reason is that Clover generates metrics other than coverage percentage, like LOC and NCLOC which are useful in themselves.

git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@164270 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
vmassol committed 2005-04-22 19:15:46 +00:00
1 parent 1cf551d437
commit a578ec3c6f
6 files changed
+129 -7

No files matched your search

+12 -7
View File
@@ -214,18 +214,24 @@
<goal name="clover:test"
description="Compile project code with Clover and executes the unit tests">
<attainGoal name="clover:on"/>
<!-- Only run clover if there are tests to execute -->
<j:choose>
<j:when test="${unitTestSourcesPresent == 'true'}">
<attainGoal name="clover:on"/>
<attainGoal name="test:test"/>
<attainGoal name="clover:off"/>
</j:when>
<j:when test="${sourcesPresent == 'true'}">
<attainGoal name="java:compile"/>
<attainGoal name="java:jar-resources"/>
</j:when>
<j:otherwise>
<ant:echo>No tests to run Clover on</ant:echo>
<ant:echo>No sources and not tests to run Clover on</ant:echo>
</j:otherwise>
</j:choose>
<attainGoal name="clover:off"/>
</goal>
<!--
@@ -294,7 +300,7 @@
-->
<goal name="clover:xml-report-internal">
<ant:clover-report>
<ant:current outfile="${maven.build.dir}/clover.xml"
<ant:current outfile="${maven.build.dir}/clover.xml" alwaysReport="true"
title="${pom.name} - ${pom.currentVersion}">
<ant:format type="xml" orderBy="${maven.clover.orderBy}">
@@ -324,8 +330,7 @@
<ant:clover-report>
<ant:current
outfile="${cloverReportDirectory}"
<ant:current outfile="${cloverReportDirectory}" alwaysReport="true"
title="${pom.name} - ${pom.currentVersion}">
<ant:format type="html" orderBy="${maven.clover.orderBy}">
@@ -383,7 +388,7 @@
<ant:mkdir dir="${cloverReportDirectory}"/>
<ant:clover-report>
<ant:current outfile="${cloverPDFReportFile}"
<ant:current outfile="${cloverPDFReportFile}" alwaysReport="true"
title="${pom.name} - ${pom.currentVersion}" summary="true">
<ant:format type="pdf" orderBy="${maven.clover.orderBy}">
@@ -0,0 +1,40 @@
<!--
/*
* Copyright 2005 The Apache Software Foundation.
*
* Licensed 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.
*/
-->
<project default="testPlugin"
xmlns:util="jelly:util"
xmlns:j="jelly:core"
xmlns:ant="jelly:ant"
xmlns:x="jelly:xml"
xmlns:maven="jelly:maven"
xmlns:assert="assert">
<goal name="testPlugin">
<!-- Fixture -->
<attainGoal name="clean"/>
<attainGoal name="clover"/>
<!-- Verifications -->
<assert:assertFileExists file="${maven.docs.dest}/clover/index.html"/>
<assert:assertFileExists file="${maven.build.dir}/clover.xml"/>
<assert:assertFileExists file="${maven.docs.dest}/clover/clover.pdf"/>
</goal>
</project>
@@ -0,0 +1,19 @@
# -------------------------------------------------------------------
# Copyright 2005 The Apache Software Foundation.
#
# Licensed 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.
# -------------------------------------------------------------------
maven.clover.report.xml = true
maven.clover.report.html = true
maven.clover.report.pdf = true
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/*
* Copyright 2005 The Apache Software Foundation.
*
* Licensed 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.
*/
-->
<project>
<extend>${basedir}/../project.xml</extend>
<id>testGenerateReportWhenNoTests</id>
<name>testGenerateReportWhenNoTests</name>
<build>
<sourceDirectory>src/main</sourceDirectory>
</build>
</project>
@@ -0,0 +1,25 @@
package org.apache.maven.clover.test;
/* ====================================================================
* Copyright 2001-2005 The Apache Software Foundation.
*
* Licensed 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.
* ====================================================================
*/
public class Simple
{
public void someMethod()
{
}
}
+5
View File
@@ -26,6 +26,11 @@
</properties>
<body>
<release version="1.9-SNAPSHOT" date="in SVN">
<action dev="vmassol" type="update" issue="MPCLOVER-35">
Always generate Clover reports even when there is no coverage data. One
of the reason is that Clover generates metrics other than coverage
percentage, like LOC and NCLOC which are useful in themselves.
</action>
<action dev="vmassol" type="update" issue="MPCLOVER-36">Upgraded to Clover 1.3.6</action>
<action dev="vmassol" type="add" issue="MPCLOVER-31" due-to="Olivier Jacob">
Added PDF report generation.