incubator-hcatalog-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject svn commit: r1330459 - in /incubator/hcatalog/branches/branch-0.4: CHANGES.txt build.xml
Date Wed, 25 Apr 2012 18:14:43 GMT
Author: gates
Date: Wed Apr 25 18:14:43 2012
New Revision: 1330459

URL: http://svn.apache.org/viewvc?rev=1330459&view=rev
Log:
HCATALOG-383 Add clover to build.xml

Modified:
    incubator/hcatalog/branches/branch-0.4/CHANGES.txt
    incubator/hcatalog/branches/branch-0.4/build.xml

Modified: incubator/hcatalog/branches/branch-0.4/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/hcatalog/branches/branch-0.4/CHANGES.txt?rev=1330459&r1=1330458&r2=1330459&view=diff
==============================================================================
--- incubator/hcatalog/branches/branch-0.4/CHANGES.txt (original)
+++ incubator/hcatalog/branches/branch-0.4/CHANGES.txt Wed Apr 25 18:14:43 2012
@@ -79,6 +79,8 @@ Release 0.4.0 - Unreleased
   HCAT-2 Support nested schema conversion between Hive an Pig (julienledem via hashutosh)
 
   IMPROVEMENTS
+  HCAT-383 Add clover to build.xml (gates)
+
   HCAT-372 Add filter information to Load/Store and Input/Output docs (lefty via gates)
 
   HCAT-379 Fix mapred.out.dir hack in FileOutputCommitterContainer (toffer)

Modified: incubator/hcatalog/branches/branch-0.4/build.xml
URL: http://svn.apache.org/viewvc/incubator/hcatalog/branches/branch-0.4/build.xml?rev=1330459&r1=1330458&r2=1330459&view=diff
==============================================================================
--- incubator/hcatalog/branches/branch-0.4/build.xml (original)
+++ incubator/hcatalog/branches/branch-0.4/build.xml Wed Apr 25 18:14:43 2012
@@ -71,6 +71,23 @@
   <property name="test.warehouse.dir" value="/tmp/hcat_junit_warehouse"/>
   <property name="test.excludes" value="e2e/**"/>
 
+  <property name="clover.db.dir" location="${build.dir}/test/clover/db"/>
+  <property name="clover.report.dir" location="${build.dir}/test/clover/reports"/>
+  <property name="clover.pdf.report.dir" location="${build.dir}/test/clover/pdf/reports"/>
+  <property name="clover.jar" location="${clover.home}/lib/clover.jar"/>
+  <available property="clover.present" file="${clover.jar}" />
+
+  <!-- check if clover reports should be generated -->
+  <condition property="clover.enabled">
+    <and>
+      <isset property="run.clover"/>
+      <isset property="clover.present"/>
+    </and>
+  </condition>
+  <condition property="staging">
+    <equals arg1="${repo}" arg2="staging"/>
+  </condition>
+
   <!-- e2e test properties -->
   <property name="test.e2e.dir" value="${basedir}/src/test/e2e/hcatalog"/>
 
@@ -339,6 +356,7 @@
         <classpath>
           <pathelement location="${test.build.classes}" />
           <pathelement location="." />
+          <pathelement path="${clover.jar}"/>
           <path refid="test.classpath"/>
         </classpath>
         <formatter type="${test.junit.output.format}" />
@@ -367,6 +385,54 @@
     <antcall target="test-storage-handlers"/>
   </target>
 
+  <target name="clover" depends="clover.setup, clover.info"
+      description="Instrument the Unit tests using Clover.  To use, specify 
+      -Dclover.home=&lt;base of clover installation&gt; -Drun.clover=true on
+      the command line."/>
+
+  <target name="clover.setup" if="clover.enabled">
+    <taskdef resource="cloverlib.xml" classpath="${clover.jar}"/>
+    <mkdir dir="${clover.db.dir}"/>
+    <clover-setup initString="${clover.db.dir}/pig_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 specify -Dclover.home=&lt;base of clover installation&gt;
+        on the command line.
+       ##################################################################
+    </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>
+
+  <target name="generate-pdf-clover-reports" depends="clover.check, clover">
+    <mkdir dir="${clover.pdf.report.dir}"/>
+    <clover-pdf-report outfile="${clover.pdf.report.dir}/clover_coverage.pdf" />
+  </target>
+
   <!--
   ================================================================================
   Clean Section



Mime
View raw message