hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject svn commit: r682496 - in /hadoop/hbase/trunk: CHANGES.txt build.xml
Date Mon, 04 Aug 2008 20:31:13 GMT
Author: stack
Date: Mon Aug  4 13:31:13 2008
New Revision: 682496

URL: http://svn.apache.org/viewvc?rev=682496&view=rev
Log:
HBASE-789 add clover coverage report targets

Modified:
    hadoop/hbase/trunk/CHANGES.txt
    hadoop/hbase/trunk/build.xml

Modified: hadoop/hbase/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/CHANGES.txt?rev=682496&r1=682495&r2=682496&view=diff
==============================================================================
--- hadoop/hbase/trunk/CHANGES.txt (original)
+++ hadoop/hbase/trunk/CHANGES.txt Mon Aug  4 13:31:13 2008
@@ -331,6 +331,7 @@
    HBASE-779   Test changing hbase.hregion.memcache.block.multiplier to 2
    HBASE-783   For single row, single family retrieval, getRow() works half
                as fast as getScanner().next() (Jean-Daniel Cryans via Stack)
+   HBASE-789   add clover coverage report targets (Rong-en Fan via Stack)
 
   NEW FEATURES
    HBASE-47    Option to set TTL for columns in hbase

Modified: hadoop/hbase/trunk/build.xml
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/build.xml?rev=682496&r1=682495&r2=682496&view=diff
==============================================================================
--- hadoop/hbase/trunk/build.xml (original)
+++ hadoop/hbase/trunk/build.xml Mon Aug  4 13:31:13 2008
@@ -65,11 +65,24 @@
   <property name="javac.deprecation" value="off"/>
   <property name="javac.debug" value="on"/>
 
+  <property name="clover.db.dir" location="${build.dir}/test/clover/db"/>
+  <property name="clover.report.dir" location="${build.dir}/test/clover/reports"/>
+
+
   <property name="javadoc.link.java"
     value="http://java.sun.com/j2se/1.5/docs/api/"/>
   <property name="javadoc.packages" value="org.apache.hadoop.hbase.*"/>
   <property name="jarfile" value="${build.dir}/${final.name}.jar" />
 
+  <available property="clover.present" classname="com.cenqua.clover.tasks.CloverReportTask"
/>
+
+  <!-- check if clover reports should be generated -->
+  <condition property="clover.enabled">
+    <and>
+        <isset property="run.clover"/>
+        <isset property="clover.present"/>
+    </and>
+  </condition>
 
   <!--We need to have the hadoop jars ride in front of the hbase classes or we
     get the below exceptions:
@@ -125,7 +138,7 @@
     </exec>
   </target>
 
-  <target name="compile" depends="init,jspc">
+  <target name="compile" depends="clover,init,jspc">
    <!--Compile whats under src and generated java classes made from jsp-->
    <javac
     encoding="${build.encoding}"
@@ -187,6 +200,46 @@
     <echo message="Setting jspc.notRequired property. jsp pages generated once per ant
session only" />
   </target>
 
+  <target name="clover" depends="clover.setup, clover.info" description="Instrument the
Unit tests using Clover.  Requires a Clover license and clover.jar in the ANT classpath. 
To use, specify -Drun.clover=true on the command line."/>
+
+  <target name="clover.setup" if="clover.enabled">
+    <taskdef resource="clovertasks"/>
+    <mkdir dir="${clover.db.dir}"/>
+    <clover-setup initString="${clover.db.dir}/hbase_coverage.db">
+      <fileset dir="src" includes="java/**/*"/>
+    </clover-setup>
+  </target>
+
+  <target name="clover.info" unless="clover.present">
+    <echo>
+      Clover not found. Code coverage reports disabled.
+    </echo>
+  </target>
+
+  <target name="clover.check">
+    <fail unless="clover.present">
+      ##################################################################
+      Clover not found.
+      Please make sure clover.jar is in ANT_HOME/lib, or made available
+      to Ant using other mechanisms like -lib or CLASSPATH.
+      ##################################################################
+    </fail>
+  </target>
+
+  <target name="generate-clover-reports" depends="clover.check, clover">
+    <mkdir dir="${clover.report.dir}"/>
+    <clover-report>
+      <current outfile="${clover.report.dir}" title="${final.name}">
+        <format type="html"/>
+      </current>
+    </clover-report>
+    <clover-report>
+      <current outfile="${clover.report.dir}/clover.xml" title="${final.name}">
+        <format type="xml"/>
+      </current>
+    </clover-report>
+  </target>
+
   <!-- ================================================================== -->
   <!-- Package                                                            -->
   <!-- ================================================================== -->



Mime
View raw message