chevron-thin-right chevron-thin-left brand cancel-circle search youtube-icon google-plus-icon linkedin-icon facebook-icon twitter-icon toolbox download check linkedin phone twitter-old google-plus facebook profile-male chat calendar profile-male
Welcome to Typemock Community! Here you can ask and receive answers from other community members. If you liked or disliked an answer or thread: react with an up- or downvote.
0 votes
I'm trying to use TypeMock together with NCover

When I run simple NAnt script that starts typemock and runs ncover (from typemock documentation), the tests (including those dependent on TypeMock) are executed successfully , but then I get

[ncover] ***************** Exception *****************
[ncover]
[ncover] -- Top-level exception (System.Exception)
[ncover] No data was collected.
[ncover] -- Stack Trace
[ncover] at NCover.Framework.ProfilerDriver._GetCoverageData()
[ncover] at NCover.Framework.ProfilerDriver.Execute()
[ncover] at NCover.ConsoleMain.ConsoleMain.Main(String[] args)
[ncover]

BUILD FAILED

c:TeamCityTools ant-0.86-beta1in est1.build(43,6):
External Program Failed: C:Program FilesNCover\NCover.Console.exe (return code was 20000)


What am I doing wrong?


NAnt script:

<?xml version="1.0"?>
<project name="prj" default="test">
<property name="nunit" value="c:Program FilesNUnit 2.4.7in unit-console.exe" />
<property name="ncover.dir" value="C:Program FilesNCover" />
<property name="typemock.dir" value="c:Program FilesTypemockIsolator.2" />

<target name="test">
<loadtasks assembly="${typemock.dir}TypeMock.NAntBuild.dll" />
<loadtasks assembly="${ncover.dir}Build Task PluginsNCoverExplorer.NAntTasks.dll" />
<typemockstart target="2.0" link="NCover2.0" profilerlaunchedfirst="true" />
<ncover program="${ncover.dir}NCover.Console.exe"
commandLineExe="${nunit}"
commandLineArgs="My.tests.dll"
registerProfiler="false"/>
<typemockstop />
</target>
</project >
asked by knst (2.9k points)

7 Answers

0 votes
Hi,

I need a bit more info:

1. Are you running on 32 or 64 bit machine.
2. When you run without linking to NCover, is everything ok?
3. Try running with TMockRunner (the command tool we provide, see the documentation), instead of the NAnt tasks. Do you see a difference?

Thanks,
answered by gilz (14.5k points)
0 votes
1. I'm using 32bit version
2. Without ncover it works fine. Without typemock ncover works but typemock dependent tests fail
3. With TMockRunner ncover fails in the same way
used cmd line:
TMockRunner.exe -first -link NCover2.0 NCover.Console.exe nunit-console.exe My.tests.dll
answered by knst (2.9k points)
0 votes
Hi,

Another quick question to help us locate the problem - what OS are you running on?

I am trying to recreate this issue locally using your build script. Any bit of information will help.

Thanks,
Doron
Support Group
answered by doron (17.2k points)
0 votes
OS: w2k3 32bit
TypeMock: 5.2.1
NCover: 2.1.2
answered by knst (2.9k points)
0 votes
Any ideas?
answered by knst (2.9k points)
0 votes
Hi

Currently we are investigating few issues that are related to NCover and Isolator integration including your case.
We'll get back to you as soon as we'll find something.
answered by ohad (35.4k points)
0 votes
Thanks.
answered by knst (2.9k points)
...