|
QuickBuild 2.0 Documentation
|
To add Cobertura
Generate Cobertura ReportQuickBuild will NOT generate Cobertura Cobertura coverage report target in build.xml <target name="instrument" depends="jar"> <delete file="${basedir}/cobertura.ser" /> <delete file="${build.dir}/cobertura.ser" /> <cobertura-taskdef /> <cobertura-instrument datafile="${build.dir}/cobertura.ser" todir="${build.instrumented.dir}"> <fileset dir="${build.classes.dir}"> <include name="**/*.class" /> <exclude name="**/*Test.class" /> <exclude name="net/sourceforge/cobertura/javancss/*.class" /> </fileset> <fileset dir="${build.otherclasses.dir}"> <include name="**/*.class" /> <exclude name="**/*Test.class" /> </fileset> </cobertura-instrument> </target> <target name="coverage-report"> <cobertura-taskdef /> <delete dir="${build.reports.dir}/coverage-xml" /> <mkdir dir="${build.reports.dir}/coverage-xml" /> <cobertura-report datafile="${build.dir}/cobertura.ser" destdir="${build.reports.dir}/coverage-xml" format="xml" > <fileset dir="${src.dir}"> <include name="**/*.java" /> </fileset> <fileset dir="${othersrc.dir}"> <include name="**/*.java" /> </fileset> </cobertura-report> <cobertura-check datafile="${build.dir}/cobertura.ser" totalbranchrate="50" totallinerate="50" /> </target> The code snippet will generate the XML reports for each test case, and the reports will be captured to '${build.reports.dir}/coverage-xml' directory. Publish Cobertura ReportJust like all other build reports, you add Cobertura report by [adding a publish step] in a configuration. When you add publish Cobertura Report step, the following screen will be displayed:
In Source Pattern field, QuickBuild uses Ant style file patterns to collect the reports, and the directory you specified is relative to the [workspace] directory. |
7.6 Adding Cobertura Report
(None)
