Using NCover with FitNesse

Using NCover with FitNesse

I'm new to NCover. I'm using the trial version (3.3.2). I'm getting a "No data collected" error.

FitNesse is a java application. It spins off a "Test Runner". In this case, that process is FitServer.exe, which is used to execute .NET test code.

I am using the //pm argument. My command line looks like this:

ncover.console //pm FitServer.exe //reg java -cp c:\fitnesse\fitnesse.jar fitnesse.runner.TestRunner -v localhost 8080 MyTest

I do see the FitNesse output (i.e. my test runs). But then NCover tells me there is an exception.

I am running on a 32-bit machine. I do have administrator privileges.

What could I be doing wrong?

Here is the error:

Exception

---- Top level exception: System.Exception No data was collected. at NCover.Framework.ProfilerDriver._GetCoverageData() at NCover.Framework.ProfilerDriver.ExecuteNCover(Int32& profiledAppCode) at NCover.Framework.ProfilerDriver.Execute(Int32& profiledAppCode)

at NCover.ConsoleMain.ConsoleMain.RunCoverage(String[] args, IOutputWriter output)

NCover.Console is returning exit code #20000


RE: Using NCover with FitNesse

Try running NCover on your FitNesse server rather than on the test runner client. FitServer.exe gets started up by the server, not the client, so NCover has to be attached to the server to collect coverage data from the tests.

Once your test execution finishes, you'll need to press Ctrl-C to close the FitNesse server so that NCover can collect the coverage data.


RE: Using NCover with FitNesse

We run the Fit page (test page) through Fitnesse Wiki page....how to attach the Ncover to the FitServer using both Ncover console and explorer ??


RE: Using NCover with FitNesse

Running With Console

Start the server with NCover:

NCover.Console //pm FitServer.exe java -jar fitnesse.jar -p 8090

and then run tests through the wiki or with the command line test runner, and close the server when your tests are finished with Ctrl-C to save the coverage file.

Running With NCover Explorer

Inside of the project options panel in NCover Explorer you'll want to set the following:

Application To Profile: Path to application to profile: [path to java.exe] Application Arguments: -jar [/path/to/]fitnesse.jar -p 8090

Advanced Options: Profiled Process Name: FitServer.exe

Those settings will get NCover running with the server, so then you'll want to click through the wiki and hit the stop button in NCover Explorer once your tests have finished.