Port to GNU/Hurd
This commit is contained in:
parent
6c58c11d54
commit
05e9fa23f7
@ -78,6 +78,8 @@
|
|||||||
# define GTEST_OS_FREEBSD 1
|
# define GTEST_OS_FREEBSD 1
|
||||||
#elif defined __Fuchsia__
|
#elif defined __Fuchsia__
|
||||||
# define GTEST_OS_FUCHSIA 1
|
# define GTEST_OS_FUCHSIA 1
|
||||||
|
#elif defined(__GNU__)
|
||||||
|
# define GTEST_OS_GNU_HURD 1
|
||||||
#elif defined(__GLIBC__) && defined(__FreeBSD_kernel__)
|
#elif defined(__GLIBC__) && defined(__FreeBSD_kernel__)
|
||||||
# define GTEST_OS_GNU_KFREEBSD 1
|
# define GTEST_OS_GNU_KFREEBSD 1
|
||||||
#elif defined __linux__
|
#elif defined __linux__
|
||||||
|
@ -116,6 +116,7 @@
|
|||||||
// GTEST_OS_DRAGONFLY - DragonFlyBSD
|
// GTEST_OS_DRAGONFLY - DragonFlyBSD
|
||||||
// GTEST_OS_FREEBSD - FreeBSD
|
// GTEST_OS_FREEBSD - FreeBSD
|
||||||
// GTEST_OS_FUCHSIA - Fuchsia
|
// GTEST_OS_FUCHSIA - Fuchsia
|
||||||
|
// GTEST_OS_GNU_HURD - GNU/Hurd
|
||||||
// GTEST_OS_GNU_KFREEBSD - GNU/kFreeBSD
|
// GTEST_OS_GNU_KFREEBSD - GNU/kFreeBSD
|
||||||
// GTEST_OS_HAIKU - Haiku
|
// GTEST_OS_HAIKU - Haiku
|
||||||
// GTEST_OS_HPUX - HP-UX
|
// GTEST_OS_HPUX - HP-UX
|
||||||
@ -543,7 +544,7 @@ typedef struct _RTL_CRITICAL_SECTION GTEST_CRITICAL_SECTION;
|
|||||||
(GTEST_OS_LINUX || GTEST_OS_MAC || GTEST_OS_HPUX || GTEST_OS_QNX || \
|
(GTEST_OS_LINUX || GTEST_OS_MAC || GTEST_OS_HPUX || GTEST_OS_QNX || \
|
||||||
GTEST_OS_FREEBSD || GTEST_OS_NACL || GTEST_OS_NETBSD || GTEST_OS_FUCHSIA || \
|
GTEST_OS_FREEBSD || GTEST_OS_NACL || GTEST_OS_NETBSD || GTEST_OS_FUCHSIA || \
|
||||||
GTEST_OS_DRAGONFLY || GTEST_OS_GNU_KFREEBSD || GTEST_OS_OPENBSD || \
|
GTEST_OS_DRAGONFLY || GTEST_OS_GNU_KFREEBSD || GTEST_OS_OPENBSD || \
|
||||||
GTEST_OS_HAIKU)
|
GTEST_OS_HAIKU || GTEST_OS_GNU_HURD)
|
||||||
#endif // GTEST_HAS_PTHREAD
|
#endif // GTEST_HAS_PTHREAD
|
||||||
|
|
||||||
#if GTEST_HAS_PTHREAD
|
#if GTEST_HAS_PTHREAD
|
||||||
@ -603,7 +604,8 @@ typedef struct _RTL_CRITICAL_SECTION GTEST_CRITICAL_SECTION;
|
|||||||
(GTEST_OS_WINDOWS_DESKTOP && _MSC_VER) || GTEST_OS_WINDOWS_MINGW || \
|
(GTEST_OS_WINDOWS_DESKTOP && _MSC_VER) || GTEST_OS_WINDOWS_MINGW || \
|
||||||
GTEST_OS_AIX || GTEST_OS_HPUX || GTEST_OS_OPENBSD || GTEST_OS_QNX || \
|
GTEST_OS_AIX || GTEST_OS_HPUX || GTEST_OS_OPENBSD || GTEST_OS_QNX || \
|
||||||
GTEST_OS_FREEBSD || GTEST_OS_NETBSD || GTEST_OS_FUCHSIA || \
|
GTEST_OS_FREEBSD || GTEST_OS_NETBSD || GTEST_OS_FUCHSIA || \
|
||||||
GTEST_OS_DRAGONFLY || GTEST_OS_GNU_KFREEBSD || GTEST_OS_HAIKU)
|
GTEST_OS_DRAGONFLY || GTEST_OS_GNU_KFREEBSD || GTEST_OS_HAIKU || \
|
||||||
|
GTEST_OS_GNU_HURD)
|
||||||
# define GTEST_HAS_DEATH_TEST 1
|
# define GTEST_HAS_DEATH_TEST 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -623,7 +625,8 @@ typedef struct _RTL_CRITICAL_SECTION GTEST_CRITICAL_SECTION;
|
|||||||
|
|
||||||
// Determines whether test results can be streamed to a socket.
|
// Determines whether test results can be streamed to a socket.
|
||||||
#if GTEST_OS_LINUX || GTEST_OS_GNU_KFREEBSD || GTEST_OS_DRAGONFLY || \
|
#if GTEST_OS_LINUX || GTEST_OS_GNU_KFREEBSD || GTEST_OS_DRAGONFLY || \
|
||||||
GTEST_OS_FREEBSD || GTEST_OS_NETBSD || GTEST_OS_OPENBSD
|
GTEST_OS_FREEBSD || GTEST_OS_NETBSD || GTEST_OS_OPENBSD || \
|
||||||
|
GTEST_OS_GNU_HURD
|
||||||
# define GTEST_CAN_STREAM_RESULTS_ 1
|
# define GTEST_CAN_STREAM_RESULTS_ 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -98,7 +98,7 @@ const int kStdOutFileno = STDOUT_FILENO;
|
|||||||
const int kStdErrFileno = STDERR_FILENO;
|
const int kStdErrFileno = STDERR_FILENO;
|
||||||
#endif // _MSC_VER
|
#endif // _MSC_VER
|
||||||
|
|
||||||
#if GTEST_OS_LINUX
|
#if GTEST_OS_LINUX || GTEST_OS_GNU_HURD
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
template <typename T>
|
template <typename T>
|
||||||
|
@ -280,7 +280,7 @@ TEST(FormatCompilerIndependentFileLocationTest, FormatsUknownFileAndLine) {
|
|||||||
|
|
||||||
#if GTEST_OS_LINUX || GTEST_OS_MAC || GTEST_OS_QNX || GTEST_OS_FUCHSIA || \
|
#if GTEST_OS_LINUX || GTEST_OS_MAC || GTEST_OS_QNX || GTEST_OS_FUCHSIA || \
|
||||||
GTEST_OS_DRAGONFLY || GTEST_OS_FREEBSD || GTEST_OS_GNU_KFREEBSD || \
|
GTEST_OS_DRAGONFLY || GTEST_OS_FREEBSD || GTEST_OS_GNU_KFREEBSD || \
|
||||||
GTEST_OS_NETBSD || GTEST_OS_OPENBSD
|
GTEST_OS_NETBSD || GTEST_OS_OPENBSD || GTEST_OS_GNU_HURD
|
||||||
void* ThreadFunc(void* data) {
|
void* ThreadFunc(void* data) {
|
||||||
internal::Mutex* mutex = static_cast<internal::Mutex*>(data);
|
internal::Mutex* mutex = static_cast<internal::Mutex*>(data);
|
||||||
mutex->Lock();
|
mutex->Lock();
|
||||||
|
@ -43,6 +43,7 @@ import gtest_test_utils
|
|||||||
|
|
||||||
|
|
||||||
IS_LINUX = os.name == 'posix' and os.uname()[0] == 'Linux'
|
IS_LINUX = os.name == 'posix' and os.uname()[0] == 'Linux'
|
||||||
|
IS_GNUHURD = os.name == 'posix' and os.uname()[0] == 'GNU'
|
||||||
IS_GNUKFREEBSD = os.name == 'posix' and os.uname()[0] == 'GNU/kFreeBSD'
|
IS_GNUKFREEBSD = os.name == 'posix' and os.uname()[0] == 'GNU/kFreeBSD'
|
||||||
IS_WINDOWS = os.name == 'nt'
|
IS_WINDOWS = os.name == 'nt'
|
||||||
|
|
||||||
@ -112,7 +113,7 @@ class GTestHelpTest(gtest_test_utils.TestCase):
|
|||||||
self.assertEquals(0, exit_code)
|
self.assertEquals(0, exit_code)
|
||||||
self.assert_(HELP_REGEX.search(output), output)
|
self.assert_(HELP_REGEX.search(output), output)
|
||||||
|
|
||||||
if IS_LINUX or IS_GNUKFREEBSD:
|
if IS_LINUX or IS_GNUHURD or IS_GNUKFREEBSD:
|
||||||
self.assert_(STREAM_RESULT_TO_FLAG in output, output)
|
self.assert_(STREAM_RESULT_TO_FLAG in output, output)
|
||||||
else:
|
else:
|
||||||
self.assert_(STREAM_RESULT_TO_FLAG not in output, output)
|
self.assert_(STREAM_RESULT_TO_FLAG not in output, output)
|
||||||
|
Loading…
Reference in New Issue
Block a user