Using NCover/NCoverExplorer from MsBuildFebruary 1, 2008
On popular demand, here is a sample from my MsBuild file:
<UsingTask TaskName="NCoverExplorer.MSBuildTasks.NCover" AssemblyFile="NCoverExplorer.MSBuildTasks.dll"/> <UsingTask TaskName="NCoverExplorer.MSBuildTasks.NCoverExplorer" AssemblyFile="NCoverExplorer.MSBuildTasks.dll"/> <Exec Command="regsvr32 /s $(tools_dir)\NCover\CoverLib.dll"/> <NCover Assemblies="@(CodeCoverage_Assemblies)" CommandLineArgs="@(UnitTest_Assemblies, ' ')" CommandLineExe="$(tools_dir)\NUnit\nunit-console.exe" CoverageFile="$(CodeCoverageResultsXmlFile)" LogLevel="Quiet" ToolPath="$(tools_dir)\NCover\"/> <NCoverExplorer CoverageFiles="$(CodeCoverageResultsXmlFile)" FailMinimum="false" HtmlReportName="CodeCoverage.html" OutputDir="$(ProjectPath)" ProjectName="$(ApplicationName)" ReportType="ModuleClassSummary" SatisfactoryCoverage="60" ToolPath="$(ToolsDir)\NCoverExplorer\"/> <Exec Command="regsvr32 /u /s $(toolsdir)\NCover\CoverLib.dll"/>
Still a lot of XML, but it works. The regsvr32 command before and after the NCover/NCoverExplorer task is to make sure that NCover is working correctly. This because I've put the NCover/NCoverExplorer binaries in my Subversion repository. The CoverLib.dll file must be registered.
If you're interested in an in-person or online course that teaches you and your team how to write maintainable unit tests and get the most out of TDD practices, make sure to have a look at our trainings and workshops or contact us at firstname.lastname@example.org.
Jan Van Ryswyck
Thank you for visiting my blog. I’m a professional software developer since Y2K. A blogger since Y2K+5. Provider of training and coaching in XP practices. Curator of the Awesome Talks list. Past organizer of the European Virtual ALT.NET meetings. Thinking and learning about all kinds of technologies since forever.
Writing MaintainableWatch Now
- Behavior-Driven Development
- Concurrent Programming
- Continuous Integration
- Core Skills
- Design Patterns
- Domain-Driven Design
- Event Sourcing
- Fluent Interfaces
- Functional Programming
- Object-Relational Mapping
- Open Source
- Software Design
- Test-Driven Development
- Visual Studio
The opinions expressed on this blog are my own personal opinions. These do NOT represent anyone else’s view on the world in any way whatsoever.
Thank you for visiting my website. I’m a professional software developer since Y2K. A blogger since Y2K+5. Provider of training and coaching in XP practices. Curator of the Awesome Talks list. Past organizer of the European Virtual ALT.NET meetings. Thinking and learning about all kinds of technologies since forever.