toeb / googletest

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

Death tests are not enabled on HP-UX #173

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 
HP-UX

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

The following error occurs:

"Example_unittest.cpp", line 13: error #2135: namespace "testing" has no
          member "ExitedWithCode"
        EXPECT_EXIT(options->parse_args(argc, argv), 
::testing::ExitedWithCode(0), "agent: Socket Server");

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

gtest 1.3.0

uname -a
HP-UX B.11.31 U ia64 0383467329 unlimited-user license

aCC -V
aCC: HP C/aC++ B3910B A.06.22 [Nov 14 2008]

Please provide any additional information below.

The patch below introduces the new variable GTEST_OS_HPUX which enables 
death tests on HP-UX.

==== gtest-1.3.0/include/gtest/internal/gtest-port.h#1 - gtest-
1.3.0/include/gtest/internal/gtest-port.h ====
@@ -69,6 +69,7 @@
 //   GTEST_OS_LINUX    - Linux
 //   GTEST_OS_MAC      - Mac OS X
 //   GTEST_OS_SOLARIS  - Sun Solaris
+//   GTEST_OS_HPUX     - HP-UX
 //   GTEST_OS_SYMBIAN  - Symbian
 //   GTEST_OS_WINDOWS  - Windows
 //   GTEST_OS_ZOS      - z/OS
@@ -183,6 +184,8 @@
 #define GTEST_OS_ZOS 1
 #elif defined(__sun) && defined(__SVR4)
 #define GTEST_OS_SOLARIS 1
+#elif defined(__hpux)
+#define GTEST_OS_HPUX 1
 #endif  // _MSC_VER

 #if GTEST_OS_CYGWIN || GTEST_OS_LINUX || GTEST_OS_MAC
@@ -379,6 +382,7 @@
 #if GTEST_HAS_STD_STRING && (GTEST_OS_LINUX || \
                              GTEST_OS_MAC || \
                              GTEST_OS_CYGWIN || \
+                             GTEST_OS_HPUX || \
                              (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:49

GoogleCodeExporter commented 9 years ago

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

GoogleCodeExporter commented 9 years ago
I think this is already fixed in 1.5.0?

Original comment by w...@google.com on 5 Jun 2010 at 6:46

GoogleCodeExporter commented 9 years ago
Seems to be. Unfortunately I cannot re-test it on HP-UX at the moment. 

Original comment by ade...@gmail.com on 5 Jun 2010 at 12:55