Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
googletest
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
googletest
Commits
f2334aa1
Commit
f2334aa1
authored
Apr 25, 2009
by
zhanyong.wan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ports gtest to minGW (by Kenton Varda).
parent
fa2b06c5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
39 additions
and
14 deletions
+39
-14
Makefile.am
Makefile.am
+3
-2
configure.ac
configure.ac
+5
-0
gtest-port.h
include/gtest/internal/gtest-port.h
+19
-0
acx_pthread.m4
m4/acx_pthread.m4
+0
-0
gtest.cc
src/gtest.cc
+12
-12
No files found.
Makefile.am
View file @
f2334aa1
...
...
@@ -181,8 +181,9 @@ samples_sample8_unittest_LDADD = lib/libgtest_main.la \
TESTS
+=
test
/gtest-death-test_test
check_PROGRAMS
+=
test
/gtest-death-test_test
test_gtest_death_test_test_SOURCES
=
test
/gtest-death-test_test.cc
test_gtest_death_test_test_CXXFLAGS
=
$(AM_CXXFLAGS)
-pthread
test_gtest_death_test_test_LDADD
=
-lpthread
lib/libgtest_main.la
test_gtest_death_test_test_CXXFLAGS
=
$(AM_CXXFLAGS)
$(PTHREAD_CFLAGS)
test_gtest_death_test_test_LDADD
=
$(PTHREAD_LIBS)
$(PTHREAD_CFLAGS)
\
lib/libgtest_main.la
TESTS
+=
test
/gtest_environment_test
check_PROGRAMS
+=
test
/gtest_environment_test
...
...
configure.ac
View file @
f2334aa1
m4_include(m4/acx_pthread.m4)
# At this point, the Xcode project assumes the version string will be three
# integers separated by periods and surrounded by square brackets (e.g.
# "[1.0.1]"). It also asumes that there won't be any closing parenthesis
...
...
@@ -37,6 +39,9 @@ AS_IF([test "$PYTHON" != ":"],
[AM_PYTHON_CHECK_VERSION([$PYTHON],[2.3],[:],[PYTHON=":"])])
AM_CONDITIONAL([HAVE_PYTHON],[test "$PYTHON" != ":"])
# Check for pthreads.
ACX_PTHREAD
# TODO(chandlerc@google.com) Check for the necessary system headers.
# TODO(chandlerc@google.com) Check the types, structures, and other compiler
...
...
include/gtest/internal/gtest-port.h
View file @
f2334aa1
...
...
@@ -60,6 +60,9 @@
// be used where std::wstring is unavailable).
// GTEST_HAS_TR1_TUPLE 1 - Define it to 1/0 to indicate tr1::tuple
// is/isn't available.
// GTEST_HAS_SEH - Define it to 1/0 to indicate whether the
// compiler supports Microsoft's "Structured
// Exception Handling".
// This header defines the following utilities:
//
...
...
@@ -473,6 +476,22 @@
#define GTEST_MUST_USE_RESULT_
#endif // __GNUC__ && (GTEST_GCC_VER_ >= 30400) && !COMPILER_ICC
// Determine whether the compiler supports Microsoft's Structured Exception
// Handling. This is supported by several Windows compilers but generally
// does not exist on any other system.
#ifndef GTEST_HAS_SEH
// The user didn't tell us, so we need to figure it out.
#if defined(_MSC_VER) || defined(__BORLANDC__)
// These two compilers are known to support SEH.
#define GTEST_HAS_SEH 1
#else
// Assume no SEH.
#define GTEST_HAS_SEH 0
#endif
#endif // GTEST_HAS_SEH
namespace
testing
{
class
Message
;
...
...
m4/acx_pthread.m4
0 → 100644
View file @
f2334aa1
This diff is collapsed.
Click to expand it.
src/gtest.cc
View file @
f2334aa1
...
...
@@ -2013,8 +2013,8 @@ void Test::Run() {
if
(
!
HasSameFixtureClass
())
return
;
internal
::
UnitTestImpl
*
const
impl
=
internal
::
GetUnitTestImpl
();
#if GTEST_
OS_WINDOWS
//
We are on Window
s.
#if GTEST_
HAS_SEH
//
Catch SEH-style exception
s.
impl
->
os_stack_trace_getter
()
->
UponLeavingGTest
();
__try
{
SetUp
();
...
...
@@ -2045,7 +2045,7 @@ void Test::Run() {
AddExceptionThrownFailure
(
GetExceptionCode
(),
"TearDown()"
);
}
#else // We are on
Linux or Mac - exceptions are disabled
.
#else // We are on
a compiler or platform that doesn't support SEH
.
impl
->
os_stack_trace_getter
()
->
UponLeavingGTest
();
SetUp
();
...
...
@@ -2060,7 +2060,7 @@ void Test::Run() {
// failed.
impl
->
os_stack_trace_getter
()
->
UponLeavingGTest
();
TearDown
();
#endif // GTEST_
OS_WINDOWS
#endif // GTEST_
HAS_SEH
}
...
...
@@ -2256,8 +2256,8 @@ void TestInfoImpl::Run() {
const
TimeInMillis
start
=
GetTimeInMillis
();
impl
->
os_stack_trace_getter
()
->
UponLeavingGTest
();
#if GTEST_
OS_WINDOWS
//
We are on Window
s.
#if GTEST_
HAS_SEH
//
Catch SEH-style exception
s.
Test
*
test
=
NULL
;
__try
{
...
...
@@ -2269,7 +2269,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
a compiler or platform that doesn't support SEH
.
// 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
...
...
@@ -2278,7 +2278,7 @@ void TestInfoImpl::Run() {
// Creates the test object.
Test
*
test
=
factory_
->
CreateTest
();
#endif // GTEST_
OS_WINDOWS
#endif // GTEST_
HAS_SEH
// Runs the test only if the constructor of the test fixture didn't
// generate a fatal failure.
...
...
@@ -3333,7 +3333,8 @@ 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
()
{
#if GTEST_OS_WINDOWS
#if GTEST_HAS_SEH
// Catch SEH-style exceptions.
const
bool
in_death_test_child_process
=
internal
::
GTEST_FLAG
(
internal_run_death_test
).
GetLength
()
>
0
;
...
...
@@ -3381,11 +3382,10 @@ int UnitTest::Run() {
return
1
;
}
#else
// We are on Linux or Mac OS. There is no exception of any kind.
#else // We are on a compiler or platform that doesn't support SEH.
return
impl_
->
RunAllTests
();
#endif // GTEST_
OS_WINDOWS
#endif // GTEST_
HAS_SEH
}
// Returns the working directory when the first TEST() or TEST_F() was
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment