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
741d6c0d
Commit
741d6c0d
authored
Apr 07, 2011
by
zhanyong.wan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
makes gtest compatible with HP UX (by Pasi Valminen); fixes a typo in the name…
makes gtest compatible with HP UX (by Pasi Valminen); fixes a typo in the name of xlC (by Hady Zalek).
parent
661758ec
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
36 additions
and
13 deletions
+36
-13
internal_utils.cmake
cmake/internal_utils.cmake
+6
-0
gtest-port.h
include/gtest/internal/gtest-port.h
+11
-4
gtest-type-util.h
include/gtest/internal/gtest-type-util.h
+8
-3
gtest-type-util.h.pump
include/gtest/internal/gtest-type-util.h.pump
+8
-3
gtest.cc
src/gtest.cc
+1
-1
gtest_unittest.cc
test/gtest_unittest.cc
+2
-2
No files found.
cmake/internal_utils.cmake
View file @
741d6c0d
...
@@ -85,6 +85,12 @@ macro(config_compiler_and_linker)
...
@@ -85,6 +85,12 @@ macro(config_compiler_and_linker)
# whether RTTI is enabled. Therefore we define GTEST_HAS_RTTI
# whether RTTI is enabled. Therefore we define GTEST_HAS_RTTI
# explicitly.
# explicitly.
set
(
cxx_no_rtti_flags
"-qnortti -DGTEST_HAS_RTTI=0"
)
set
(
cxx_no_rtti_flags
"-qnortti -DGTEST_HAS_RTTI=0"
)
elseif
(
CMAKE_CXX_COMPILER_ID STREQUAL
"HP"
)
set
(
cxx_base_flags
"-AA -mt"
)
set
(
cxx_exception_flags
"-DGTEST_HAS_EXCEPTIONS=1"
)
set
(
cxx_no_exception_flags
"+noeh -DGTEST_HAS_EXCEPTIONS=0"
)
# RTTI can not be disabled in HP aCC compiler.
set
(
cxx_no_rtti_flags
""
)
endif
()
endif
()
if
(
CMAKE_USE_PTHREADS_INIT
)
# The pthreads library is available and allowed.
if
(
CMAKE_USE_PTHREADS_INIT
)
# The pthreads library is available and allowed.
...
...
include/gtest/internal/gtest-port.h
View file @
741d6c0d
...
@@ -86,6 +86,7 @@
...
@@ -86,6 +86,7 @@
// the given platform; otherwise undefined):
// the given platform; otherwise undefined):
// GTEST_OS_AIX - IBM AIX
// GTEST_OS_AIX - IBM AIX
// GTEST_OS_CYGWIN - Cygwin
// GTEST_OS_CYGWIN - Cygwin
// GTEST_OS_HPUX - HP-UX
// GTEST_OS_LINUX - Linux
// GTEST_OS_LINUX - Linux
// GTEST_OS_LINUX_ANDROID - Google Android
// GTEST_OS_LINUX_ANDROID - Google Android
// GTEST_OS_MAC - Mac OS X
// GTEST_OS_MAC - Mac OS X
...
@@ -235,6 +236,8 @@
...
@@ -235,6 +236,8 @@
# define GTEST_OS_SOLARIS 1
# define GTEST_OS_SOLARIS 1
#elif defined(_AIX)
#elif defined(_AIX)
# define GTEST_OS_AIX 1
# define GTEST_OS_AIX 1
#elif defined(__hpux)
# define GTEST_OS_HPUX 1
#elif defined __native_client__
#elif defined __native_client__
# define GTEST_OS_NACL 1
# define GTEST_OS_NACL 1
#endif // __CYGWIN__
#endif // __CYGWIN__
...
@@ -309,6 +312,10 @@
...
@@ -309,6 +312,10 @@
# elif defined(__IBMCPP__) && __EXCEPTIONS
# elif defined(__IBMCPP__) && __EXCEPTIONS
// xlC defines __EXCEPTIONS to 1 iff exceptions are enabled.
// xlC defines __EXCEPTIONS to 1 iff exceptions are enabled.
# define GTEST_HAS_EXCEPTIONS 1
# define GTEST_HAS_EXCEPTIONS 1
# elif defined(__HP_aCC)
// Exception handling is in effect by default in HP aCC compiler. It has to
// be turned of by +noeh compiler option if desired.
# define GTEST_HAS_EXCEPTIONS 1
# else
# else
// For other compilers, we assume exceptions are disabled to be
// For other compilers, we assume exceptions are disabled to be
// conservative.
// conservative.
...
@@ -408,7 +415,7 @@
...
@@ -408,7 +415,7 @@
//
//
// To disable threading support in Google Test, add -DGTEST_HAS_PTHREAD=0
// To disable threading support in Google Test, add -DGTEST_HAS_PTHREAD=0
// to your compiler flags.
// to your compiler flags.
# define GTEST_HAS_PTHREAD (GTEST_OS_LINUX || GTEST_OS_MAC)
# define GTEST_HAS_PTHREAD (GTEST_OS_LINUX || GTEST_OS_MAC
|| GTEST_OS_HPUX
)
#endif // GTEST_HAS_PTHREAD
#endif // GTEST_HAS_PTHREAD
#if GTEST_HAS_PTHREAD
#if GTEST_HAS_PTHREAD
...
@@ -531,7 +538,7 @@
...
@@ -531,7 +538,7 @@
// pops up a dialog window that cannot be suppressed programmatically.
// pops up a dialog window that cannot be suppressed programmatically.
#if (GTEST_OS_LINUX || GTEST_OS_MAC || GTEST_OS_CYGWIN || GTEST_OS_SOLARIS || \
#if (GTEST_OS_LINUX || GTEST_OS_MAC || GTEST_OS_CYGWIN || GTEST_OS_SOLARIS || \
(GTEST_OS_WINDOWS_DESKTOP && _MSC_VER >= 1400) || \
(GTEST_OS_WINDOWS_DESKTOP && _MSC_VER >= 1400) || \
GTEST_OS_WINDOWS_MINGW || GTEST_OS_AIX)
GTEST_OS_WINDOWS_MINGW || GTEST_OS_AIX
|| GTEST_OS_HPUX
)
# define GTEST_HAS_DEATH_TEST 1
# define GTEST_HAS_DEATH_TEST 1
# include <vector> // NOLINT
# include <vector> // NOLINT
#endif
#endif
...
@@ -544,9 +551,9 @@
...
@@ -544,9 +551,9 @@
// Determines whether to support type-driven tests.
// Determines whether to support type-driven tests.
// Typed tests need <typeinfo> and variadic macros, which GCC, VC++ 8.0,
// Typed tests need <typeinfo> and variadic macros, which GCC, VC++ 8.0,
// Sun Pro CC,
and IBM Visual Age
support.
// Sun Pro CC,
IBM Visual Age, and HP aCC
support.
#if defined(__GNUC__) || (_MSC_VER >= 1400) || defined(__SUNPRO_CC) || \
#if defined(__GNUC__) || (_MSC_VER >= 1400) || defined(__SUNPRO_CC) || \
defined(__IBMCPP__)
defined(__IBMCPP__)
|| defined(__HP_aCC)
# define GTEST_HAS_TYPED_TEST 1
# define GTEST_HAS_TYPED_TEST 1
# define GTEST_HAS_TYPED_TEST_P 1
# define GTEST_HAS_TYPED_TEST_P 1
#endif
#endif
...
...
include/gtest/internal/gtest-type-util.h
View file @
741d6c0d
...
@@ -51,6 +51,8 @@
...
@@ -51,6 +51,8 @@
// libstdc++ (which is where cxxabi.h comes from).
// libstdc++ (which is where cxxabi.h comes from).
# ifdef __GLIBCXX__
# ifdef __GLIBCXX__
# include <cxxabi.h>
# include <cxxabi.h>
# elif defined(__HP_aCC)
# include <acxx_demangle.h>
# endif // __GLIBCXX__
# endif // __GLIBCXX__
namespace
testing
{
namespace
testing
{
...
@@ -64,17 +66,20 @@ String GetTypeName() {
...
@@ -64,17 +66,20 @@ String GetTypeName() {
# if GTEST_HAS_RTTI
# if GTEST_HAS_RTTI
const
char
*
const
name
=
typeid
(
T
).
name
();
const
char
*
const
name
=
typeid
(
T
).
name
();
# if
def __GLIBCXX__
# if
defined(__GLIBCXX__) || defined(__HP_aCC)
int
status
=
0
;
int
status
=
0
;
// gcc's implementation of typeid(T).name() mangles the type name,
// gcc's implementation of typeid(T).name() mangles the type name,
// so we have to demangle it.
// so we have to demangle it.
char
*
const
readable_name
=
abi
::
__cxa_demangle
(
name
,
0
,
0
,
&
status
);
# ifdef __GLIBCXX__
using
abi
::
__cxa_demangle
;
# endif // __GLIBCXX__
char
*
const
readable_name
=
__cxa_demangle
(
name
,
0
,
0
,
&
status
);
const
String
name_str
(
status
==
0
?
readable_name
:
name
);
const
String
name_str
(
status
==
0
?
readable_name
:
name
);
free
(
readable_name
);
free
(
readable_name
);
return
name_str
;
return
name_str
;
# else
# else
return
name
;
return
name
;
# endif // __GLIBCXX__
# endif // __GLIBCXX__
|| __HP_aCC
# else
# else
...
...
include/gtest/internal/gtest-type-util.h.pump
View file @
741d6c0d
...
@@ -49,6 +49,8 @@ $var n = 50 $$ Maximum length of type lists we want to support.
...
@@ -49,6 +49,8 @@ $var n = 50 $$ Maximum length of type lists we want to support.
// libstdc++ (which is where cxxabi.h comes from).
// libstdc++ (which is where cxxabi.h comes from).
# ifdef __GLIBCXX__
# ifdef __GLIBCXX__
# include <cxxabi.h>
# include <cxxabi.h>
# elif defined(__HP_aCC)
# include <acxx_demangle.h>
# endif // __GLIBCXX__
# endif // __GLIBCXX__
namespace
testing
{
namespace
testing
{
...
@@ -62,17 +64,20 @@ String GetTypeName() {
...
@@ -62,17 +64,20 @@ String GetTypeName() {
# if GTEST_HAS_RTTI
# if GTEST_HAS_RTTI
const
char
*
const
name
=
typeid
(
T
).
name
();
const
char
*
const
name
=
typeid
(
T
).
name
();
# if
def __GLIBCXX__
# if
defined(__GLIBCXX__) || defined(__HP_aCC)
int
status
=
0
;
int
status
=
0
;
// gcc's implementation of typeid(T).name() mangles the type name,
// gcc's implementation of typeid(T).name() mangles the type name,
// so we have to demangle it.
// so we have to demangle it.
char
*
const
readable_name
=
abi
::
__cxa_demangle
(
name
,
0
,
0
,
&
status
);
# ifdef __GLIBCXX__
using
abi
::
__cxa_demangle
;
# endif // __GLIBCXX__
char
*
const
readable_name
=
__cxa_demangle
(
name
,
0
,
0
,
&
status
);
const
String
name_str
(
status
==
0
?
readable_name
:
name
);
const
String
name_str
(
status
==
0
?
readable_name
:
name
);
free
(
readable_name
);
free
(
readable_name
);
return
name_str
;
return
name_str
;
# else
# else
return
name
;
return
name
;
# endif // __GLIBCXX__
# endif // __GLIBCXX__
|| __HP_aCC
# else
# else
...
...
src/gtest.cc
View file @
741d6c0d
...
@@ -2059,7 +2059,7 @@ class GoogleTestFailureException : public ::std::runtime_error {
...
@@ -2059,7 +2059,7 @@ class GoogleTestFailureException : public ::std::runtime_error {
#endif // GTEST_HAS_EXCEPTIONS
#endif // GTEST_HAS_EXCEPTIONS
namespace
internal
{
namespace
internal
{
// We put these helper functions in the internal namespace as IBM's x
IC_r
// We put these helper functions in the internal namespace as IBM's x
lC
// compiler rejects the code if they were declared static.
// compiler rejects the code if they were declared static.
// Runs the given method and handles SEH exceptions it throws, when
// Runs the given method and handles SEH exceptions it throws, when
...
...
test/gtest_unittest.cc
View file @
741d6c0d
...
@@ -3824,8 +3824,8 @@ TEST(AssertionTest, NamedEnum) {
...
@@ -3824,8 +3824,8 @@ TEST(AssertionTest, NamedEnum) {
// The version of gcc used in XCode 2.2 has a bug and doesn't allow
// The version of gcc used in XCode 2.2 has a bug and doesn't allow
// anonymous enums in assertions. Therefore the following test is not
// anonymous enums in assertions. Therefore the following test is not
// done on Mac.
// done on Mac.
// Sun Studio a
lso rejects
this code.
// Sun Studio a
nd HP aCC also reject
this code.
#if !GTEST_OS_MAC && !defined(__SUNPRO_CC)
#if !GTEST_OS_MAC && !defined(__SUNPRO_CC)
&& !defined(__HP_aCC)
// Tests using assertions with anonymous enums.
// Tests using assertions with anonymous enums.
enum
{
enum
{
...
...
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