stop the execution at first test that fail

9,558 views
Skip to first unread message

George Georgiev

unread,
Mar 13, 2013, 1:02:34 PM3/13/13
to googletes...@googlegroups.com
Hi,

I would like to be able to run my tests in a mode where the first failing tests makes the execution to stop. Is there a command line flag that does this? If not, could somebody advice how such feature could be implemented.

Thanks,
George

Zhanyong Wan (λx.x x)

unread,
Mar 13, 2013, 1:09:58 PM3/13/13
to George Georgiev, Google C++ Testing Framework


--
 
---
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 googletestframe...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Zhanyong

Zhanyong Wan (λx.x x)

unread,
Mar 13, 2013, 1:48:38 PM3/13/13
to George Georgiev, Google C++ Testing Framework
If you are not running the tests under a debugger, --gtest_break_on_failure will kill the test program on the first failure.


On Wed, Mar 13, 2013 at 10:35 AM, George Georgiev <george.ge...@gmail.com> wrote:
Thank you Wan, but this is not what I need. I am not running the tests under debugger.

I need the runner of the tests to exit as soon as it rich a test that fails. I know that it is a feature that it does not and I agree it is very useful in a general use case. But as every generalization there are a small number of outlier cases where it is not true.

Thanks,
George



--
Zhanyong

George Georgiev

unread,
Feb 5, 2016, 11:50:23 AM2/5/16
to Matthew Larionov, Google C++ Testing Framework
Hi,

You can check here how I implemented test time checks. It is not timeout - it is time monitor and if the test takes too long it fails it. If your test hangs this will not help you.

Unfortunately monitoring the time tests take is a tricky thing, because every system hiccup could fail it. This is why I do this in two passes - on first I accumulate all tests that surpass the expected time, and then I run them again - to make sure if this is a tendency or hiccup.

You can avoid such problems if you use cpu cycles, but this will create some other issues.

Hope this helps.

Thanks,
George






On Fri, Feb 5, 2016 at 7:27 AM, Matthew Larionov <matth...@gmail.com> wrote:
Is there any way to stop after first failed test? Filed like not failing assertions, but time out, for example?

Matthew Larionov

unread,
Feb 5, 2016, 3:54:19 PM2/5/16
to Google C++ Testing Framework, george.ge...@gmail.com
Is there any way to stop after first failed test? Filed like not failing assertions, but time out, for example?

On Wednesday, March 13, 2013 at 9:48:38 PM UTC+4, Zhanyong Wan wrote:
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/groups/opt_out.
 
 



--
Zhanyong




--
Zhanyong
Reply all
Reply to author
Forward
0 new messages