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
0 votes
Hi.

First of all - just want to say TypeMock is great, and it is really helping our testing.

We have CCNet running on a 64-bit Windows 2003 server.
Running tmockrunner mbunit.cons.exe works like a charm

Then I wanted to add coverage analysis to the build - I installed NCover, and pressed the "link to profiler" thing for typemock configuration.

When I run NCover.console tmockrunner -link NCover -first MBUnit.Cons,
everything _seems_ to be working, but it turns out that mocking is not enabled. All our tests that use mocking get the "Enable mocking by run mocking_on.bat... message"

We are running the latest version of typemock, i believe it is the 32-bit version, it is installed in c:\program files (x86)

The log from NCover is attached below. One thing that caught my eye was the "

This is the NCover.Settings file:
<?xml version="1.0" encoding="utf-8"?>
<ProfilerSettings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
   <CommandLineArgs>-link NCover -first "C:\Program Files (x86)\MbUnit\MbUnit.Cons.exe" "Mercatus.Common.Modules.OlapViewer.Test.dll" "Mercatus.Common.Test.dll" "Mercatus.Gilde.Common.Test.dll" "Mercatus.Gilde.SlaughterAnalysis.ReportViewer.Test.dll" "Mercatus.Gilde.Communication.Test.exe" "Mercatus.Gilde.SlaughterAnalysis.HarvestPicker.Test.exe" "Mercatus.Gilde.SlaughterAnalysis.ReportTypePicker.Test.exe"  /fc:UnitTest /rt:Html /rf:"C:\FinalBuilder\GildeMainline\WorkingFolder\UnitTestLogs\" /rnf:CoverageMbunitLogUnitTest</CommandLineArgs>
<CommandLineExe>C:\Program Files (x86)\TypeMock\TypeMock.NET\TMockRunner.exe</CommandLineExe>
   <LogFile>C:\FinalBuilder\GildeMainline\WorkingFolder\UnitTestLogs\\UnitTestCoverage.Log</LogFile>
   <CoverageXml>C:\FinalBuilder\GildeMainline\WorkingFolder\UnitTestLogs\\UnitTestCoverage.Xml</CoverageXml>
   <CoverageBinary>Coverage.bcv</CoverageBinary>
   <VerboseLog>false</VerboseLog>
   <ProfileIIS>false</ProfileIIS>
   <DumpOnErrorNormal>false</DumpOnErrorNormal>
   <DumpOnErrorFull>false</DumpOnErrorFull>
   <NoLog>false</NoLog>
   <AutoExclude>true</AutoExclude>
   <Assemblies>Mercatus.Common</Assemblies>
   <Assemblies>Mercatus.Common.Modules.OlapViewer</Assemblies>
   <Assemblies>Mercatus.Common.Modules.OlapViewer.Test</Assemblies>
   <Assemblies>Mercatus.Common.Test</Assemblies>
   <Assemblies>Mercatus.Gilde.Common</Assemblies>
   <Assemblies>Mercatus.Gilde.Common.Test</Assemblies>
   <Assemblies>Mercatus.Gilde.Communication.Common</Assemblies>
   <Assemblies>Mercatus.Gilde.Communication</Assemblies>
   <Assemblies>Mercatus.Gilde.Communication.ServiceRequests</Assemblies>
   <Assemblies>Mercatus.Gilde.ProducerGroup.ProducerFilter</Assemblies>
   <Assemblies>Mercatus.Gilde.ProducerGroup.ProducerPicker</Assemblies>
   <Assemblies>Mercatus.Gilde.SlaughterAnalysis.HarvestPicker</Assemblies>
   <Assemblies>Mercatus.Gilde.SlaughterAnalysis.ReportTypePicker</Assemblies>
   <Assemblies>Mercatus.Gilde.SlaughterAnalysis.ReportViewer</Assemblies>
   <Assemblies>Mercatus.Gilde.SlaughterAnalysis.ReportViewer.Test</Assemblies>
   <Assemblies>Mercatus.Gilde.SlaugtherAnalysis.Common</Assemblies>
</ProfilerSettings>


