<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="https://www.w3.org/2005/Atom" xmlns:sy="https://purl.org/rss/1.0/modules/syndication/" xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:wfw="https://wellformedweb.org/CommentAPI/" xmlns:slash="https://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>taxiahou</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/taxiahou/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/taxiahou/feed.xml</link>
    <description />
    <lastBuildDate>Wed, 17 Apr 2019 03:51:57 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>the usage of running a subset of tests in google test framework:--gtest_filter</title>
      <link>https://docs.microsoft.com/archive/blogs/taxiahou/the-usage-of-running-a-subset-of-tests-in-google-test-framework-gtest_filter</link>
      <pubDate>Tue, 30 Jul 2013 01:55:42 GMT</pubDate>
      <dc:creator><![CDATA[Tang Xiahou]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/taxiahou/2013/07/30/the-usage-of-running-a-subset-of-tests-in-google-test-framework-gtest_filter/</guid>
      <description><![CDATA[Google provides an easy-to-use open source alternative for developing unit tests in C++ on multiple...]]></description>
      <content:encoded><![CDATA[<p>Google provides an easy-to-use open source alternative for developing unit tests in C++ on multiple platforms, such as Linux, windows, max etc. Here I only want to introduce the simple usage to run specific tests. Google test enables this by providing --gtest_filter=&lt;test string&gt; option. In the google testing framework, the test is specified by test case name and test name. Below is an example using this framework.</p>
<p>#include "gtest/gtest.h"&nbsp; //header file</p>
<p>TEST(IsPrimerTest, PositiveNumber)&nbsp; //TEST(test_case_name, test_name)</p>
<p>{</p>
<p>&nbsp;&nbsp;&nbsp; EXPECT_EQ(1, IsPrimer(5));</p>
<p>}</p>
<p>To run tests, whose test_case name or test_name&nbsp;contains string "str", execute&nbsp; <strong>main.exe --gtest_filter=*str*</strong></p>
<p>To run tests, whose test_case_name contains string "str", execute <strong>main.exe --gtest_filter=*str*.*</strong></p>
<p>To run tests, whose test_name contains string "str" or "str2", execute <strong>main.exe --gtest_filter=*.*str*:*.*str2*</strong></p>
<p>To run tests, whose test_name doesn't contain string "str", execute <strong>main.exe --gtest_filter=*.*-*str*</strong></p>
<p>To run tests, whose test_case_name or test_name doesn't contain either "str" or "str2", execute <strong>main.exe --gtest_filter=-*str*:*str2*</strong></p>
<p>================================================================================================</p>
<p>*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; match any string</p>
<p>?&nbsp;&nbsp;&nbsp;&nbsp; match any single character</p>
<p>:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;separated list of patterns, if followed by '-', negative patterns, otherwise positive patterns.</p>
<p>-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exclude. e.g. -a means excluding a</p>]]></content:encoded>
    </item>
  </channel>
</rss>