{"id":17976,"date":"2018-01-10T12:11:40","date_gmt":"2018-01-10T20:11:40","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/vcblog\/?p=17976"},"modified":"2019-02-18T17:48:06","modified_gmt":"2019-02-18T17:48:06","slug":"cmake-support-in-visual-studio-test-explorer-integration-cmake-3-10","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/cppblog\/cmake-support-in-visual-studio-test-explorer-integration-cmake-3-10\/","title":{"rendered":"CMake Support in Visual Studio \u2013 Test Explorer Integration, CMake 3.10"},"content":{"rendered":"<p><a href=\"https:\/\/blogs.msdn.microsoft.com\/c\/2018\/01\/16\/visual-studio\u5f00\u59cb\u652f\u6301cmake-\u96c6\u6210\u4e86\u6d4b\u8bd5\u6d4f\u89c8\u5668\uff0ccmake-3-10\/\">\u70b9\u8fd9\u91cc\u770b\u4e2d\u6587\u7248<\/a> <\/p>\n<p>We are excited to announce new CMake features in <a href=\"https:\/\/www.visualstudio.com\/vs\/preview\/\">Visual Studio 2017 version 15.6 Preview 2<\/a>.\u00a0 In the latest preview, we have improved CTest\u2019s integration with the IDE, including rich support for the Google and Boost unit testing frameworks.<\/p>\n<p><em>If you are new to CMake in Visual Studio, check out <\/em><a href=\"https:\/\/aka.ms\/cmake\"><em>how to get started<\/em><\/a><em>.<\/em><\/p>\n<h3>CTest in the Test Explorer with Google Test and Boost.Test Support<\/h3>\n<p>One of the more frequent pieces of feedback we have received since adding basic support for CTest has been Test Explorer integration.\u00a0 I am excited to announce that CTest is fully integrated into the IDE in the latest Visual Studio preview:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/9\/2019\/02\/Test-Exploer-CTest.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/9\/2019\/02\/Test-Exploer-CTest.png\" alt=\"CTest Integration in Test Explorer\" class=\"size-full wp-image-17985 aligncenter\" width=\"943\" height=\"658\" \/><\/a><\/p>\n<p>Normally, each individual CTest in your CMake project will have an entry in the Test Explorer.\u00a0 If you take a close look at the screenshot above, however, you may notice that tests are broken out even further.\u00a0 If your project leverages the Google Test or Boost.Test frameworks in conjunction with CTest, individual tests will be listed in the Test Explorer.<\/p>\n<p>Rich support for Google Test and Boost.Test requires the corresponding test adapters to be installed.\u00a0 The Google and Boost Test Adapters are now included by Visual Studio and will be installed by default with the C++ workload.\u00a0 However, you may need to install them manually if you are upgrading an existing installation of Visual Studio.\u00a0 For more information, check out how to install the Test Adapters for <a href=\"http:\/\/aka.ms\/googletestgoesinbox\">Google Test<\/a> and <a href=\"http:\/\/aka.ms\/boosttestgoesinbox\">Boost.Test<\/a>.\u00a0 Test Explorer integration for CTest is still available without these adapters but it is limited in granularity to individual CTests.<\/p>\n<p>All of Visual Studio\u2019s testing features now work with CTest.\u00a0 In addition to viewing and running CTests from the Test Explorer, you can debug them and calculate their code coverage.\u00a0 If you use the Google Test or Boost.Test unit testing frameworks, you will also get detailed information about failed tests including stack traces:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/9\/2019\/02\/Failed-Test.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/9\/2019\/02\/Failed-Test.png\" alt=\"Test Explorer CTest Details\" class=\"size-full wp-image-17995 aligncenter\" width=\"345\" height=\"658\" \/><\/a><\/p>\n<p>If your tests seem to be missing from the Test Explorer, make sure you have built the targets that contain them.\u00a0 Your tests should be automatically detected once the build is complete.<\/p>\n<h3>CMake Tools Upgraded to 3.10<\/h3>\n<p>In our effort to make sure you have access to the latest features of CMake, we have upgraded the version of CMake that ships with Visual Studio from 3.9 to 3.10.\u00a0 You can find the full lists of enhancements in the <a href=\"https:\/\/cmake.org\/cmake\/help\/v3.10\/release\/3.10.html\">CMake 3.10 release notes<\/a>.<\/p>\n<h3>Send Us Feedback<\/h3>\n<p>Your feedback is a critical part of ensuring that we can deliver the best CMake experience.\u00a0 We would love to know how <a href=\"https:\/\/www.visualstudio.com\/vs\/preview\/\">Visual Studio 2017 Preview<\/a> is working for you.\u00a0 If you have any feedback specific to CMake Tools, please reach out to <a href=\"mailto:cmake@microsoft.com\">cmake@microsoft.com<\/a>.\u00a0 For general issues please <a href=\"https:\/\/docs.microsoft.com\/en-us\/visualstudio\/ide\/how-to-report-a-problem-with-visual-studio-2017\">Report a Problem<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u70b9\u8fd9\u91cc\u770b\u4e2d\u6587\u7248 We are excited to announce new CMake features in Visual Studio 2017 version 15.6 Preview 2.\u00a0 In the latest preview, we have improved CTest\u2019s integration with the IDE, including rich support for the Google and Boost unit testing frameworks. If you are new to CMake in Visual Studio, check out how to get started. [&hellip;]<\/p>\n","protected":false},"author":326,"featured_media":35994,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[266],"tags":[8,140,252,233,6,268],"class_list":["post-17976","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cmake","tag-announcement","tag-c","tag-cmake","tag-cross-platform","tag-ide","tag-openfolder"],"acf":[],"blog_post_summary":"<p>\u70b9\u8fd9\u91cc\u770b\u4e2d\u6587\u7248 We are excited to announce new CMake features in Visual Studio 2017 version 15.6 Preview 2.\u00a0 In the latest preview, we have improved CTest\u2019s integration with the IDE, including rich support for the Google and Boost unit testing frameworks. If you are new to CMake in Visual Studio, check out how to get started. [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts\/17976","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/users\/326"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/comments?post=17976"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts\/17976\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/media\/35994"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/media?parent=17976"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/categories?post=17976"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/tags?post=17976"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}