NCover with NUnit
NCover with NUnit
We are evaluating NCover and having some difficulties in making it work on two separate projects. Problem #1: WebServices project compiled into a dll in .NET1.1. Unit tests in a separate assembly, also .NET1.1. Run NCoverExplorer 2.1.0.0 with the following settings:
Path to app: C:\Program Files\NUnit 2.4.7\bin\nunit-console.exe Workign folder: C:\Projects\Kreus2\source\kreusnet\bin App args: UnitTests.Tests.dll
Everything else is default. This produces an empty Coverage.xml. (containing this: <?xml version="1.0" encoding="utf-8"?>
<!-- saved from url=(0022)http://www.ncover.com/ -->)
I checked to make sure we're generating pdb file... Also, same results with the -console version. Also, nunit runs units tests correctly when run as standalone and generates correct output when run as parameter to the ncover-console app.
Problem #2: .NET 2.0 library that's used in another project with a separate unit tests dll, similar to the problem listed above. Running NCover explorer with exact same parameters, except, of course, pointing to the new dlls. This time, actually get results -- 100% coverage -- i.e. NUnit exercised all code in the UnitTests DLL. This is of course, not what we want. We want to see what code was exercised in the DLL that the UnitTests ran against.
I'm sure we're doing something wrong in both cases. Please help.
RE: NCover with NUnit
ivoloshin,
For both cases, what is the complete command line that NCE runs NCover with? You can access that line by looking at the "Command Line" section under "Generate" in the Run NCover settings window.
Also, examining NCover's log file for lines like "Failed to load symbols for module" would tell you for sure whether NCover is finding PDBs for your assemblies.
Stephen
RE: NCover with NUnit
actually, we aren't using NCE, we are using a custom cruisecontrol.net task we created in c# to run ncover and nunit. The command line equivalent of what we are running is:
ncover.console "c:\program files\nunit 2.4.7\bin\nunit-console.exe" UnitTests.Tests.dll
We've tried using the above command line and it gives the same results.
The logger does have quite a few messages that say "failed to load symbols for module" even though the pdb files are there. it looks as though ncover is looking for the assemblies in the GAC. i've tried changing setting the working directory with the //w switch, but it's still looking in the GAC for the assemblies?? how can i get it to look in the working folder first?
RE: NCover with NUnit
pmiller,
NCover checks the path it loaded the dll from for the PDBs. Try unregistering the dlls you want tested from the GAC and see if you get coverage. If that fails, set _NT_SYMBOL_PATH to the directory with the PDBs (make sure the PDBs are from the same build that the assemblies in the GAC are from). If that fails, we'll work from there.
Stephen