olegantonyan / googletest

Automatically exported from code.google.com/p/googletest. Added qmake build
BSD 3-Clause "New" or "Revised" License
1 stars 0 forks source link

Death tests are not enabled on AIX #175

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Compile any test case using death test asserts (eq. EXPECT_EXIT()) on 
AIX

What is the expected output? What do you see instead?

The following error occurs:

"Example_unittest.cpp", line 13.54: 1540-0130 (S) 
"::testing::ExitedWithCode" is not declared.

What version of the product are you using? On what operating system?

gtest 1.3.0

uname -a
AIX 3 5

Compiler:

lslpp -L | grep cpp | grep core
vacpp.cmp.core            8.0.0.20    C     F    IBM XL C/C++ Compiler

Please provide any additional information below.

The patch below introduces the new variable GTEST_OS_AIX to enable death 
tests on AIX.

==== gtest-1.3.0/include/gtest/internal/gtest-port.h#1 - gtest-
1.3.0/include/gtest/internal/gtest-port.h ====
@@ -183,6 +183,8 @@
 #define GTEST_OS_ZOS 1
 #elif defined(__sun) && defined(__SVR4)
 #define GTEST_OS_SOLARIS 1
+#elif defined(_AIX)
+#define GTEST_OS_AIX 1
 #endif  // _MSC_VER

 #if GTEST_OS_CYGWIN || GTEST_OS_LINUX || GTEST_OS_MAC
@@ -379,6 +381,7 @@
 #if GTEST_HAS_STD_STRING && (GTEST_OS_LINUX || \
                              GTEST_OS_MAC || \
                              GTEST_OS_CYGWIN || \
+                             GTEST_OS_AIX || \
                              (GTEST_OS_WINDOWS && _MSC_VER >= 1400))
 #define GTEST_HAS_DEATH_TEST 1
 #include <vector>

Original issue reported on code.google.com by ade...@gmail.com on 29 Jul 2009 at 2:55

GoogleCodeExporter commented 9 years ago

Original comment by zhanyong...@gmail.com on 16 Sep 2009 at 6:01

GoogleCodeExporter commented 9 years ago
Fixed in r402.

Original comment by w...@google.com on 25 Mar 2010 at 7:11