Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/visual-studio-2008/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Visual studio 2008 OpenCover和GoogleTest-投诉PDB缺失_Visual Studio 2008_Code Coverage_Googletest_Opencover - Fatal编程技术网

Visual studio 2008 OpenCover和GoogleTest-投诉PDB缺失

Visual studio 2008 OpenCover和GoogleTest-投诉PDB缺失,visual-studio-2008,code-coverage,googletest,opencover,Visual Studio 2008,Code Coverage,Googletest,Opencover,我目前正在进行的构建使用32位环境中的VisualStudio2008(Professional)进行编译。我们一直在使用Google测试框架来创建单元测试。我们正在尝试使用OpenCover报告代码覆盖率,它返回 "no results - no assemblies that matched the supplied filter were instrumented. this could be due to missing PDBs for the assemblies that matc

我目前正在进行的构建使用32位环境中的VisualStudio2008(Professional)进行编译。我们一直在使用Google测试框架来创建单元测试。我们正在尝试使用OpenCover报告代码覆盖率,它返回

"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)"
当我看到控制台上显示的结果时,测试可执行文件确实运行了。PDB与Google测试可执行文件位于同一目录中。我使用的命令:

OpenCover.Console.exe -target:<Full Path Unit Test Executable> -targetdir:<Directory of the exeutable which also includes the PDB> -output:cover.xml
OpenCover.Console.exe-target:-targetdir:-output:cover.xml
注意:目录和exeutable不包含空格,所以我省略了引号,但我尝试过使用它或不使用它,结果是一样的

我尝试过的事情:

  • 我已经明确注册了OpenCover.Profile.dll
  • 我使用了-register:user参数
  • 我曾尝试使用-targetargs:“/noshadow”(和noiseolation),我相信这是MSTest和NUnit特有的,但不是GoogleTest特有的
  • 我已尝试忽略targetdir参数
  • 我已经安装了VS2010重新分发版
它们都产生相同的结果。我能够运行安装附带的示例

有人成功地将Google测试框架与OpenCover集成在一起了吗?或者项目上是否有特定的编译设置?(我已经打开/关闭了评测功能,但这并没有产生任何影响)

谢谢

用于获取编译为IL(.NET)的代码的覆盖率,而用于测试本机(x86)代码

因为您使用的是GoogleTest,所以我只能假设您的代码是本机代码,这可以解释为什么您没有得到覆盖