{"id":17065,"date":"2017-10-24T10:22:13","date_gmt":"2017-10-24T17:22:13","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/vcblog\/?p=17065"},"modified":"2019-02-18T17:48:15","modified_gmt":"2019-02-18T17:48:15","slug":"unit-testing-test-adapter-for-google-test-goes-in-box","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/cppblog\/unit-testing-test-adapter-for-google-test-goes-in-box\/","title":{"rendered":"Unit Testing: Test Adapter for Google Test goes in-box!"},"content":{"rendered":"<p><i><span>If you&#8217;re just getting started <\/span><\/i><i><span>and want to learn more about C++ Unit Testing, check out our <\/span><\/i><a href=\"https:\/\/blogs.msdn.microsoft.com\/vcblog\/2017\/04\/19\/cpp-testing-in-visual-studio\/\"><span><i>tutorial<\/i><\/span><\/a><span>.<\/span><span>\u00a0<\/span><\/p>\n<p><span>Here on the Visual C++ team, we want to make your unit testing experience as enjoyable as possible. <\/span><span>Microsoft&#8217;s<\/span><span> <\/span><span>n<\/span><span>ative <\/span><span>unit t<\/span><span>est framework <\/span><span>has shipped with Visual Studio for a while, but we know <\/span><span>C++<\/span><span> <\/span><span>developers<\/span><span> <\/span><span>may wish to use other popular testing frameworks.<\/span><span> To give you more flexibility, we <\/span><span>offered<\/span><span> <\/span><span>two VS <\/span><span>extensions<\/span><span> in the VS Marketplace<\/span><span> <\/span><span>w<\/span><span>hich enabled Visual Studio&#8217;s testing tools to work with <\/span><span>Google Test <\/span><span>and<\/span><span> <\/span><span>Boost.Test<\/span><span> <\/span><span>unit tests<\/span><span> (<\/span><a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=VisualCPPTeam.TestAdapterforGoogleTest#overview\"><span>Test Adapter for Google Test<\/span><\/a><span><\/span><span>, <\/span><a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=VisualCPPTeam.TestAdapterforBoostTest\"><span>Test Adapter for Boost.Test<\/span><\/a><span>)<\/span><span>.<\/span><\/p>\n<p><span>W<\/span><span>e are<\/span><span> excited to announce that we have streamlined this process even<\/span><span> further. <\/span><span>In addition to Native Test, <\/span><span>Visual Studio now <\/span><b><span>ships <\/span><\/b><b><span>with Google Test<\/span><\/b><b><span> <\/span><\/b><b><span>support.<\/span><\/b><span> This means you can author, discover, and run <\/span><span>all of<\/span><span> your <\/span><span>Google Test unit <\/span><span>tests using Visual Studio&#8217;<\/span><span>s testing tools <\/span><span>right out of the box.<\/span><span> <\/span><span>New installations of<\/span><span> Visual Studio<\/span><span> 2017<\/span><span> <\/span><span>version <\/span><span>15.5<\/span><span> will already have the &#8220;Test Adapter for Google Test&#8221; checkbox marked <\/span><span>and installed by default.<\/span><\/p>\n<p><span>If<\/span><span> you&#8217;<\/span><span>re<\/span><span> upgrading from an existing Visual Studio installation, <\/span><span>or you unchecked the box during initial installation<\/span><span>,<\/span><span> <\/span><span>n<\/span><span>o worries! Open &#8220;Visual Studio Installer&#8221;, click &#8220;Modify&#8221; on your Visual Studio 15.5 instance<\/span><span>,<\/span><span> and <\/span><span>check the &#8220;Test Adapter for Google Test&#8221;\u009d checkbox under &#8220;Desktop development with C++&#8221;<\/span><span> <\/span><span>(shown below).<\/span><\/p>\n<p><strong>Note<\/strong>: If you previously installed our &#8220;Test Adapter for Google Test&#8221; extension from the VS Marketplace, you should uninstall it to avoid conflicts.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/9\/2019\/02\/tafgtSelect.png\"><img decoding=\"async\" width=\"879\" height=\"352\" class=\"alignnone size-large wp-image-17105\" alt=\"\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/9\/2019\/02\/tafgtSelect-1024x410.png\" \/><\/a><\/p>\n<p><span>Now comes the magic. <\/span><span>Build your Google Test project, and Visual Studio will automatically detect your unit tests and populate the Test Explorer Window. <\/span><span>Don&#8217;t see the Test Explorer Window?<\/span><span> Add it by going to <\/span><i><span>Test<\/span><\/i><i><span> &gt;<\/span><\/i><i><span> <\/span><\/i><i><span>Windows<\/span><\/i><i><span> &gt; <\/span><\/i><i><span>Test Explorer<\/span><\/i><span>.<\/span><span> <\/span><span>For more details on using Google Test and <\/span><span>Boost.Test<\/span><span> in Visual Studio, check out <\/span><span>our<\/span><span> <\/span><a href=\"https:\/\/blogs.msdn.microsoft.com\/vcblog\/2017\/08\/04\/c-unit-testing-updates-announcing-boost-test-adapter-and-improved-google-test-support\/\"><span>previous blog post<\/span><\/a><span>.<\/span><\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/9\/2019\/02\/gtest.png\"><img decoding=\"async\" width=\"670\" height=\"254\" class=\"alignnone size-full wp-image-17115\" alt=\"\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/9\/2019\/02\/gtest.png\" \/><\/a><\/p>\n<p><span>\u00a0<\/span><span>Glorious!<\/span><span>\u00a0<\/span><\/p>\n<h3><span>What&#8217;s next?<\/span><span>\u00a0<\/span><\/h3>\n<p><span>We are working to add<\/span><span> <\/span><span>Boost.Test<\/span><span> in-<\/span><span>box<\/span><span>. <\/span><span>In the meantime, feel free to keep using the <\/span><a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=VisualCPPTeam.TestAdapterforBoostTest\"><span>Test Adapter for Boost.Test extension<\/span><\/a><span>.<\/span><span>\u00a0<\/span><\/p>\n<h3><span>Talk to us<\/span><\/h3>\n<p><span>We are always working to give you the best development experiences possible. Let us know what you would like to see next<\/span><span>.<\/span><span> <\/span><span>I<\/span><span>f you come across any issues, please <\/span><span>file them<\/span><span> <\/span><span>on the <\/span><span>Test Adapter for Google Test <\/span><a href=\"https:\/\/github.com\/Microsoft\/TestAdapterForGoogleTest\"><span>GitHub<\/span><\/a><span>.<\/span><span> Because of your <\/span><span>previous <\/span><span>feedback, <\/span><span>we improved our <\/span><a href=\"https:\/\/blogs.msdn.microsoft.com\/vcblog\/2017\/05\/10\/unit-testing-and-the-future-announcing-the-test-adapter-for-google-test\/\"><span>Google Test project template<\/span><\/a><span> in the <\/span><span>New Project wizard by adding <\/span><span>support for all Windows SDK<\/span><span>s<\/span><span>.<\/span><span>\u00a0<\/span><\/p>\n<p><span>Cheers<\/span><span>,<\/span><span>\u00a0<\/span><\/p>\n<p><span>-Nick<\/span><span>\u00a0<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you&#8217;re just getting started and want to learn more about C++ Unit Testing, check out our tutorial.\u00a0 Here on the Visual C++ team, we want to make your unit testing experience as enjoyable as possible. Microsoft&#8217;s native unit test framework has shipped with Visual Studio for a while, but we know C++ developers may [&hellip;]<\/p>\n","protected":false},"author":329,"featured_media":35994,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-17065","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cplusplus"],"acf":[],"blog_post_summary":"<p>If you&#8217;re just getting started and want to learn more about C++ Unit Testing, check out our tutorial.\u00a0 Here on the Visual C++ team, we want to make your unit testing experience as enjoyable as possible. Microsoft&#8217;s native unit test framework has shipped with Visual Studio for a while, but we know C++ developers may [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts\/17065","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\/329"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/comments?post=17065"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts\/17065\/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=17065"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/categories?post=17065"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/tags?post=17065"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}