This is the log from NCover:
EVENT:   Log link established.
EVENT:   Communications link established.
MESSAGE: Ready for command input.
EVENT:   Verbose Logging Disabled
EVENT:   Logging Enabled
EVENT:   AutoExclusion Enabled
MESSAGE: Monitoring Assemblies: Mercatus.Common;Mercatus.Common.Modules.OlapViewer;Mercatus.Common.Modules.OlapViewer.Test;Mercatus.Common.Test;Mercatus.Gilde.Common;Mercatus.Gilde.Common.Test;Mercatus.Gilde.Communication.Common;Mercatus.Gilde.Communication;Mercatus.Gilde.Communication.ServiceRequests;Mercatus.Gilde.ProducerGroup.ProducerFilter;Mercatus.Gilde.ProducerGroup.ProducerPicker;Mercatus.Gilde.SlaughterAnalysis.HarvestPicker;Mercatus.Gilde.SlaughterAnalysis.ReportTypePicker;Mercatus.Gilde.SlaughterAnalysis.ReportViewer;Mercatus.Gilde.SlaughterAnalysis.ReportViewer.Test;Mercatus.Gilde.SlaugtherAnalysis.Common;
MESSAGE: Excluding Types and Methods with these Attributes: (No Exclusions Specified)
MESSAGE: Received driver ready event.
MESSAGE: v1.1.4322
EVENT:   Profiler Initialize
**ERROR(0x80131701)** Failed to get proc address for GetAssemblyIdentityInfoFromFile.
**ERROR(0x80131701)** Failed to get proc address for GetIdentityAuthority.
MESSAGE: Module Load ---- Thread: 0x00000f90; Module ID: 0x79b7a000
**ERROR(0x80131351)** GetModuleInfo failed.
MESSAGE: Module [0x79b7a000] attached To assembly [0x002e3ff0]
MESSAGE: Assembly Load ---- Thread: 0x00000f90; Assembly ID: 0x002e3ff0
EVENT:   Loaded Assembly [mscorlib][0x002e3ff0]
MESSAGE: Assembly Load Complete ---- Assembly ID: 0x002e3ff0
MESSAGE: Module Load ---- Thread: 0x00000f90; Module ID: 0x00306968
**ERROR(0x80131351)** GetModuleInfo failed.
MESSAGE: Module [0x00306968] attached To assembly [0x00306650]
MESSAGE: Assembly Load ---- Thread: 0x00000f90; Assembly ID: 0x00306650
EVENT:   Loaded Assembly [TMockRunner][0x00306650]
MESSAGE: Assembly Load Complete ---- Assembly ID: 0x00306650
MESSAGE: Module Load ---- Thread: 0x00000f90; Module ID: 0x7b2f60a0
**ERROR(0x80131351)** GetModuleInfo failed.
MESSAGE: Module [0x7b2f60a0] attached To assembly [0x003594c8]
MESSAGE: Assembly Load ---- Thread: 0x00000f90; Assembly ID: 0x003594c8
EVENT:   Loaded Assembly [System][0x003594c8]
MESSAGE: Assembly Load Complete ---- Assembly ID: 0x003594c8
MESSAGE: Module Load ---- Thread: 0x00000f90; Module ID: 0x00311568
**ERROR(0x80131351)** GetModuleInfo failed.
MESSAGE: Module [0x00311568] attached To assembly [0x0032a0e8]
MESSAGE: Assembly Load ---- Thread: 0x00000f90; Assembly ID: 0x0032a0e8
EVENT:   Loaded Assembly [Configuration][0x0032a0e8]
MESSAGE: Assembly Load Complete ---- Assembly ID: 0x0032a0e8
MESSAGE: Module Load ---- Thread: 0x00000f90; Module ID: 0x00339bc8
**ERROR(0x80131351)** GetModuleInfo failed.
MESSAGE: Module [0x00339bc8] attached To assembly [0x00339980]
MESSAGE: Assembly Load ---- Thread: 0x00000f90; Assembly ID: 0x00339980
EVENT:   Loaded Assembly [TypeMock][0x00339980]
MESSAGE: Assembly Load Complete ---- Assembly ID: 0x00339980
MESSAGE: Module Load ---- Thread: 0x00000f90; Module ID: 0x7beb8000
**ERROR(0x80131351)** GetModuleInfo failed.
MESSAGE: Module [0x7beb8000] attached To assembly [0x0033c760]
MESSAGE: Assembly Load ---- Thread: 0x00000f90; Assembly ID: 0x0033c760
EVENT:   Loaded Assembly [System.Xml][0x0033c760]
MESSAGE: Assembly Load Complete ---- Assembly ID: 0x0033c760
MESSAGE: Module Load ---- Thread: 0x00000f90; Module ID: 0x00357e10
**ERROR(0x80131351)** GetModuleInfo failed.
MESSAGE: Module [0x00357e10] attached To a
asked by espenalb (640 points)

2 Answers

0 votes
Just wanted to mention that - yes I have noticed that is says
MESSAGE: v1.1.4322
- I tried sending -target 2.0 to TMockrunner, but nothing happened.

I also tried to get TMockRunner to do some logging, but nothing helped. Could this be as simple as TMOckRunner not getting the parameters from NCover?

Any suggestions appreciated...
answered by espenalb (640 points)
0 votes
Hi,
Thanks for the heads up. TypeMock is great.

To run Coverage with NCover, you need to link TypeMock with NCover first and then run Ncover. See Running Coverage
In your case do:
tmockrunner -link NCover -first NCover.console MBUnit.Cons

Notice that tmockrunner is executed first
answered by scott (32k points)
...