On Fri, Oct 3, 2008 at 8:56 AM, Keith Ray <keit...@gmail.com> wrote:
> I just noticed the 1.1 gTest code seems to catch exceptions and report them
> as errors but only on Windows and not MacOS X and Linux.
>
> void Test::Run() {
> if (!HasSameFixtureClass()) return;
>
> internal::UnitTestImpl* const impl = internal::GetUnitTestImpl();
> #ifdef GTEST_OS_WINDOWS
> .... __try ... __catch ... AddExceptionThrownFailure ...
> #else // We are on Linux or Mac - exceptions are disabled.
> #endif
>
> what we're seeing with CGWIN on Windows is that exceptions crash the test
> app, and on MacOS X the exceptions are swallowed without error reporting.
>
> Is there code post-1.1 that handles exceptions on all platforms?
We don't have the code for that yet. Could you log an issue and
perhaps contribute a patch? :-) If you do it, you should key off the
GTEST_HAS_EXCEPTIONS macro defined in
include/gtest/internal/gtest-port.h. We need to figure out how to
detect whether exceptions are enabled in gcc.
>
> --
> C. Keith Ray, IXP Coach, Industrial Logic, Inc.
> http://industriallogic.com 866-540-8336 (toll free)
> Groove with our Agile Greatest Hits:
> http://www.industriallogic.com/elearning/
> http://agilesolutionspace.blogspot.com/
>
>
--
Zhanyong
To log an issue, please go to the project homepage
http://code.google.com/p/googletest/ and click on "Issues".
Please see http://code.google.com/p/googletest/wiki/GoogleTestDevGuide
for how to contribute a patch.
Thanks,
--
Zhanyong