views:

126

answers:

1

Summary: I can run unit tests and code-coverage, but the report only includes NUnit classes, not my application classes.

I have successfully used PartCover in the past. Not so this time. I tried the latest PartCover (4.0), downgraded to the next latest (2.0), both with NUnit 2.5.6.

I created a simple .NET 4.0 class library (also tried this with a web application that has a project that's a class library) with a single class in some namespace, and two test methods in another library in another class.

NUnit/PartCover installed correctly; I can run the NUnit tests both in NUnit, and through PartCover (I can see them running and saying "2 passed"), but the report only shows me NUnit namespaces. (Yes, I'm using +[] as my coverage rule.)

Any ideas? As much as I like NUnit, I'd like to see coverage for my own classes :o)

And I also tried aligning the test-DLL and code-DLL namespaces, to no avail.

Edit: I tried re-running my previously working code-covered sample from a year ago; all the tests run, but the actual project namespaces don't appear. There's a hint here, which seems to imply that it depends on the NUnit version you use: http://sourceforge.net/projects/partcover/forums/forum/605222/topic/3308367 (and yes, I already tried the appdomain-reporting checkbox)

I've tried NUnit 2.5.5.x and 2.5.6.x and both give me the same results.

Edit: It seems this fork of the official 4.0 version seems to work, albeit sporadically (google for PartCover fork, I can't add more hyperlinks)

+1  A: 

Madness. Apparently, pressing Pause/Break on your keyboard after NUnit prints out the summary of total passed/failed, and waiting approximately one second for the second "CoreProfiler is turned off" message, makes it all work.

Surely, this cannot be the real solution. Sure, I can rig up a batch file that'll sleep ~1 second after executing NUnit, but this seems like a major hack.

ashes999
I can pause but can't resume
Louis Rhys
Works for me :/ try this batch file instead (uses ping as a slow pause). Just tell PartCover to use this batch file instead of nunit-console.exe.nunit-console.exe %1 %2 %3 %4 %5 %6 %7 %8 %9REM sleep!!ping 127.0.0.1 -n 3 > nul
ashes999