Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable exception handling while debugging c++ project using Google Test

I have my (native C++) DLL project and a corresponding test EXE project based on Google Test. While debugging my DLL via this EXE I have exceptions automatically handled by Google Test. So if my DLL throws an unhandled exception during debug, I expect to see error message from Visual Studio with debug session paused after the code caused exception. Instead, I have breakpoint triggered in gtest.cc. And if I disable --gtest_break_on_failure flag I will receive no breaks at all.

I found no such option in Google Test documentation. Have I missed it? I don't want to check "break when thrown" flag for different exceptions in Debug settings, because I'm only interested in unhandled ones.

like image 634
Mikhail Avatar asked Feb 15 '12 12:02

Mikhail


1 Answers

The answer is in the Advanced page section called "Disabling Catching Test-Thrown Exceptions". What you have to do is invoke your binary with --gtest_catch_exceptions=0.

like image 191
VladLosev Avatar answered Sep 18 '22 17:09

VladLosev