Problem using NCover with MSTest

Problem using NCover with MSTest

I must warn you I'm a novice with NCover and MSTest.

My tool configuration is: NCover.Console.exe v2.1.2 and VS2008 SP1.

I have not been able to run an MSTest suite from within NCover when the MSTest command line uses the /testmetadata and /testlist switches, e.g.

mstest /testmetadata:foo.vsmdi /testlist:OrderedTests /resultsfile:C:\foo.trx

However, MStest runs successfully runs as a standalone command.

I have a single MSTest unit test assembly that requires "ordered tests" defined in a test list. Hence the reason for using the above mentioned MSTest command line switches so I can invoke an ordered test.

When I run the Nant script that invokes NCover, MSTest aborts claiming it cannot find the test assembly.

If I use an alternate MSTest command that uses the /testcontainer switch, the test runs under NCover, but fails because the tests are not executed in the correct order, e.g.

mstest /testcontainer:foo.dll /resultsfile:C:\foo.trx

Ah ha... I have found that for NCover to successfully run the MSTest command with /testmetadata and /testlists switches, the assemblies need (??) to be in a location relative to the Visual Studio project location, i.e. .\bin\Debug.

However, this folder arrangement is not consistent with our overall development structure, i.e. all solution assemblies are stored in a single top level bin\Debug folder.

I guess a hack could be to store assemblies in the top level bin folder and use the Nant script to copy them to the appropriate location to get NCover and MSTest to work.

Any other ideas are welcome?????


RE: Problem using NCover with MSTest

John,

If MSTest is in the path, this should not be an issue. Are you using MSBuild to spawn MSTest, or are you calling mstest directly?

There is no reason for the test assemblies to be near the vs.net folder.

Do you have an nant script you can send to support?

Joe Feser