Posted on 2007-05-22 04:10
切尔斯基 阅读(1063)
评论(0) 编辑 收藏
<target name="emma.reporting">
<emma enabled="true">
<report sort="+name" metrics="method:80,block:90,line:80,class:100">
<fileset dir="your/emma/dir">
<include name="*.emma" />
</fileset>
<html outfile="your/emma/dir/coverage.html" />
</report>
</emma>
</target>
<target name="emma.check">
<loadfile property="emma.output" srcFile="your/emma/dir/coverage.html" />
<fail message="Your code coverage is too low.">
<condition>
<contains string="${emma.output}" substring='class="h"' casesensitive="false" />
</condition>
</fail>
</target>