diff options
author | shiqian <shiqian@861a406c-534a-0410-8894-cb66d6ee9925> | 2008-07-09 20:58:26 (GMT) |
---|---|---|
committer | shiqian <shiqian@861a406c-534a-0410-8894-cb66d6ee9925> | 2008-07-09 20:58:26 (GMT) |
commit | e0ecb7ac588e4061fe57207ff3734e465637b14d (patch) | |
tree | 81afa87cb21e28946ccd96f22fce35c4158c6d51 /test | |
parent | e4e9a8bd7d2dbbad62030c8f80513e3c81b32213 (diff) | |
download | googletest-e0ecb7ac588e4061fe57207ff3734e465637b14d.zip googletest-e0ecb7ac588e4061fe57207ff3734e465637b14d.tar.gz googletest-e0ecb7ac588e4061fe57207ff3734e465637b14d.tar.bz2 |
Makes Google Test compile on Mac OS X and Cygwin, and adds project files for Microsoft Visual Studio.
Diffstat (limited to 'test')
-rwxr-xr-x | test/gtest_break_on_failure_unittest.py | 8 | ||||
-rw-r--r-- | test/gtest_unittest.cc | 8 |
2 files changed, 11 insertions, 5 deletions
diff --git a/test/gtest_break_on_failure_unittest.py b/test/gtest_break_on_failure_unittest.py index 1b18339..674ef11 100755 --- a/test/gtest_break_on_failure_unittest.py +++ b/test/gtest_break_on_failure_unittest.py @@ -74,10 +74,14 @@ def SetEnvVar(env_var, value): def Run(command): - """Runs a command; returns 1 if it has a segmentation fault, or 0 otherwise. + """Runs a command; returns 1 if it was killed by a signal, or 0 otherwise. """ - return os.system(command) == signal.SIGSEGV + exit_code = os.system(command) + # On Unix-like systems, the lowest 8 bits of the exit code is the + # signal number that killed the process (or 0 if it wasn't killed by + # a signal). + return (exit_code & 255) != 0 # The unit test. diff --git a/test/gtest_unittest.cc b/test/gtest_unittest.cc index 9a64a13..02799a4 100644 --- a/test/gtest_unittest.cc +++ b/test/gtest_unittest.cc @@ -157,10 +157,12 @@ TEST(ToUtf8StringTest, CanEncode12To16Bits) { EXPECT_STREQ("\xEC\x9D\x8D", ToUtf8String(L'\xC74D').c_str()); } -#if !defined(GTEST_OS_WINDOWS) && !defined(__SYMBIAN32__) +#if !defined(GTEST_OS_WINDOWS) && !defined(GTEST_OS_CYGWIN) && \ + !defined(__SYMBIAN32__) // Tests in this group require a wchar_t to hold > 16 bits, and thus -// are skipped on Windows and Symbian, where a wchar_t is 16-bit wide. +// are skipped on Windows, Cygwin, and Symbian, where a wchar_t is +// 16-bit wide. // Tests that Unicode code-points that have 17 to 21 bits are encoded // as 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx. @@ -178,7 +180,7 @@ TEST(ToUtf8StringTest, CanEncodeInvalidCodePoint) { ToUtf8String(L'\x1234ABCD').c_str()); } -#endif // Windows or Symbian +#endif // Windows, Cygwin, or Symbian // Tests the List template class. |