vstest 未获取 googletest 可执行文件中的单元测试

unit tests in googletest executable not picked up by vstest

我有一个(本机 C++)可执行文件 (test_descriptions.exe),其中包含一些 googletests (1.7)。只需 运行ning 可执行文件就可以正常工作,并且很好地通过了测试。现在我想 运行 这些测试在 TFS 中自动进行,使用 vstest.

不幸的是,在我的可执行文件上应用 vstest 会出现以下错误:

C:\project>"C:\Program Files BLABLA \vstest.console.exe" test_descriptions.exe /platform:x64

Warning: Using Isolation mode to run tests as required by effective Platform:X64 and .Net Framework:Framework45 settings for test run. Use the /inIsolation parameter to suppress this warning.
Warning: No test is available in test_descriptions.exe. Make sure that installed test discoverers & executors, platform & framework version settings are appropriate and try again.

有什么想法吗?是否有更好的方法 运行 在 TFS 中进行这些测试(我考虑过只构建 RUN_TESTS 项目并让 cmake 的 ctest 完成工作)

编辑:我也尝试添加 /UseVsixEntensions:true,结果相同。

结果是缺少对 Google 测试适配器的引用。 /UseVxisEntensions:true 已弃用,现在应该使用 \TestAdapterPath: 来设置 Google 测试适配器 DLL 的位置