NCover fails to do anything when using NUnit

NCover fails to do anything when using NUnit

I wanted to get coverage on 6 tests in an assembly that has a lot of tests in it. I started NCover half an hour ago and it seems to be not doing anything. The output:

NCover Complete v3.4.12.6869 x86 (Administrator) Copyright (c) 2007 - 2010 Gnoso Inc. License Key: xxxxxxxxxxxx Registered to Customer #: xxxx for 1 Machine

Adding the '/noshadow' argument to the NUnit command line to ensure NCover can gather coverage data. To prevent this behavior, use the //literal argument. Setting the //pm argument to 'nunit-agent.exe;nunit-agent-x86.exe;nunit-console.exe;nunit-console-x86.exe' in an attempt to gather coverage data. To prevent this behavior, use the //literal argument, or the LiteralMode="True" task property.

Command: D:\Build\CM\Tools\NUnit\2.5.9\bin\net-2.0\nunit-console.exe Command Args: D:\Build\Dev\UnitTests\bin\CompanyA.UnitTests.Registration.dll "/noshadow" Working Directory: D:\Build\CM\Tools\NUnit\2.5.9\bin\net-2.0 Assemblies: (All Loaded Assemblies) Included Types: .RegistrationCheckerTests.;.RegistrationChecker.

Program Output NUnit version 2.5.9.10348 Copyright (C) 2002-2009 Charlie Poole. Copyright (C) 2002-2004 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov. Copyright (C) 2000-2002 Philip Craig. All Rights Reserved.

Runtime Environment - OS Version: Microsoft Windows NT 6.1.7600.0 CLR Version: 2.0.50727.4971 ( Net 2.0 )

ProcessModel: Default DomainUsage: Single Execution Runtime: Default

That's about it. What should I do next to figure out what is wrong here?


RE: NCover fails to do anything when using NUnit

Hi jcollum,

If you never saw any command line output like this:

NCover Complete v3.4.18.6937 x64 Copyright (c) 2007 - 2010 Gnoso Inc. License Key: FCDN6B6DCAEDXUT3 Registered to Customer #: 59421 for 1 Machine

Adding the '/noshadow' argument to the NUnit command line to ensure NCover can gather coverage data. To prevent this behavior, use the //literal argument. Setting the //pm argument to 'nunit-agent.exe;nunit-agent-x86.exe;nunit-console.exe;nunit-console-x86.exe' in an attempt to gather coverage data. To prevent this behavior, use the //literal argument, or the LiteralMode="True" task property.

Command: C:\dev\NUnit 2.5.9\bin\net-2.0\nunit-console.exe Command Args: "C:\Users\Russell\Documents\Visual Studio 2010\Projects\Calc\Debug\CalcTest.dll" "/noshadow" Working Directory: C:\dev\NUnit 2.5.9\bin\net-2.0 Excluded Assemblies: CalcTest Excluded Methods: ..TestAddition;..Addition;..get_.

Program Output Process 'nunit-console' [PID 6880] has begun profiling. NUnit version 2.5.9.10348 Copyright (C) 2002-2009 Charlie Poole. Copyright (C) 2002-2004 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov. Copyright (C) 2000-2002 Philip Craig. All Rights Reserved.

Runtime Environment - OS Version: Microsoft Windows NT 6.1.7601 Service Pack 1 CLR Version: 2.0.50727.5456 ( Net 2.0 )

ProcessModel: Default DomainUsage: Single Execution Runtime: Default Process 'nunit-agent' [PID 6456] has begun profiling. ...F. Tests run: 4, Errors: 0, Failures: 1, Inconclusive: 0, Time: 0.1420082 seconds Not run: 0, Invalid: 0, Ignored: 0, Skipped: 0

Errors and Failures: 1) Test Failure : CalcTest.CalcTest.TestMultiplication Expected: 8m But was: 9m

at CalcTest.CalcTest.TestMultiplication() in C:\Users\Russell\Documents\Visual Studio 2010\Projects\Calc\CalcTest\CalcTest.cs:line 30

Process 'nunit-console' [PID 6880] has finished profiling. Process 'nunit-agent' [PID 6456] has finished profiling.

End Program Output

Execution Time: 4.3753 s Symbol Coverage: 80.00% Branch Coverage: 75.00%

Coverage File: C:\Users\Russell\Desktop\Miscellany\coverage_test_v2.nccov Trend File: C:\Users\Russell\Desktop\Miscellany\coverage_test_v2.xml Coverage Log: C:\Users\Russell\Desktop\Coverage\coverage_test_v2.log

Then please verify that NUnit runs these tests correctly, and then try running only one test.

Thanks!

NCover Support