Including Uncovered Assemblies
Including Uncovered Assemblies
I have a scripted build, where NCover is one part of the build. NCover is run over XUnit, and this works without a hitch. (An XUnit project file is built on the fly based on same naming conventions, etc).
I'm now expanding the effort, so that assemblies with no test coverage / test assemblies are showing up properly in the report, and I'm running into a couple of issues.
IncludeAssemblies doesn't seem to be working properly. When the solution is built, I create a list of built assemblies, then further massage this into a list of regular expressions per the documentation on IncludeAssemblies. I would expect NCover to analyze these assemblies even though xunit never tested against them.
I do get acknowledgement:
NCover Complete v3.4.16.6924 x64 Copyright (c) 2007 - 2010 Gnoso Inc. License Key: REDACTED Registered to Customer #: XXXXX for 1 Machine
Command: C:\Source\LegacyHub.Client.Master\LegacyHub.Client..\tools\xUnit.NET-1.7\xunit.console.clr4.exe
Command Args: C:\Source\LegacyHub.Client.Master\LegacyHub.Client\BuildArtifacts\TestResults\tests.xunit
Working Directory: C:\Source\LegacyHub.Client.Master\LegacyHub.Client\BuildArtifacts\Bin
Included Assemblies: EPS\.Hub\.Integration\.Client;EPS\.Hub\.Integration\.SampleApp
Excluded Assemblies: .Tests\.Integration;.Tests\.Unit;FakeItEasy;xunit;AutoMapper
Excluded Attributes: CoverageExcludeAttribute;System.CodeDom.Compiler.GeneratedCodeAttribute
But I still don't get the 0 coverage reported on the two assemblies that I'm expecting.
I have set the working directory to the location of the built assemblies and I've removed the file extensions per the documentation.
Am I missing something obvious here? (Note that the formatting of the post is getting eaten by your editor -- I tried to properly fix all instances of \. as they appear in the output, but may have missed one)
Thanks
RE: Including Uncovered Assemblies
I thought I remembered seeing something about this:
http://www.ncover.com/blog/ncover-the-modules-that-time-forgot/
It seems that IncludedAssemblies is only meant to act as a filter against the set of loaded assemblies.
While that certainly has it's uses, I'd like to see something integrated with NCover out of the box, so that I can just supply an assembly list or similar and run with it.
To be honest, I'm not a fan of the solution proposed in the blog. Certainly NCover could find a way to generate coverage stats on assemblies in the list that never get loaded?
Any chance this will make it into v4?
Thanks!
RE: Including Uncovered Assemblies
Iristyle,
Thanks for your comments. You're right that having a simple selector for a list of assemblies would be a great feature. We're working on that for NCover 4. At the same time, it should be remembered that if your tests don't touch those other assemblies, you'll always see 0% coverage. Only code that gets exercised gets a coverage number higher than 0. That's the definition of coverage: exercised code.
Thanks again for the great feedback. We're working hard to make sure NCover 4 will knock everyone out of their chairs!
RE: Including Uncovered Assemblies
It would be great to see this feature implemented