SharpDevelop Community

Get your problems solved!
Welcome to SharpDevelop Community Sign in | Join | Help
in Search

Code coverage/Unit testing on 64bit XP

Last post 03-26-2008 5:22 PM by Situssoft. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 03-22-2008 10:24 AM

    Code coverage/Unit testing on 64bit XP

    Just a note in case anyone is having trouble with the above.

    The shipping version of SD3.0 (which I have to say is superb!) contains NUnit and PartCover to provide unit testing and code coverage. There is a smal problem using these on a 64bit platform.

    PartCover.exe is a .NET app and as such will default to running as a 64bit process. The COM server PartCover.CorDriver.dll is a 32bit native dll registered with COM. As such it registers in the WOW64 registry on a 64bit OS. This results in the following error when attempting to use code coverage from SD3.0 on a 64bit platofrm.

    Retrieving the COM class factory for component with CLSID {6F6225EA-0897-41FA-B1EF-8B4D3E15325E} failed due to the following error: 80040154. 
    at PartCover.Framework.Connector..ctor() 
    at PartCover.ApplicationEntry.Main(String[ args) 

    The work around solution is to mark the partcover.exe as 32bit which will cause it to run as a 32bit process on all platforms. Thus on a 64bit platform partcover.exe will run under WOW64 and the COM registration will be available to it. 
     
    This is achieved using the following commands 
     
    corflags partcover.exe /32BIT+ /Force 
    sn -R partcover.exe PartCover.Console.snk 
     
    The snk file is available in the source for partcover.exe. 
     
    For those wishing to get unit testing with code coverage you will need to do the same corflags trick on nunit-console.exe. This file is not signed so you don't need /Force and you won't need to resign.

  • 03-22-2008 12:31 PM In reply to

    Re: Code coverage/Unit testing on 64bit XP

    I'll change nunit-console so it's platform target is x86 (32 bit). I'll see if we can get the author of PartCover to do the same.
  • 03-22-2008 1:08 PM In reply to

    Re: Code coverage/Unit testing on 64bit XP

    FYI: I've also been in touch with the PartCover source forge project on this matter, see forums on the project.

  • 03-22-2008 1:12 PM In reply to

    Re: Code coverage/Unit testing on 64bit XP

    What is the possibility of changing the Nunit plugin so it will use 32bit for coverage but allow the user to choose between 32 and 64 bit for running tests. It would be nice to be able to run unit tests under 64 bit processes (which is somthing that VS2008 doesn't support). This would require two nunit executables one for 32 and one for 64.

  • 03-25-2008 12:19 PM In reply to

    Re: Code coverage/Unit testing on 64bit XP

    NUnit ships with two versions of NUnit, one built with /platform:anycpu and one built with /platform:x86. Unfortunately I don't have access to XP 64 to try anything out. Also doing this does not fix the problem with PartCover.
  • 03-26-2008 5:22 PM In reply to

    Re: Code coverage/Unit testing on 64bit XP

    Agreed that won't fix part cover, I was really suggesting the ability to choose which NUnit from the plugin so that one could perform unit testing in 32 bit with or without coverage to get a good set of tests and then also run those tests in 64bit without coverage to be sure that 64 bit works OK aswell.

     Its a pet subject of mine because almost all my dev systems are 64 bit and MSTest shipped with VS2008 pro doesn't support 64 bit testing.

     I'm being lazy really as I can do this manually with nunit.

Page 1 of 1 (6 items)
Powered by Community Server (Commercial Edition), by Telligent Systems
Don't contact us via this (fleischfalle@alphasierrapapa.com) email address.