Rerun a failed test case again

1,421 views
Skip to first unread message

Kaustubh Pandey

unread,
Jan 3, 2017, 3:36:16 PM1/3/17
to Google C++ Testing Framework
Hi , 
In Primer Documentation ,  it is mentioned 
"When a test fails, Google C++ Testing Framework allows you to run it in isolation for quick debugging."

Have a doubt regarding this.

Scenario goes on like : 
I have a Test  which contain 10 Test Cases.
Now , out of these 10 only 8 passed. 
I want to run those 2 failed test cases again.
    Running those test cases can be done at the same time after it failed ( Best option for my requirement) {In this case the execution of remaining test cases must go on}
    Running those test cases at the end of Test (Good option) 

Please help me on how to  achieve this. 

This needs to be done so as to ensure that it is a consistent failure or just a hit-miss case.

Thanks 
Kaustubh


Samuel Benzaquen

unread,
Jan 3, 2017, 3:48:41 PM1/3/17
to Kaustubh Pandey, Google C++ Testing Framework
On Mon, Jan 2, 2017 at 6:06 AM, Kaustubh Pandey <kausi....@gmail.com> wrote:
Hi , 
In Primer Documentation ,  it is mentioned 
"When a test fails, Google C++ Testing Framework allows you to run it in isolation for quick debugging."

Have a doubt regarding this.

Scenario goes on like : 
I have a Test  which contain 10 Test Cases.
Now , out of these 10 only 8 passed. 
I want to run those 2 failed test cases again.
    Running those test cases can be done at the same time after it failed ( Best option for my requirement) {In this case the execution of remaining test cases must go on}
    Running those test cases at the end of Test (Good option) 

You can run specific tests by using the --gtest_filter flag.
 

Please help me on how to  achieve this. 

This needs to be done so as to ensure that it is a consistent failure or just a hit-miss case.

Thanks 
Kaustubh


--

---
You received this message because you are subscribed to the Google Groups "Google C++ Testing Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to googletestframework+unsub...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

George Georgiev

unread,
Jan 4, 2017, 3:52:59 AM1/4/17
to Samuel Benzaquen, Kaustubh Pandey, Google C++ Testing Framework
I implemented something like this 2 years ago for my previous company. I fuzzy on some details, but what I did have was a listener that was tracking all the failed test, then I was calling the runner with first setting the filter to only those tests. There are several issues with this like overriding the output file if set to only the second run, so I was setting the second run to not output and similar. It worked overall, though. 

Thanks,
George

Kaustubh Pandey

unread,
Jan 4, 2017, 7:51:48 AM1/4/17
to George Georgiev, Samuel Benzaquen, Google C++ Testing Framework
Thanks . Working on your mentioned way .I thought  that framework is offering something of that kind. 

Thanks 
Kaustubh 
Reply all
Reply to author
Forward
0 new messages