<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Python on rndthts.dev</title>
    <link>https://rndthts.dev/tags/python/</link>
    <description>Recent content in Python on rndthts.dev</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-us</language>
    <lastBuildDate>Sun, 03 Oct 2021 20:37:24 +0200</lastBuildDate><atom:link href="https://rndthts.dev/tags/python/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Google Test - Missing Feature</title>
      <link>https://rndthts.dev/posts/google-test-missing-feature/</link>
      <pubDate>Sun, 03 Oct 2021 20:37:24 +0200</pubDate>
      
      <guid>https://rndthts.dev/posts/google-test-missing-feature/</guid>
      <description>&lt;p&gt;&lt;strong&gt;Test-Driven Development&lt;/strong&gt;. &lt;strong&gt;Red-Green-Refactor&lt;/strong&gt;.
Let&amp;rsquo;s start. You are working on an awesome project in C++ and for TDD you are using the Google testing framework.&lt;/p&gt;
&lt;p&gt;A typical scenario when using TDD:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The new behavior is introduced and described by a falling test. &lt;strong&gt;We have RED&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Logic is implemented, the test is PASSING. &lt;strong&gt;We have GREEN&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;The last step, &lt;strong&gt;REFACTOR&lt;/strong&gt; test and implementation if possible.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;After that, we run all the tests and we notice that &lt;strong&gt;we have 17 falling tests&lt;/strong&gt;.&lt;br&gt;
What about re-running only failing tests? &lt;br&gt;
What about re-running the first and last failing tests?&lt;/p&gt;
&lt;p&gt;This is something that kept popping up to me.
Google Test does not support anything like this, so I decided to write my solution. &lt;a href=&#34;https://github.com/elvisoric/gtester&#34;&gt;Github link&lt;/a&gt;&lt;/p&gt;
&lt;h2 id=&#34;what-is-it&#34;&gt;What is it?&lt;/h2&gt;
&lt;p&gt;Wrapper around Google tests&lt;/p&gt;
&lt;h2 id=&#34;what-it-solves&#34;&gt;What it solves?&lt;/h2&gt;
&lt;p&gt;It allows you to re-run failed tests as well as to filter those failed tests by using numeric tags&lt;/p&gt;
&lt;h3 id=&#34;how-to-use-it&#34;&gt;How to use it?&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Set which executable file will be executed:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;./gtester.py --exe exe_name
&lt;/code&gt;&lt;/pre&gt;&lt;ul&gt;
&lt;li&gt;Run all tests:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;./gtester.py
&lt;/code&gt;&lt;/pre&gt;&lt;ul&gt;
&lt;li&gt;Run just failing tests:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;./gtester.py --run_failing
&lt;/code&gt;&lt;/pre&gt;&lt;ul&gt;
&lt;li&gt;Run several failing tests using tags:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;./gtester.py --run_failing 1 3
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;example&#34;&gt;Example&lt;/h2&gt;
&lt;p&gt;&lt;img src=&#34;https://rndthts.dev/images/gtester_demo.gif&#34; alt=&#34;Demo&#34;&gt;&lt;/p&gt;
</description>
    </item>
    
  </channel>
</rss>

