diff options
author | Julien Lerouge <jlerouge@apple.com> | 2009-02-12 08:02:35 +0000 |
---|---|---|
committer | Julien Lerouge <jlerouge@apple.com> | 2009-02-12 08:02:35 +0000 |
commit | cbc2491deb3c2b6e945f0d44a643ab7a4fa8fa95 (patch) | |
tree | e8a07d49e9ed3faf46c5befa27845ec44e71675b /llvm/utils/unittest/googletest/gtest.cc | |
parent | 7682ffdeb9a56f668bbb94ccd5c32edac8879d37 (diff) | |
download | bcm5719-llvm-cbc2491deb3c2b6e945f0d44a643ab7a4fa8fa95.tar.gz bcm5719-llvm-cbc2491deb3c2b6e945f0d44a643ab7a4fa8fa95.zip |
Fix MingW build: define GTEST_OS_WINDOWS if OS is MingW, but disable
exceptions.
llvm-svn: 64367
Diffstat (limited to 'llvm/utils/unittest/googletest/gtest.cc')
-rw-r--r-- | llvm/utils/unittest/googletest/gtest.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/llvm/utils/unittest/googletest/gtest.cc b/llvm/utils/unittest/googletest/gtest.cc index 64dbb841894..e46e90a2c47 100644 --- a/llvm/utils/unittest/googletest/gtest.cc +++ b/llvm/utils/unittest/googletest/gtest.cc @@ -1993,7 +1993,7 @@ void Test::Run() { if (!HasSameFixtureClass()) return; internal::UnitTestImpl* const impl = internal::GetUnitTestImpl(); -#ifdef GTEST_OS_WINDOWS +#if defined(GTEST_OS_WINDOWS) && !defined(__MINGW32__) // We are on Windows. impl->os_stack_trace_getter()->UponLeavingGTest(); __try { @@ -2025,7 +2025,7 @@ void Test::Run() { AddExceptionThrownFailure(GetExceptionCode(), "TearDown()"); } -#else // We are on Linux or Mac - exceptions are disabled. +#else // We are on Linux, Mac or MingW - exceptions are disabled. impl->os_stack_trace_getter()->UponLeavingGTest(); SetUp(); @@ -2227,7 +2227,7 @@ void TestInfoImpl::Run() { const TimeInMillis start = GetTimeInMillis(); impl->os_stack_trace_getter()->UponLeavingGTest(); -#ifdef GTEST_OS_WINDOWS +#if defined(GTEST_OS_WINDOWS) && !defined(__MINGW32__) // We are on Windows. Test* test = NULL; @@ -2240,7 +2240,7 @@ void TestInfoImpl::Run() { "the test fixture's constructor"); return; } -#else // We are on Linux or Mac OS - exceptions are disabled. +#else // We are on Linux, Mac OS or MingW - exceptions are disabled. // TODO(wan): If test->Run() throws, test won't be deleted. This is // not a problem now as we don't use exceptions. If we were to @@ -3271,7 +3271,7 @@ void UnitTest::RecordPropertyForCurrentTest(const char* key, // We don't protect this under mutex_, as we only support calling it // from the main thread. int UnitTest::Run() { -#ifdef GTEST_OS_WINDOWS +#if defined(GTEST_OS_WINDOWS) && !defined(__MINGW32__) #if !defined(_WIN32_WCE) // SetErrorMode doesn't exist on CE. @@ -3294,7 +3294,7 @@ int UnitTest::Run() { } #else - // We are on Linux or Mac OS. There is no exception of any kind. + // We are on Linux, Mac OS or MingW. There is no exception of any kind. return impl_->RunAllTests(); #endif // GTEST_OS_WINDOWS |