Click here to Skip to main content
15,888,610 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

Can anybody tell me how can i use Code coverage report generated by OpenCover in cruise control .net dashboard, so user can view build bye coverage report.

Thanks in advance
Posted

1 solution

In your Nant build file add the following:
XML
<property name="current.dir" value="${directory::get-current-directory()}" />
<property name="CCARTIFACTSDIR" value="${current.dir}/CC_BUILD_DIR" />
	<if test="${environment::variable-exists('CC_BUILD_ARTIFACTS')}">
		<property name="CCARTIFACTSDIR" value="${environment::get-variable('CC_BUILD_ARTIFACTS')}" />
	</if>
<property name="opencover.report.dir" value="${CCARTIFACTSDIR}/coverage" />
	<property name="opencover.report.file" value="${opencover.report.dir}/TestCoverage.xml" />



In the target for coverage report, add the following argument to output the report in CCARTIFACTS directory :

XML
<target name="testCoverage">
    <exec program="${opencover.dir}/OpenCover.Console.exe" failonerror="true" verbose="true">
        <arg line="-output:"${opencover.report.file}"" />
    </exec>
</target>


Hit me back if you have more questions.

I would also suggest to use ReportGenerator to get a Visual Report of the Code Coverage and get exact lines which are not covered.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900