I found the following snippet in the FAQ:
- The Google Test team is considering making the assertion macros throw on platforms where exceptions are enabled (e.g. Windows, Mac OS, and Linux client-side), which will eliminate the need for the user to propagate failures from a subroutine to its caller. Therefore, you shouldn't use Google Test assertions in a destructor if your code could run on such a platform.
How hard would it be to add a flag that switches the assert mode to throwing exceptions?--
---
You received this message because you are subscribed to the Google Groups "Google C++ Testing Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to googletestframe...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
To unsubscribe from this group and stop receiving emails from it, send an email to googletestframework+unsub...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
--
Zhanyong
I wanted to make gtest use exceptions for ASSERT* even if gtest is driving. I.e. make gtest throw and *catch* the exception, mark the failure etc.
On Sunday, July 7, 2013 3:40:39 PM UTC-7, Zhanyong Wan wrote:It's already implemented (--gtest_throw_on_failure):The FAQ is out-dated. Sorry about that. I'll fix it soon.On Wed, Jul 3, 2013 at 3:19 PM, Piotr Jaroszyński <p.jaro...@gmail.com> wrote:
I found the following snippet in the FAQ:
- The Google Test team is considering making the assertion macros throw on platforms where exceptions are enabled (e.g. Windows, Mac OS, and Linux client-side), which will eliminate the need for the user to propagate failures from a subroutine to its caller. Therefore, you shouldn't use Google Test assertions in a destructor if your code could run on such a platform.
How hard would it be to add a flag that switches the assert mode to throwing exceptions?--
---
You received this message because you are subscribed to the Google Groups "Google C++ Testing Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to googletestframework+unsub...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
--
Zhanyong
--
---
You received this message because you are subscribed to the Google Groups "Google C++ Testing Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to googletestframe...@googlegroups.com.
Yes, you are right. I would be fine with a compile time flag. Any idea how much work would that be or some tips where to start if I wanted to implement that?