[jboss-cvs] JBoss Messaging SVN: r4378 - in trunk: tests/lib and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Jun 4 06:48:54 EDT 2008


Author: ataylor
Date: 2008-06-04 06:48:53 -0400 (Wed, 04 Jun 2008)
New Revision: 4378

Added:
   trunk/tests/lib/emma.jar
   trunk/tests/lib/emma_ant.jar
Modified:
   trunk/build-messaging.xml
   trunk/build.xml
Log:
added emma libs and ant target for code coverage

Modified: trunk/build-messaging.xml
===================================================================
--- trunk/build-messaging.xml	2008-06-02 14:51:15 UTC (rev 4377)
+++ trunk/build-messaging.xml	2008-06-04 10:48:53 UTC (rev 4378)
@@ -75,7 +75,8 @@
    <property name="native.bin.dir" value="native/bin"/>
    <property name="examples.dir" value="examples"/>
 
-   <property name="build.artifact" value="${module.name}-${messaging.version.major}.${messaging.version.minor}.${messaging.version.micro}.${messaging.version.suffix}" />
+   <property name="build.artifact"
+             value="${module.name}-${messaging.version.major}.${messaging.version.minor}.${messaging.version.micro}.${messaging.version.suffix}"/>
    <property name="build.distro.dir"
              value="${build.dir}/${build.artifact}"/>
    <property name="build.distro.lib.dir" value="${build.distro.dir}/lib"/>
@@ -477,7 +478,7 @@
       <copy todir="${build.distro.bin.dir}">
          <fileset dir="${src.bin.dir}">
             <include name="run.sh"/>
-	        <include name="run.bat"/>
+            <include name="run.bat"/>
          </fileset>
       </copy>
 
@@ -486,7 +487,7 @@
             <include name="*.so"/>
          </fileset>
       </copy>
-   	
+
       <antcall target="userdoc"/>
       <copy todir="${build.distro.dir}/docs/userguide">
          <fileset dir="${doc.build.dir}">
@@ -522,19 +523,19 @@
            destfile="${build.dir}/${build.artifact}.zip">
          <include name="${build.artifact}/**"/>
          <!-- add run.sh using a zipfileset to preserve its file permission -->
-      	 <exclude name="${build.artifact}/bin/run.sh" />
-      	 <zipfileset dir="${build.dir}/${build.artifact}/bin" 
-      	 	includes="run.sh" filemode="755" prefix="${build.artifact}/bin" />
+         <exclude name="${build.artifact}/bin/run.sh"/>
+         <zipfileset dir="${build.dir}/${build.artifact}/bin"
+                     includes="run.sh" filemode="755" prefix="${build.artifact}/bin"/>
       </zip>
-   	
+
       <tar basedir="${build.dir}"
            destfile="${build.dir}/${build.artifact}.tar"
            longfile="gnu">
          <include name="${build.artifact}/**"/>
-      	 <!-- add run.sh using a tarfileset to preserve its file permission -->
-      	 <exclude name="${build.artifact}/bin/run.sh"/>
-     	 <tarfileset dir="${build.dir}/${build.artifact}/bin" 
-     	 	includes="run.sh" filemode="755" prefix="${build.artifact}/bin" />
+         <!-- add run.sh using a tarfileset to preserve its file permission -->
+         <exclude name="${build.artifact}/bin/run.sh"/>
+         <tarfileset dir="${build.dir}/${build.artifact}/bin"
+                     includes="run.sh" filemode="755" prefix="${build.artifact}/bin"/>
       </tar>
       <gzip src="${build.dir}/${build.artifact}.tar"
             destfile="${build.dir}/${build.artifact}.tar.gz"/>
@@ -756,6 +757,80 @@
       <echo message="${test.execution.classpath.unix}" file="${test.execution.classpath.file}"/>
    </target>
 
