2009-05-19 5 views
2

Ich habe ein Problem mit Ant und Emma ein Code-Coverage-Plugin, es macht Bericht, aber ohne Quellcode.Emma nicht Quellcode in HTML-Bericht einbetten

Ich habe folgenden Code in meinem build.xml

init emma

<taskdef resource="emma_ant.properties" /> 
    <path id="run.classpath"> 
     <pathelement location="${instr}" /> 
     <path refid="build.classpath"/> 
     <pathelement path="${ant.home}/lib/junit-4.5.jar"/> 
     <pathelement path="${ant.home}/lib/emma.jar"/> 
    </path> 

machen instr

<target name="instr" depends="compile"> 
     <emma> 
      <instr instrpathref="build.classpath" 
       destdir="${instr}" 
       metadatafile="${coverage}/metadata.emma" 
       merge="true" 
      /> 
     </emma> 
    </target> 

festigende Eigenschaften

<jvmarg value="-Demma.coverage.out.file=${coverage}/coverage.emma" /> 
    <jvmarg value="-Demma.coverage.out.merge=true" /> 

Bericht machen

<emma> 
     <report sourcepath="${src}" > 
      <fileset dir="${coverage}" > 
       <include name="*.emma" /> 
      </fileset> 

      <html outfile="${coverage}/coverage.html"/>    
     </report>  
    </emma> 

Das funktioniert gut. Es gibt an der Konsole aus:

[report] processing input files ... 
[report] 2 file(s) read and merged in 10 ms 
[report] not all instrumented classes were compiled with source file 
[report] debug data: no sources will be embedded in the report. 
[report] line coverage requested in a report of type [html] but 
[report] not all instrumented classes were compiled with line number 
[report] debug data: this column will be removed from the report. 
[report] showing up to 3 classes without full debug info per package: 
[report] ... 
[report] writing [html] report to [C:\...] ... 

Ich möchte meinen Quellcode im Bericht sehen, wie kann ich es beheben? Ich habe Dokumentation von Emma studiert und leider gibt es nichts, was mit diesem Problem zu tun hat.

Vielen Dank für die Antworten.

Antwort

5

Ok, ich habe ein Problem gelöst.

Ich habe debug="true" zu javac hinzugefügt und es funktioniert jetzt.

+0

+1 für die Lösung Ihres eigenen Problems. Ich wollte das gerade vorschlagen. – Mark