googletest: Fatal failure in SetUpTestCase() function should skip running tests.
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
About this issue
- Original URL
- State: closed
- Created 9 years ago
- Reactions: 6
- Comments: 18 (9 by maintainers)
Commits related to this issue
- librados/TestCase: skip tests if SetUpTestCase() fails see https://github.com/google/googletest/issues/247, gtest does not fail its tests even if SetUpTestCase() fails. after shutdown(), the behaviou... — committed to tchaikov/ceph by tchaikov 8 years ago
- Omit using SetUpTestSuite() Due to https://github.com/google/googletest/issues/247 Can be reverted once googletest version is at least 1.11.0 — committed to PilzDE/psen_scan_v2 by martiniil 3 years ago
- Fix hwtest_scan_compare * Include bringup.launch * Set unique udp port for data connection * Only start laserscan validation when connected on topic * Omit using SetUpTestSuite() Due to https://githu... — committed to PilzDE/psen_scan_v2 by martiniil 3 years ago
- Fix hwtest_scan_compare (#218) * Fix hwtest_scan_compare * Include bringup.launch * Set unique udp port for data connection * Only start laserscan validation when connected on topic * Omit usin... — committed to PilzDE/psen_scan_v2 by martiniil 3 years ago
- Add rules_swift 1.2.0 (#247) * Add rules_swift 1.2.0 * Add repository name to metadata * Add prefix to build targets * Remove strip_prefix since this is a release archive * Add patch addi... — committed to hanneskaeufler/googletest by BalestraPatrick 2 years ago
Done, see https://github.com/google/googletest/commit/9ed99c6c837ae1cbfcabd36959fc802ebb5ae07f
Here as well. Please take a look!
Hello, any progress in this issue? I have the same problem.
Is there any progress on this issue? These seems like a major issue to me and should be prioritized.
wow , 10 years.
It’s been hanging here since 2010…
I face this issue with gtest1.8, and when it will fix? I don’t think test event listener is a good way to fix it by myself.
Guys! Any progress o this topic?? It’s been hanging here since 2015…
You can “fix” this yourself by using a test event listener, as described in the advanced user guide, by doing something like this in your derived test event listener class (which you would register in your main()):
And then register the event listener in your
main()
, with something like this: