views:

682

answers:

2

I'm using partcover to produce codecoverage for a bunch of mstest powered unit tests.

I use the command line:

PartCover.exe --target "c:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\MSTest.exe" --target-args "/testcontainer:c:\CrusieControlProjects\AcademyPro\AcademyTests\bin\Release\AcademyTests.dll" --include [AcademyPro*]*

This runs, all tests pass, but I end up with the output:

Results file:      C:\Program Files\Gubka Bob\PartCover .NET 2.3\TestResults\Administrator_PSLV22 2009-03-31 17_54_18.trx
Run Configuration: Default Run Configuration
Target PageFaultCount: 10565
Target PagefileUsage: 27631616
Target PeakPagefileUsage: 31297536
Target PeakWorkingSetSize: 31498240
Target QuotaNonPagedPoolUsage: 8180
Target QuotaPagedPoolUsage: 217124
Target QuotaPeakNonPagedPoolUsage: 13012
Target QuotaPeakPagedPoolUsage: 255524
Target WorkingSetSize: 30310400
request target shutdown
<PartCoverReport date="2009-03-31T18:00:36.7676250+01:00" />

When I run with the --output command the xml file ends up with just

<PartCoverReport date="2009-03-31T18:00:36.7676250+01:00" />

Why might this be happening?

+4  A: 

To fix this I ended up downgrading.

I was using version 2.3 (which is a dev build) and switched to version 2.2.

Now the tests run fine and I get sensible coverage data.

Maybe that will help someone.

ilivewithian
+2  A: 

I was having a similar problem with NUnit on x64. The problem was that I was using nunit-console.exe (AnyCPU). Switching to nunit-console-x86.exe (explicitly 32-bit) solved the problem.

I don't have access to an environment with MSTest, but if the executable you're referencing is AnyCPU, you might look for an explicitly 32-bit version of it on your system. Worst case, you could create one using CorFlags.

nullptr
Same issue when running on 64 bit. Changed to nunit-console-x86.exe solved this issue.
tronda