emma
程序员文章站
2022-05-11 12:28:03
...
<taskdef resource="emma_ant.properties" /> <property name="emma.enabled" value="true" /> <property name="out.instr.dir" value="./outinstr" /> <target name="emma" description="turns on EMMA's instrumentation/reporting"> </target> <target name="instrEmma"> <delete dir="${out.instr.dir}" /> <mkdir dir="${out.instr.dir}" /> <delete file="metadata.emma" /> <emma enabled="${emma.enabled}"> <instr instrpath="${classes.dir}" destdir="${out.instr.dir}" metadatafile="metadata.emma" merge="true" /> </emma> <copy todir="${classes.dir}" overwrite="true"> <fileset dir="${out.instr.dir}" casesensitive="yes"> </fileset> </copy> </target> <target name="getLogEmma"> <!-- <delete file="mycoverage.ec" /> --> <emma> <ctl connect="IP:47653" > <command name="coverage.get" args="mycoverage.ec" /> <!-- <command>coverage.reset</command> alternate command syntax --> </ctl> </emma> </target> <target name="genReportEmma" depends="getLogEmma"> <delete file="coverage.xml" /> <delete dir="coverage" /> <!-- --> <emma> <report sourcepath="${src.dir}" > <fileset dir="./" > <include name="*.emma" /> <include name="*.ec" /> </fileset> <xml outfile="coverage.xml" /> <html outfile="coverage.html" /> </report> </emma> </target>