You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by vm...@apache.org on 2005/04/22 21:15:48 UTC

svn commit: r164270 - in /maven/maven-1/plugins/trunk/clover: ./ src/plugin-test/testGenerateReportWhenNoTests/ src/plugin-test/testGenerateReportWhenNoTests/src/ src/plugin-test/testGenerateReportWhenNoTests/src/main/ src/plugin-test/testGenerateReportWhenNoTests/src/main/org/ src/plugin-test/testGenerateReportWhenNoTests/src/main/org/apache/ src/plugin-test/testGenerateReportWhenNoTests/src/main/org/apache/maven/ src/plugin-test/testGenerateReportWhenNoTests/src/main/org/apache/maven/clover/ src/plugin-test/testGenerateReportWhenNoTests/src/main/org/apache/maven/clover/test/ xdocs/

Author: vmassol
Date: Fri Apr 22 12:15:46 2005
New Revision: 164270

URL: http://svn.apache.org/viewcvs?rev=164270&view=rev
Log:
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.

Added:
    maven/maven-1/plugins/trunk/clover/src/plugin-test/testGenerateReportWhenNoTests/
    maven/maven-1/plugins/trunk/clover/src/plugin-test/testGenerateReportWhenNoTests/maven.xml
    maven/maven-1/plugins/trunk/clover/src/plugin-test/testGenerateReportWhenNoTests/project.properties
    maven/maven-1/plugins/trunk/clover/src/plugin-test/testGenerateReportWhenNoTests/project.xml
    maven/maven-1/plugins/trunk/clover/src/plugin-test/testGenerateReportWhenNoTests/src/
    maven/maven-1/plugins/trunk/clover/src/plugin-test/testGenerateReportWhenNoTests/src/main/
    maven/maven-1/plugins/trunk/clover/src/plugin-test/testGenerateReportWhenNoTests/src/main/org/
    maven/maven-1/plugins/trunk/clover/src/plugin-test/testGenerateReportWhenNoTests/src/main/org/apache/
    maven/maven-1/plugins/trunk/clover/src/plugin-test/testGenerateReportWhenNoTests/src/main/org/apache/maven/
    maven/maven-1/plugins/trunk/clover/src/plugin-test/testGenerateReportWhenNoTests/src/main/org/apache/maven/clover/
    maven/maven-1/plugins/trunk/clover/src/plugin-test/testGenerateReportWhenNoTests/src/main/org/apache/maven/clover/test/
    maven/maven-1/plugins/trunk/clover/src/plugin-test/testGenerateReportWhenNoTests/src/main/org/apache/maven/clover/test/Simple.java   (with props)
Modified:
    maven/maven-1/plugins/trunk/clover/plugin.jelly
    maven/maven-1/plugins/trunk/clover/xdocs/changes.xml

Modified: maven/maven-1/plugins/trunk/clover/plugin.jelly
URL: http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/clover/plugin.jelly?rev=164270&r1=164269&r2=164270&view=diff
==============================================================================
--- maven/maven-1/plugins/trunk/clover/plugin.jelly (original)
+++ maven/maven-1/plugins/trunk/clover/plugin.jelly Fri Apr 22 12:15:46 2005
@@ -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}">
 

Added: maven/maven-1/plugins/trunk/clover/src/plugin-test/testGenerateReportWhenNoTests/maven.xml
URL: http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/clover/src/plugin-test/testGenerateReportWhenNoTests/maven.xml?rev=164270&view=auto
==============================================================================
--- maven/maven-1/plugins/trunk/clover/src/plugin-test/testGenerateReportWhenNoTests/maven.xml (added)
+++ maven/maven-1/plugins/trunk/clover/src/plugin-test/testGenerateReportWhenNoTests/maven.xml Fri Apr 22 12:15:46 2005
@@ -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>
\ No newline at end of file

Added: maven/maven-1/plugins/trunk/clover/src/plugin-test/testGenerateReportWhenNoTests/project.properties
URL: http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/clover/src/plugin-test/testGenerateReportWhenNoTests/project.properties?rev=164270&view=auto
==============================================================================
--- maven/maven-1/plugins/trunk/clover/src/plugin-test/testGenerateReportWhenNoTests/project.properties (added)
+++ maven/maven-1/plugins/trunk/clover/src/plugin-test/testGenerateReportWhenNoTests/project.properties Fri Apr 22 12:15:46 2005
@@ -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

Added: maven/maven-1/plugins/trunk/clover/src/plugin-test/testGenerateReportWhenNoTests/project.xml
URL: http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/clover/src/plugin-test/testGenerateReportWhenNoTests/project.xml?rev=164270&view=auto
==============================================================================
--- maven/maven-1/plugins/trunk/clover/src/plugin-test/testGenerateReportWhenNoTests/project.xml (added)
+++ maven/maven-1/plugins/trunk/clover/src/plugin-test/testGenerateReportWhenNoTests/project.xml Fri Apr 22 12:15:46 2005
@@ -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>

Added: maven/maven-1/plugins/trunk/clover/src/plugin-test/testGenerateReportWhenNoTests/src/main/org/apache/maven/clover/test/Simple.java
URL: http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/clover/src/plugin-test/testGenerateReportWhenNoTests/src/main/org/apache/maven/clover/test/Simple.java?rev=164270&view=auto
==============================================================================
--- maven/maven-1/plugins/trunk/clover/src/plugin-test/testGenerateReportWhenNoTests/src/main/org/apache/maven/clover/test/Simple.java (added)
+++ maven/maven-1/plugins/trunk/clover/src/plugin-test/testGenerateReportWhenNoTests/src/main/org/apache/maven/clover/test/Simple.java Fri Apr 22 12:15:46 2005
@@ -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()
+    {        
+    }
+} 
\ No newline at end of file

Propchange: maven/maven-1/plugins/trunk/clover/src/plugin-test/testGenerateReportWhenNoTests/src/main/org/apache/maven/clover/test/Simple.java
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: maven/maven-1/plugins/trunk/clover/xdocs/changes.xml
URL: http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/clover/xdocs/changes.xml?rev=164270&r1=164269&r2=164270&view=diff
==============================================================================
--- maven/maven-1/plugins/trunk/clover/xdocs/changes.xml (original)
+++ maven/maven-1/plugins/trunk/clover/xdocs/changes.xml Fri Apr 22 12:15:46 2005
@@ -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.



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org