I use GTEST with GCC on Linux. I want to see stacktrace printed on test fail (be it assert or signal based crash). It can be done manually, yet I wonder if it can be set as GTEST build/run option (without more than one line modifications to my codebase)?
There is not "fully" documented option: --gtest_stack_trace_depth=10
(10 is just example value).
It must be used with --gmock_verbose=info
And yes - it works for failing EXPECT_CALL
- in gmock only.
For asserts (like ASSERT_EQ) it has less sence - since ASSERT is just where it is - its tack trace is empty (meaning does not contain any of non-gtest/UT code).
An example:
some_test --gmock_verbose=info --gtest_stack_trace_depth=10
If you believe it shall work also for ASSERT* - you might raise an issue here: https://github.com/google/googletest/issues
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With