dascandy / hippomocks

GNU Lesser General Public License v2.1
196 stars 67 forks source link

Cannot see the exception text #44

Closed pvyleta closed 9 years ago

pvyleta commented 9 years ago

I am a bit lost here and cannot find a better place to ask, but how should I make the exception text visible? My program just ends and thats it. I am using GCC from MinGW and compiling with C++11.

dascandy commented 9 years ago

Typically you use HippoMocks from within a test framework. Nearly all C++ test frameworks catch exceptions from their tests & display them, if they inherit from std::exception. To allow this, we've made HippoMocks do just that, so that in nearly all cases It Just Works (tm).

If you have one that does not, or if you're not running from within a test framework, then add a try...catch(std::exception& ex) { std::cout << ex.what() << std::endl; } to your code and it should print it like normal.

pvyleta commented 9 years ago

First, thanks for such a fast reply.

After some investigation, I found out that the problem lies somewhere in my proprietary build system. If I invoke GCC (from MinGW) directly, everything works fine. But when I use the proprietary build system, I am unable to make it work. I was unable to figure out what is the cause of this, but at least I can confirm this does not appear to be fault of hippomocks in any way.