Giter VIP home page Giter VIP logo

Comments (2)

GoogleCodeExporter avatar GoogleCodeExporter commented on June 1, 2024
mingw 3.4.5 does not support __try so I had to disable them to build / run with 
mingw

--- gtest\src\gtest.cc-revBASE.svn000.tmp.cc    Sun Oct 19 13:50:44 2008
+++ gtest\src\gtest.cc  Sun Oct 19 13:38:36 2008
@@ -1967,8 +1967,8 @@
   if (!HasSameFixtureClass()) return;

   internal::UnitTestImpl* const impl = internal::GetUnitTestImpl();
-#ifdef GTEST_OS_WINDOWS
-  // We are on Windows.
+#if defined(GTEST_OS_WINDOWS) && !defined(__MINGW__) && !defined(__MINGW32__)
+  // We are on Windows but mingw does not support __try.
   impl->os_stack_trace_getter()->UponLeavingGTest();
   __try {
     SetUp();
@@ -1999,7 +1999,7 @@
     AddExceptionThrownFailure(GetExceptionCode(), "TearDown()");
   }

-#else  // We are on Linux or Mac - exceptions are disabled.
+#else  // We are on Linux or Mac or using mingw - exceptions are disabled.
   impl->os_stack_trace_getter()->UponLeavingGTest();
   SetUp();

@@ -2170,8 +2170,8 @@
   const TimeInMillis start = GetTimeInMillis();

   impl->os_stack_trace_getter()->UponLeavingGTest();
-#ifdef GTEST_OS_WINDOWS
-  // We are on Windows.
+#if defined(GTEST_OS_WINDOWS) && !defined(__MINGW__) && !defined(__MINGW32__)
+  // We are on Windows but mingw does not support __try.
   Test* test = NULL;

   __try {
@@ -2183,7 +2183,7 @@
                               "the test fixture's constructor");
     return;
   }
-#else  // We are on Linux or Mac OS - exceptions are disabled.
+#else  // We are on Linux or Mac OS or using 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
@@ -3214,7 +3214,8 @@
 // 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(__MINGW__) && !defined(__MINGW32__)
+  // We are on Windows but mingw does not support __try.

 #if !defined(_WIN32_WCE)
   // SetErrorMode doesn't exist on CE.
@@ -3237,7 +3238,7 @@
   }

 #else
-  // We are on Linux or Mac OS.  There is no exception of any kind.
+  // We are on Linux or Mac OS or using mingw. There is no exception of any 
kind.

   return impl_->RunAllTests();
 #endif  // GTEST_OS_WINDOWS


Original comment by [email protected] on 19 Oct 2008 at 10:58

from googletest.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 1, 2024
I cannot verify it, but this is likely to be fixed in 1.2.0.  Please re-open 
the bug 
if you still have problem building gtest 1.2.0 on mingw.

Original comment by [email protected] on 2 Dec 2008 at 5:06

  • Changed state: Fixed

from googletest.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.