PartCover Integration in CruiseControl
Montag, den 22. Dezember 2008Some time ago we were moving from ncover to partcover because ncover is now a commercial product and also we had a lot of problems on our cruise control server. Here are the scripts and also transformations that I made to make the partcover report look like the ncover report. This is presented without much explanation. Contact me if you have any questions.
NAnt Buildscript
<property name="partcover.exe" value="C:/Program Files/Gubka Bob/PartCover .NET 2/PartCover.exe" /> <target name="coverage" description="compute coverage statistics for all unit tests defined in project.nunit" depends="create-nunit"> <property name="date" value="${datetime::now()}" /> <property name="acceptable" value="75" /> <mkdir dir="${results.dir}" unless="${directory::exists(results.dir)}" /> <exec program="${partcover.exe}" failonerror="true"> <arg value="--target=${nunit.exe}" /> <arg value="--target-work-dir=${project.dir}" /> <arg value="--target-args=project.nunit /exclude:${unit_test_exclusions}" /> <arg value="--include=[Project.*]*" /> <arg value="--exclude=[*Test*]*" /> <arg value="--exclude=[*Other]*" /> <arg value="--output=${results.dir}/project.coverage.xml" /> </exec> <style style="..\path\PartCover-NCover-Like.report.xslt" in="${results.dir}/project.coverage.xml" out="${results.dir}/coverage-report.html"> <parameters> <parameter name="DateTime" namespaceuri="" value="${date}" /> <parameter name="ProjectName" namespaceuri="" value="${project.name}" /> <parameter name="Acceptable" namespaceuri="" value="${acceptable}" /> </parameters> </style> <!-- This generates the extension data which is needed for cruise control, the attribute "in" is just used for validation reason --> <style style="..\path\PartCover-Extension.xslt" in="${results.dir}/project.coverage.xml" out="${results.dir}/project.coverage.ext.xml"> <parameters> <parameter name="DateTime" namespaceuri="" value="${date}" /> <parameter name="ProjectName" namespaceuri="" value="${project.name}" /> <parameter name="Acceptable" namespaceuri="" value="${acceptable}" /> </parameters> </style> </target>
Download

