Changeset 280


Ignore:
Timestamp:
12/08/11 16:48:46 (12 years ago)
Author:
sherbold
Message:
  • build script now evaluate code coverage with EMMA
Location:
trunk/JavaCommons
Files:
2 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaCommons

    • Property svn:ignore
      •  

        old new  
        44 
        55bin 
         6 
         7test-results 
         8 
         9testoutput 
         10 
         11testdata 
         12 
         13downloads 
         14 
         15coverage 
         16 
         17inst 
  • trunk/JavaCommons/build.xml

    r279 r280  
    9797        <path id="JFCMonitor.classpath" /> 
    9898 
     99        <!-- Emma Configuration --> 
     100        <property name="coverage.location" value="coverage" /> 
     101        <property name="coverage.instrumented" value="inst" /> 
     102        <property name="coverage.instrumented.javahelperlib" value="${coverage.instrumented}/javahelperlib" /> 
     103        <property name="coverage.instrumented.eventbenchcore" value="${coverage.instrumented}/eventbenchcore" /> 
     104        <path id="emma.classpath"> 
     105                <pathelement location="lib-test/emma.jar" /> 
     106                <pathelement location="lib-test/emma_ant.jar" /> 
     107        </path> 
     108 
     109        <taskdef resource="emma_ant.properties" classpathref="emma.classpath" /> 
     110 
    99111        <!-- JUnit Test General Properties --> 
    100112        <property name="test.location.results" value="test-results" /> 
     
    111123        <property name="test.eventbenchcore.main-class" value="de.ugoe.cs.eventbench.TestAll" /> 
    112124        <property name="test.eventbenchcore.results" value="${test.location.results}/eventbenchcore" /> 
    113         <path id="EventBenchCoreTest.classpath"> 
     125        <path id="EventBenchCoreJUnitCompile.classpath"> 
    114126                <pathelement location="${test.location.eventbenchcore}" /> 
     127                <!--<pathelement location="${coverage.instrumented.eventbenchcore}" /> --> 
    115128                <path refid="EventBenchCore.classpath" /> 
    116129                <path refid="JUnit.classpath" /> 
    117130        </path> 
     131        <path id="EventBenchCoreJUnitExecute.classpath"> 
     132                        <pathelement location="${coverage.instrumented.eventbenchcore}" /> 
     133                        <path refid="EventBenchCoreJUnitCompile.classpath" /> 
     134                        <path refid="emma.classpath" /> 
     135                </path> 
    118136 
    119137        <!-- JUnit Test JavaHelperLib Properties --> 
     
    122140        <property name="test.javahelperlib.main-class" value="de.ugoe.cs.util.TestAll" /> 
    123141        <property name="test.javahelperlib.results" value="${test.location.results}/javahelperlib" /> 
    124         <path id="JavaHelperLibTest.classpath"> 
     142        <path id="JavaHelperLibJUnitCompile.classpath"> 
    125143                <pathelement location="${test.location.javahelperlib}" /> 
    126144                <path refid="JavaHelperLib.classpath" /> 
    127145                <path refid="JUnit.classpath" /> 
    128146        </path> 
     147        <path id="JavaHelperLibJUnitExecute.classpath"> 
     148                <pathelement location="${coverage.instrumented.javahelperlib}" /> 
     149                <path refid="JavaHelperLibJUnitCompile.classpath" /> 
     150                <path refid="emma.classpath" /> 
     151        </path> 
     152 
     153 
    129154 
    130155        <!-- Initialization Targets --> 
     
    138163        </target> 
    139164        <target name="init.downloads"> 
    140                 <mkdir dir="${downloads.location}"/> 
     165                <mkdir dir="${downloads.location}" /> 
    141166        </target> 
    142167        <target name="init.javadoc"> 
     
    169194                </copy> 
    170195        </target> 
     196        <target name="init.emma"> 
     197                <mkdir dir="${coverage.instrumented}" /> 
     198                <mkdir dir="${coverage.location}" /> 
     199        </target> 
    171200 
    172201        <!-- Clean-up Targets --> 
     
    185214                <delete dir="${test.location.output}" /> 
    186215        </target> 
    187         <target depends="clean.build,clean.dist,clean.javadoc,clean.junit" name="clean.all" /> 
     216        <target name="clean.emma"> 
     217                <delete dir="${coverage.instrumented}" /> 
     218                <delete dir="${coverage.location}" /> 
     219        </target> 
     220        <target depends="clean.build,clean.dist,clean.javadoc,clean.junit" 
     221                name="clean.all" /> 
    188222 
    189223        <!-- Build Targets --> 
     
    286320                </copy> 
    287321        </target> 
    288          
     322 
    289323 
    290324        <target depends="init.downloads,dist" name="createDownloads"> 
     
    304338 
    305339        <!-- Javadoc Targets --> 
    306         <target depends="init.javadoc" name="javadoc" description="o Create Javadocs (Requires Javadoc 1.4+)"> 
     340        <target depends="init.javadoc" name="javadoc" 
     341                description="o Create Javadocs (Requires Javadoc 1.4+)"> 
    307342                <javadoc destdir="${javadoc.location}" 
    308343                        additionalparam="-J-Dorg.apache.commons.attributes.javadoc.CATaglet.sources=${basedir}"> 
     
    320355 
    321356        <!-- JUnit Targets --> 
    322         <target depends="init.eventbenchcore-test" name="build.eventbenchcore-test"> 
     357        <target depends="init.eventbenchcore-test, emma.instrument.eventbenchcore" 
     358                name="build.eventbenchcore-test"> 
    323359                <javac debug="true" debuglevel="${debuglevel}" destdir="${test.location.eventbenchcore}" 
    324360                        source="${source}" target="${target}" includeantruntime="false"> 
    325361                        <src path="${EventBenchCoreTest.location}/src" /> 
    326                         <classpath refid="EventBenchCoreTest.classpath" /> 
    327                 </javac> 
    328         </target> 
    329         <target depends="init.javahelperlib-test" name="build.javahelperlib-test"> 
     362                        <classpath refid="EventBenchCoreJUnitCompile.classpath" /> 
     363                </javac> 
     364        </target> 
     365        <target depends="init.javahelperlib-test, emma.instrument.javahelperlib" 
     366                name="build.javahelperlib-test"> 
    330367                <javac debug="true" debuglevel="${debuglevel}" destdir="${test.location.javahelperlib}" 
    331368                        source="${source}" target="${target}" includeantruntime="false"> 
    332369                        <src path="${JavaHelperLibTest.location}/src" /> 
    333                         <classpath refid="JavaHelperLibTest.classpath" /> 
    334                 </javac> 
    335         </target> 
    336  
    337         <target depends="build.eventbenchcore,build.eventbenchcore-test" 
     370                        <classpath refid="JavaHelperLibJUnitCompile.classpath" /> 
     371                </javac> 
     372        </target> 
     373 
     374        <target depends="emma.instrument.eventbenchcore,build.eventbenchcore-test" 
    338375                name="junit.eventbenchcore"> 
    339376                <junit fork="on" printsummary="yes" haltonfailure="no"> 
    340                         <classpath refid="EventBenchCoreTest.classpath" /> 
     377                        <classpath refid="EventBenchCoreJUnitExecute.classpath" /> 
    341378                        <test name="${test.eventbenchcore.main-class}" haltonfailure="no" 
    342379                                outfile="${test.eventbenchcore.results}"> 
    343380                                <formatter type="xml" /> 
    344381                        </test> 
     382                        <jvmarg 
     383                                                        value="-Demma.coverage.out.file=${coverage.location}/eventbenchcore.emma" /> 
     384                                                <jvmarg value="-Demma.coverage.out.merge=true" /> 
    345385                </junit> 
    346386        </target> 
    347         <target depends="build.javahelperlib,build.javahelperlib-test" 
     387        <target depends="emma.instrument.javahelperlib,build.javahelperlib-test" 
    348388                name="junit.javahelperlib"> 
    349389                <junit fork="on" printsummary="yes" haltonfailure="no"> 
    350                         <classpath refid="JavaHelperLibTest.classpath" /> 
     390                        <classpath refid="JavaHelperLibJUnitExecute.classpath" /> 
    351391                        <test name="${test.javahelperlib.main-class}" haltonfailure="no" 
    352392                                outfile="${test.javahelperlib.results}"> 
    353393                                <formatter type="xml" /> 
    354394                        </test> 
     395                        <jvmarg 
     396                                value="-Demma.coverage.out.file=${coverage.location}/javahelperlib.emma" /> 
     397                        <jvmarg value="-Demma.coverage.out.merge=true" /> 
    355398                </junit> 
    356399        </target> 
    357          
    358         <target depends="junit.eventbenchcore,junit.javahelperlib" name="junit" /> 
     400 
     401        <target depends="junit.javahelperlib,junit.eventbenchcore" name="junit" /> 
     402 
     403        <!-- Emma Targets --> 
     404        <target depends="build.javahelperlib, init.emma" name="emma.instrument.javahelperlib"> 
     405                <emma enabled="true"> 
     406                        <instr instrpath="${build.location.javahelperlib}" destdir="${coverage.instrumented.javahelperlib}" 
     407                                metadatafile="${coverage.location}/javahelperlib.emma" merge="true" /> 
     408                </emma> 
     409        </target> 
     410        <target depends="build.eventbenchcore, init.emma" name="emma.instrument.eventbenchcore"> 
     411                <emma enabled="true"> 
     412                        <instr instrpath="${build.location.eventbenchcore}" destdir="${coverage.instrumented.eventbenchcore}" 
     413                                metadatafile="${coverage.location}/eventbenchcore.emma" merge="true" /> 
     414                </emma> 
     415        </target> 
     416        <target depends="junit" name="emma.report"> 
     417                <emma enabled="true"> 
     418                        <report sourcepath="${JavaHelperLib.location}"> 
     419                                <fileset dir="${coverage.location}"> 
     420                                        <include name="*.emma" /> 
     421                                </fileset> 
     422                                <xml outfile="${coverage.location}/coverage.xml" depth="method" /> 
     423                        </report> 
     424                </emma> 
     425        </target> 
    359426</project> 
Note: See TracChangeset for help on using the changeset viewer.