Question

The build I am currently working on uses Visual Studio 2008 (Professional) in a 32bit environment to compile. We have been using Google Test Framework to create unit test. We are trying to use OpenCover to report code coverage, and it returns

"no results - no assemblies that matched the supplied filter were instrumented. this could be due to missing PDBs for the assemblies that match the filter. please review the output file and refer to the Usage guide (Usage.rtf)"

The Test executable did run as I saw the result displayed on the console. The PDB is at the same directory as the Google Test Executable. The command that I have used:

OpenCover.Console.exe -target:<Full Path Unit Test Executable> -targetdir:<Directory of the exeutable which also includes the PDB> -output:cover.xml

Note: The directory and exeutable do not contains space, so I have omitted quotation, but I have tried using it or without, and the result is the same

Things I have tried:

  • I have explicitly registered the OpenCover.Profile.dll
  • I have used -register:user argument
  • I have tried to use -targetargs:"/noshadow" (and the noisolation), which I believe these are specific to MSTest and NUnit, but not for GoogleTest
  • I have tried omitting the targetdir parameter
  • I have installed the VS 2010 redistribution

All of them yield the same result. I am able to run the sample that comes with the installation.

Has anyone successfully integrate Google Testing Framework with OpenCover? Or is there specific compilation setup on the project? (I have turned on/off profiling, and it didn't make a difference)

Thanks!

Était-ce utile?

La solution

OpenCover is for getting coverage of code that compiles to IL (.NET) whereas GoogleTest is for testing native (x86) code.

Since you are using GoogleTest then I can only assume that your code is native and this would explain why you are getting no coverage.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top