Ask Learn
Preview
Ask Learn is an AI assistant that can answer questions, clarify concepts, and define terms using trusted Microsoft documentation.
Please sign in to use Ask Learn.
Sign inThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
[原文发表地址] CMake Support in Visual Studio – Test Explorer Integration, CMake 3.10
[原文发表时间] 2018/01/10
我们很高兴在Visual Studio 2017 15.6 Preview 2 版本 中更新了一些新的CMake功能。在最新的预览版本中,我们改进了CTest功能与IDE的集成,包括对Google和Boost单元测试框架的各种支持。
如果你刚开始在Visual Studio中使用CMake,请查看如何开始。
自从支持了CTest的基本功能之后,我们收到的更频繁相关反馈就是Test Explorer集成。 我很高兴地宣布CTest已经完全集成到最新的Visual Studio预览版的IDE中:
通常,CMake项目中的每个CTest都将在Test Explorer中有一个条目。但是,如果仔细观察上面的截图,你可能会注意到测试更加突出。如果你的项目将Google Test或Boost.Test框架与CTest结合使用,则单个测试将在测试浏览器中列出。
对Google Test和Boost.Test的各种支持需要安装相应的测试适配器。 Google和Boost测试适配器现在包含在Visual Studio中,只要安装了C ++工作负载就会默认安装。但是,如果要升级Visual Studio的现有安装,则可能需要手动安装它们。关注更多信息,请查看如何为Google Test和Boost.Test安装测试适配器。 CTest的测试浏览器集成在没有这些适配器的情况下仍然可用,但是对个别CTest可能有限。
所有Visual Studio的测试功能现在都可以与CTest一起使用。除了可以从测试浏览器窗口查看和运行CTest之外,你还可以调试它们并计算代码覆盖率。如果你使用Google Test或Boost.Test单元测试框架,你还将获得有关失败测试(包括堆栈跟踪)的详细信息:
如果你的测试似乎从测试资源管理器中丢失,请确保你已经构建了包含它们的目标。 构建完成后就会自动检测你的测试。
为了确保你能够使用CMake的最新功能,我们已经将Visual Studio兼容的CMake版本从3.9升级到了3.10。 你可以在CMake 3.10发行说明中找到完整的增强列表。
你的反馈是确保我们不断改善CMake体验的关键部分。 我们很想知道Visual Studio 2017 Preview如何为你工作。 如果你有任何针对CMake Tools的反馈,请联系cmake@microsoft.com。 对于一般问题,请报告问题。
Ask Learn is an AI assistant that can answer questions, clarify concepts, and define terms using trusted Microsoft documentation.
Please sign in to use Ask Learn.
Sign in