+   <target name="emma" depends="compile, compile-unit-tests">
+      <property name="emma.dir" location="${build.dir}/emma"/>
+
+      <path id="emma.lib">
+         <pathelement location="${test.dir}/lib/emma.jar"/>
+         <pathelement location="${test.dir}/lib/emma_ant.jar"/>
+      </path>
+
+      <taskdef resource="emma_ant.properties" classpathref="emma.lib"/>
+      <!-- Instrument the .class files. -->
+      <mkdir dir="${build.dir}/emmaclasses"/>
+      <emma enabled="true">
+         <instr instrpath="${build.dir}/classes"
+                destdir="${build.dir}/classes"
+                metadatafile="${emma.dir}/metadata.emma"
+                merge="true" mode="overwrite">
+         </instr>
+      </emma>
+
+      <path id="emma.execution.classpath">
+         <path refid="emma.lib"/>
+         <path refid="unit.test.execution.classpath"/>
+      </path>
+
+      <echo message=""/>
+      <echo message="Running unit tests, fork=${junit.fork}, junit.batchtest.fork=${junit.batchtest.fork}"/>
+      <echo message=""/>
+      <mkdir dir="${test.output.dir}"/>
+      <mkdir dir="${test.reports.dir}"/>
+      <junit printsummary="${junit.printsummary}"
+             fork="on"
+             forkMode="once"
+             includeantruntime="${junit.includeantruntime}"
+             haltonerror="${junit.haltonerror}"
+             haltonfailure="${junit.haltonfailure}"
+             showoutput="${junit.showoutput}"
+             timeout="${junit.timeout}">
+         <sysproperty key="user.home" value="${user.home}"/>
+         <sysproperty key="emma.coverage.out.file" value="${emma.dir}/coverage.emma"/>
+         <sysproperty key="emma.coverage.out.merge" value="true"/>
+         <jvmarg value="-Djava.library.path=native/bin"/>
+         <jvmarg value="-Xmx1024M"/>
+         <!--<jvmarg line="-Xmx512M -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005"/>-->
+         <!--<jvmarg value="-ea"/>-->
+         <classpath refid="emma.execution.classpath"/>
+         <formatter type="xml" usefile="${junit.formatter.usefile}"/>
+         <batchtest todir="${junit.batchtest.todir}"
+                    haltonfailure="${junit.batchtest.haltonfailure}"
+                    haltonerror="${junit.batchtest.haltonerror}">
+            <formatter type="plain" usefile="${junit.formatter.usefile}"/>
+            <fileset dir="${test.classes.dir}">
+               <include name="**/org/jboss/messaging/tests/integration/**/*${test-mask}.class"/>
+               <include name="**/org/jboss/messaging/tests/unit/**/*${test-mask}.class"/>
+               <exclude name="**/org/jboss/messaging/tests/local/**/*${test-mask}.class"/>
+               <exclude name="**/org/jboss/messaging/tests/performance/**/*${test-mask}.class"/>
+            </fileset>
+         </batchtest>
+      </junit>
+
+      <!-- Generate Emma reports. -->
+      <emma enabled="true">
+         <report sourcepath="${src.main.dir}"
+                 sort="+name"
+                 metrics="method:70,block:80,line:80,class:100">
+            <fileset dir="${emma.dir}">
+               <include name="*.emma"/>
+            </fileset>
+            <xml outfile="${test.reports.dir}/emma/coverage.xml" depth="method"/>
+            <html outfile="${test.reports.dir}/emma/coverage.html"
+                  depth="method" columns="name,class,method,block,line"/>
+         </report>
+      </emma>
+
+   </target>
    <!--server-->
 
    <target name="runServer" depends="jar">

Modified: trunk/build.xml
===================================================================
--- trunk/build.xml	2008-06-02 14:51:15 UTC (rev 4377)
+++ trunk/build.xml	2008-06-04 10:48:53 UTC (rev 4378)
@@ -77,7 +77,7 @@
    <target name="build-native" depends="createthirdparty">
       <ant antfile="build-messaging.xml" target="build-native"/>
    </target>
-   
+
    <target name="userdoc">
       <ant antfile="build-messaging.xml" target="userdoc"/>
    </target>
@@ -129,6 +129,10 @@
       <ant antfile="build-messaging.xml" target="compile-reports"/>
    </target>
 
+   <target name="emma" depends="createthirdparty">
+      <ant antfile="build-messaging.xml" target="emma"/>
+   </target>
+
    <!--server-->
 
    <target name="runServer" depends="createthirdparty">

Added: trunk/tests/lib/emma.jar
===================================================================
(Binary files differ)


Property changes on: trunk/tests/lib/emma.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/tests/lib/emma_ant.jar
===================================================================
(Binary files differ)


Property changes on: trunk/tests/lib/emma_ant.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream




More information about the jboss-cvs-commits mailing list