superupon / googletest

Automatically exported from code.google.com/p/googletest
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Fatal failure in SetUpTestCase() function should skip running tests. #247

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I think googletest should skip running tests (or automatically mark as
failed) in a particular fixture if we call SetUpTestCase() function
and there is fatal failure in it. Suppose we create some shared object
in SetUpTestCase() function and try to access that in TEST_F. But the
failure to create that object in SetUpTestCase() cause to access NULL
inside TEST_F.

So if we make fatal assertion in SetUpTestCase() itself, then above
problem can be avoided.

Original issue reported on code.google.com by pvshew...@gmail.com on 11 Jan 2010 at 6:39

GoogleCodeExporter commented 9 years ago

Original comment by w...@google.com on 11 Jan 2010 at 6:46

GoogleCodeExporter commented 9 years ago
I am also facing this problem, when I add testing machoes (i.e. EXPECT_EQ) in 
SetUpTestCase errors are not reported on the console if there is any.

Original comment by l...@schouw.me on 28 Mar 2012 at 4:57

GoogleCodeExporter commented 9 years ago
Is this problem resolved?

Original comment by irr...@gmail.com on 8 Aug 2012 at 1:42

GoogleCodeExporter commented 9 years ago
Please, may you give an update of the issue? is it still under investigation? 
What about the TearDownTestCase()? I think that also errors in the 
TearDownTestCase() should be reported on the console and in some way invalidate 
the "Pass" TEST_F methods involved inthe fixture.

Original comment by sabrina....@gmail.com on 20 Nov 2012 at 1:06

GoogleCodeExporter commented 9 years ago
Hi,

I'm also facing this issue now.
In my case, I'm setting a database connection so it's logical that if I can't 
set it up (e.g. if I don't have permissions to read the specified database) I 
shouldn't be able to even run my tests.
For now, I have a segmentation fault.

Original comment by ibizapea...@gmail.com on 17 Oct 2013 at 7:18

GoogleCodeExporter commented 9 years ago
I'm having the issue also. We are testing code that interfaces with an external 
app and setup needs to fail properly if that app doesn't start.  

Currently, I have an ASSERT in setup that properly prevents running the tests, 
but the final output still says

[==========] 3 tests from 1 test case ran. (5004 ms total)
[  PASSED  ] 3 tests.
[  FAILED  ] 0 tests, listed below:

 0 FAILED TESTS

But that is, in fact, incorrect. None of the tests ran and NONE of them would 
have passed if they did.

Original comment by JoeAndr...@gmail.com on 6 Nov 2013 at 10:51

GoogleCodeExporter commented 9 years ago
I am still facing this issue. 
Is it considered to be fixed?
Could you please let us know of the status?

Original comment by trygi...@gmail.com on 17 Jul 2014 at 6:22

GoogleCodeExporter commented 9 years ago
This is also on my wish list.

Original comment by ibizapea...@gmail.com on 12 Sep 2014 at 10:00