0

I'm currently doing Xamarin development on an OS X machine and looking into code coverage tools.

I've had some success with tools like OpenCover but they rely on PDB files being generated for the code being tested.

It seems that Xamarin Studio on Windows produces PDB files but on OS X it produces MDB files.

So my questions would be:

  • Can tools like OpenCover be made to work with MDB files?
  • Can Xamarin Studio or xbuild be made to produce PDB files on OS X?
  • Are there any tools to convert MDB files to PDB files?

EDIT:

Just to explain a bit more about our set-up, OpenCover only runs on Windows so we run that part of out CI pipeline on a Windows slave, but we would like to feed it the output of builds built on the OS X master rather than having to build on the slave as well, this is where the problem with MDB rather than PDB from OS X builds becomes a problem.

user3617723
  • 1,355
  • 3
  • 17
  • 37
  • 1
    Out of luck in regards to mono/mdb support within OpenCover @ https://github.com/OpenCover/opencover/issues/228 FYI: There is a mdb to gdb tool (`pdb2mdb`) provided with Mono, but it does not go the other way... On Windows you are getting the `.pdb`s since it is using the `csc` compiler vs Mono's `mcs`. Long term, Xamarin is switching to using rosyln and thus `.pdb`s will be produced, does not help you right now, but... – SushiHangover Feb 08 '16 at 14:13
  • you have to check the link above. – Lex Li Feb 08 '16 at 23:53
  • @SushiHangover Roslyn compiler generates portable PDB on non Windows platforms, so OpenCover needs to support the new format too. – Lex Li Feb 08 '16 at 23:54
  • @LexLi Thanks for the info, I 'thought' Cecil's PDB handled the portable format already... but it does not... https://github.com/jbevain/cecil/issues/252 ... – SushiHangover Feb 09 '16 at 07:30
  • OpenCover can consume mdb files instead of pdb files but can only do so on the windows platform (see https://github.com/sawilde/opencover/commit/aafe230af62042b5b2d77a8793afb355e27d13f5); it uses mono.cecil to consume them. – Shaun Wilde Feb 10 '16 at 07:44
  • @ShaunWilde Good spot, I'm using 4.6 so the MDB support should be in there, I am using OpenCover on Windows I'm just providing it files built on OS X, do you have any experience of how the MDB support works? – user3617723 Feb 11 '16 at 08:56
  • @user3617723 in my limited experiments (I don't have a Mac so I use a pdb2mdb to make them) when OpenCover loads a DLL it looks for the pdb first and then looks for the mdb. Of course if the pdb/mdb is not supported by mono.cecil then unfortunately it won't work. – Shaun Wilde Feb 11 '16 at 21:19

1 Answers1

0

I can confirm that the latest version of OpenCover (4.6) supports MDB files, you just need to run the tests on a Windows machine.

user3617723
  • 1,355
  • 3
  • 17
  • 37