2009-05-19 38 views
2

AntとEmmaのコードカバレッジプラグインに問題がありますが、ソースコードは報告されません。Emmaはhtmlレポートにソースコードを埋め込みません

私は私のbuild.xml

のinitエマ

<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> 

作るINSTR内のコードを次しまった

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

設定のプロパティレポートを作る

<jvmarg value="-Demma.coverage.out.file=${coverage}/coverage.emma" /> 
    <jvmarg value="-Demma.coverage.out.merge=true" /> 
<emma> 
     <report sourcepath="${src}" > 
      <fileset dir="${coverage}" > 
       <include name="*.emma" /> 
      </fileset> 

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

これはうまくいきます。コンソールに出力します:

[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:\...] ... 

私のソースコードをレポートで見たいのですが、どうすれば修正できますか?私はemmaのドキュメントを勉強しましたが、残念ながらこの問題に関連するものはありません。

ありがとうございました。

答えて

5

私は問題を解決しました。

javacにdebug="true"を追加しました。

+0

+1あなた自身の問題を解決してください。私はちょうどそれを提案しようとしていた。 – Mark

関連する問題