Comments (2)
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.
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)
- {ASSERT|EXPECT}_[NOT_]NULL(expr) HOT 2
- Need a polymorphic NULL pointer that can be used in function templates HOT 1
- Need to unify the way the GTEST_* macros are interpreted HOT 1
- 'make check' fails with undefined references. HOT 3
- --gtest_repeat should case failures to show up at the bottom
- Failed tests HOT 3
- --gtest_output flag doesn't produce output on platforms where argv[0] is empty HOT 3
- Include StackWalker for windows exception handling HOT 4
- ValuesIn(container<T>) needs to be convertible to ParamGenerator<T1> if T is assignable to T1. HOT 1
- make check fails on ubuntu 8.01 HOT 3
- Add EXPECT_HRESULT(hr) for Windows systems HOT 5
- Support for custom ResultPrinter HOT 8
- Enhance the Macros to enable the user to Specify Comments for TestCase and Test. HOT 3
- Support Multiple Levels of TestCase Specification HOT 1
- the XML report may contain invalid charactor HOT 3
- no way to delete UnitTest instance HOT 6
- need to update the wiki with parameterized test docs HOT 1
- We need well defined test procedure and test runner scripts to test Google Test HOT 1
- Value-parameterized tests must warn about interspersing test definitions and test case instantiations for the same test case. HOT 2
- 'make check' fails on SunOS 5.10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from googletest.