3

I was wondering if someone has some ideas about how to integrate typemock and partcover.

We have unit tests which use typemock in our c# sharepoint based application and we would like to run them via partcover and be able to see the coverage details.

I have been able to run the typemock tests via partcover, however, partcover is not able to display the coveraged details for the code that was tested?

The way I have gotten the tests to run via partcover is to make Partcover run the Typemock runner which in turn runs MSTest.

My partcover browser settings are as follows:

ExecutableFile: *Path to typemock*\TMockRunner.exe

Working Directory: *A folder that already exists*

Working Arguments: *Path to MSTest*\MSTest.exe /noisolation /testcontainer:*Path to DLL*

Any ideas would be great especially on how partcover retrieves coverage details.

Thanks.

Andrew
  • 53
  • 1
  • 1
  • 9
  • The reason for this is that both PartCover and TypeMock use the profiler APIs and only one active profiler can be enabled for a process. The only way I can see to have two profilers running is to have one act as a proxy for the other and pass/handle the relevant calls - but this would be a complex task as the profilers would overlap how they try to instrument the build. As PartCover is Open Source then the TypeMock team has all the information needed to handle this integration step. – Shaun Wilde Jun 26 '11 at 21:17

3 Answers3

1

For anyone that is interested, partcover is currently not supported by Typemock. Hovever, it looks like Part cover will be supported in future releases of Typemock.

http://www.typemock.com/community/viewtopic.php?t=762

Andrew
  • 53
  • 1
  • 1
  • 9
1

You can try this link: Typemock and Code coverage tools . I haven't had any luck with the PartCover gui so I will try the command line.

update: I got the GUI working.

  1. step 1. enable typemock with partcover via linking them. do this through typemock configuration
  2. step 2. under 'run target settings' in Partcover Browser, exe file should be test runner, in my case, the path to mstest.exe
  3. step 3. working dir is most likely where your test .dll lives w/ it's dependencies, let's say c:\myproject\unittests\bin\Debug
  4. step 4. working args : these are for mstest , /testcontainer:foo.test.dll
  5. step 5. put at least 1 rule in: +[MyNamespace.MyAssemblyName]* , the rules section

after that runs, you can see your code coverage, and typemock test loader will automatically load, if you linked it correctly. don't forget in partcover browser to go to

  • 'Views->View coverage details' to see the source code.
RyBolt
  • 1,764
  • 3
  • 22
  • 34
0

The last version of Typemock Isolator (5.4.5)supports Partcover.

Ohad Horesh
  • 4,340
  • 6
  • 28
  • 45