print stack trace to the console

818 views
Skip to first unread message

Rohit Pegallapati

unread,
Mar 15, 2011, 6:00:34 PM3/15/11
to googletes...@googlegroups.com
Hello 

        I a using gtest to test C API of a software.  If there is any error in the code in the console I can only see the expected values and actual values.  The API provides me with functions to print the stack trace when ever there is error.  How can I use these functions to print stack trace to the console when used in conjuntion with gtest.

Regards,
Rohit

Vlad Losev

unread,
Mar 15, 2011, 7:26:23 PM3/15/11
to Rohit Pegallapati, googletes...@googlegroups.com
Hi Rohit,

On Tue, Mar 15, 2011 at 3:00 PM, Rohit Pegallapati <rohit.a...@gmail.com> wrote:
Hello 

        I a using gtest to test C API of a software.  If there is any error in the code in the console I can only see the expected values and actual values.  The API provides me with functions to print the stack trace when ever there is error.  How can I use these functions to print stack trace to the console when used in conjuntion with gtest.

Stack traces are not supported officially. But if you have to, patch UnitTestImpl::CurrentOsStackTraceExceptTop in gtest.cc to return the stack trace from your API.
 
Regards,
Rohit

HTH,
Vlad
Reply all
Reply to author
Forward
0 new messages