Skip to content

Commit 8925603

Browse files
authored
Add a comment about using --gtest_catch_exceptions=0 to get full stack traces. (#611)
1 parent dcd1fea commit 8925603

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

testing/test_framework/src/firebase_test_framework.cc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,14 @@ char** EditMainArgsForGoogleTest(int* argc, char* argv[]) {
354354
// e.g. modified_args.push_back("--gtest_list_tests");
355355
// e.g. modified_args.push_back("--gtest_filter=MyTestFixture.MyTest");
356356

357+
// Disable googletest's exception handling logic when debugging test failures
358+
// due to exceptions. This can be helpful because when exceptions are handled
359+
// by googletest (the default) the stack traces are lost; however, when they
360+
// are instead allowed to bubble up and crash the app then helpful stack
361+
// traces are usually included as part of the crash dump.
362+
// See https://goo.gle/2WcC3fV for details.
363+
// modified_args.push_back("--gtest_catch_exceptions=0");
364+
357365
// Create a new `argv` with the elements from the `modified_args` vector and
358366
// write the new count back to `argc`. The memory leaks produced by
359367
// `VectorToArgcArgv` acceptable because they last for the entire application.

0 commit comments

Comments
 (0)