Sacado Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Namespaces | Macros | Typedefs | Enumerations | Functions | Variables
gtest-port.h File Reference
#include <ctype.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <cerrno>
#include <cstdint>
#include <limits>
#include <type_traits>
#include <sys/types.h>
#include <sys/stat.h>
#include <iostream>
#include <locale>
#include <memory>
#include <string>
#include <tuple>
#include <vector>
#include "gtest/internal/custom/gtest-port.h"
#include "gtest/internal/gtest-port-arch.h"
#include <unistd.h>
#include <strings.h>
#include <regex.h>
#include <typeinfo>
Include dependency graph for gtest-port.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  testing::internal::RE
 
class  testing::internal::GTestLog
 
struct  testing::internal::ConstRef< T >
 
struct  testing::internal::ConstRef< T & >
 
class  testing::internal::Mutex
 
class  testing::internal::GTestMutexLock
 
class  testing::internal::ThreadLocal< T >
 
class  testing::internal::TypeWithSize< size >
 
class  testing::internal::TypeWithSize< 4 >
 
class  testing::internal::TypeWithSize< 8 >
 

Namespaces

 testing
 
 testing::internal
 
 testing::internal::posix
 

Macros

#define GTEST_DEV_EMAIL_   "googletestframework@@googlegroups.com"
 
#define GTEST_FLAG_PREFIX_   "gtest_"
 
#define GTEST_FLAG_PREFIX_DASH_   "gtest-"
 
#define GTEST_FLAG_PREFIX_UPPER_   "GTEST_"
 
#define GTEST_NAME_   "Google Test"
 
#define GTEST_PROJECT_URL_   "https://github.com/google/googletest/"
 
#define GTEST_INIT_GOOGLE_TEST_NAME_   "testing::InitGoogleTest"
 
#define GTEST_DISABLE_MSC_WARNINGS_PUSH_(warnings)
 
#define GTEST_DISABLE_MSC_WARNINGS_POP_()
 
#define GTEST_DISABLE_MSC_DEPRECATED_PUSH_()   GTEST_DISABLE_MSC_WARNINGS_PUSH_(4996)
 
#define GTEST_DISABLE_MSC_DEPRECATED_POP_()   GTEST_DISABLE_MSC_WARNINGS_POP_()
 
#define GTEST_HAS_POSIX_RE   (!GTEST_OS_WINDOWS)
 
#define GTEST_USES_POSIX_RE   1
 
#define GTEST_HAS_EXCEPTIONS   0
 
#define GTEST_HAS_STD_WSTRING
 
#define GTEST_HAS_RTTI   1
 
#define GTEST_HAS_PTHREAD
 
#define GTEST_HAS_CLONE   0
 
#define GTEST_HAS_STREAM_REDIRECTION   1
 
#define GTEST_WIDE_STRING_USES_UTF16_   (GTEST_OS_WINDOWS || GTEST_OS_CYGWIN || GTEST_OS_AIX || GTEST_OS_OS2)
 
#define GTEST_AMBIGUOUS_ELSE_BLOCKER_   switch (0) case 0: default:
 
#define GTEST_ATTRIBUTE_UNUSED_
 
#define GTEST_ATTRIBUTE_PRINTF_(string_index, first_to_check)
 
#define GTEST_DISALLOW_ASSIGN_(type)   type& operator=(type const &) = delete
 
#define GTEST_DISALLOW_COPY_AND_ASSIGN_(type)
 
#define GTEST_DISALLOW_MOVE_ASSIGN_(type)   type& operator=(type &&) noexcept = delete
 
#define GTEST_DISALLOW_MOVE_AND_ASSIGN_(type)
 
#define GTEST_MUST_USE_RESULT_
 
#define GTEST_INTENTIONAL_CONST_COND_PUSH_()   GTEST_DISABLE_MSC_WARNINGS_PUSH_(4127)
 
#define GTEST_INTENTIONAL_CONST_COND_POP_()   GTEST_DISABLE_MSC_WARNINGS_POP_()
 
#define GTEST_HAS_SEH   0
 
#define GTEST_IS_THREADSAFE
 
#define GTEST_API_
 
#define GTEST_DEFAULT_DEATH_TEST_STYLE   "fast"
 
#define GTEST_NO_INLINE_
 
#define GTEST_HAS_CXXABI_H_   0
 
#define GTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_
 
#define GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_
 
#define GTEST_ATTRIBUTE_NO_SANITIZE_HWADDRESS_
 
#define GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_
 
#define GTEST_COMPILE_ASSERT_(expr, msg)   static_assert(expr, #msg)
 
#define GTEST_LOG_(severity)
 
#define GTEST_CHECK_(condition)
 
#define GTEST_CHECK_POSIX_SUCCESS_(posix_call)
 
#define GTEST_REFERENCE_TO_CONST_(T)   typename ::testing::internal::ConstRef<T>::type
 
#define GTEST_DECLARE_STATIC_MUTEX_(mutex)   extern ::testing::internal::Mutex mutex
 
#define GTEST_DEFINE_STATIC_MUTEX_(mutex)   ::testing::internal::Mutex mutex
 
#define GTEST_PATH_SEP_   "/"
 
#define GTEST_HAS_ALT_PATH_SEP_   0
 
#define GTEST_SNPRINTF_   snprintf
 
#define GTEST_FLAG(name)   FLAGS_gtest_##name
 
#define GTEST_USE_OWN_FLAGFILE_FLAG_   1
 
#define GTEST_FLAG_SAVER_   ::testing::internal::GTestFlagSaver
 
#define GTEST_DECLARE_bool_(name)   GTEST_API_ extern bool GTEST_FLAG(name)
 
#define GTEST_DECLARE_int32_(name)   GTEST_API_ extern std::int32_t GTEST_FLAG(name)
 
#define GTEST_DECLARE_string_(name)   GTEST_API_ extern ::std::string GTEST_FLAG(name)
 
#define GTEST_DEFINE_bool_(name, default_val, doc)   GTEST_API_ bool GTEST_FLAG(name) = (default_val)
 
#define GTEST_DEFINE_int32_(name, default_val, doc)   GTEST_API_ std::int32_t GTEST_FLAG(name) = (default_val)
 
#define GTEST_DEFINE_string_(name, default_val, doc)   GTEST_API_ ::std::string GTEST_FLAG(name) = (default_val)
 
#define GTEST_EXCLUSIVE_LOCK_REQUIRED_(locks)
 
#define GTEST_LOCK_EXCLUDED_(locks)
 
#define GTEST_INTERNAL_DEPRECATED(message)
 

Typedefs

typedef GTestMutexLock testing::internal::MutexLock
 
typedef struct stat testing::internal::posix::StatStruct
 
using testing::internal::BiggestInt = long long
 
using testing::internal::TimeInMillis = int64_t
 

Enumerations

enum  testing::internal::GTestLogSeverity { testing::internal::GTEST_INFO, testing::internal::GTEST_WARNING, testing::internal::GTEST_ERROR, testing::internal::GTEST_FATAL }
 

Functions

GTEST_API_ bool testing::internal::IsTrue (bool condition)
 
GTEST_API_::std::string testing::internal::FormatFileLocation (const char *file, int line)
 
GTEST_API_::std::string testing::internal::FormatCompilerIndependentFileLocation (const char *file, int line)
 
void testing::internal::LogToStderr ()
 
void testing::internal::FlushInfoLog ()
 
template<typename To >
To testing::internal::ImplicitCast_ (To x)
 
template<typename To , typename From >
To testing::internal::DownCast_ (From *f)
 
template<class Derived , class Base >
Derived * testing::internal::CheckedDowncastToActualType (Base *base)
 
GTEST_API_ void testing::internal::CaptureStdout ()
 
GTEST_API_ std::string testing::internal::GetCapturedStdout ()
 
GTEST_API_ void testing::internal::CaptureStderr ()
 
GTEST_API_ std::string testing::internal::GetCapturedStderr ()
 
GTEST_API_ size_t testing::internal::GetFileSize (FILE *file)
 
GTEST_API_ std::string testing::internal::ReadEntireFile (FILE *file)
 
GTEST_API_ std::vector
< std::string > 
testing::internal::GetArgvs ()
 
GTEST_API_ size_t testing::internal::GetThreadCount ()
 
bool testing::internal::IsAlpha (char ch)
 
bool testing::internal::IsAlNum (char ch)
 
bool testing::internal::IsDigit (char ch)
 
bool testing::internal::IsLower (char ch)
 
bool testing::internal::IsSpace (char ch)
 
bool testing::internal::IsUpper (char ch)
 
bool testing::internal::IsXDigit (char ch)
 
bool testing::internal::IsXDigit (wchar_t ch)
 
char testing::internal::ToLower (char ch)
 
char testing::internal::ToUpper (char ch)
 
std::string testing::internal::StripTrailingSpaces (std::string str)
 
int testing::internal::posix::FileNo (FILE *file)
 
int testing::internal::posix::DoIsATTY (int fd)
 
int testing::internal::posix::Stat (const char *path, StatStruct *buf)
 
int testing::internal::posix::StrCaseCmp (const char *s1, const char *s2)
 
char * testing::internal::posix::StrDup (const char *src)
 
int testing::internal::posix::RmDir (const char *dir)
 
bool testing::internal::posix::IsDir (const StatStruct &st)
 
int testing::internal::posix::IsATTY (int fd)
 
int testing::internal::posix::ChDir (const char *dir)
 
FILE * testing::internal::posix::FOpen (const char *path, const char *mode)
 
FILE * testing::internal::posix::FReopen (const char *path, const char *mode, FILE *stream)
 
FILE * testing::internal::posix::FDOpen (int fd, const char *mode)
 
int testing::internal::posix::FClose (FILE *fp)
 
int testing::internal::posix::Read (int fd, void *buf, unsigned int count)
 
int testing::internal::posix::Write (int fd, const void *buf, unsigned int count)
 
int testing::internal::posix::Close (int fd)
 
const char * testing::internal::posix::StrError (int errnum)
 
const char * testing::internal::posix::GetEnv (const char *name)
 
void testing::internal::posix::Abort ()
 
GTEST_API_ bool testing::internal::ParseInt32 (const Message &src_text, const char *str, int32_t *value)
 
bool testing::internal::BoolFromGTestEnv (const char *flag, bool default_val)
 
GTEST_API_ int32_t testing::internal::Int32FromGTestEnv (const char *flag, int32_t default_val)
 
std::string testing::internal::OutputFlagAlsoCheckEnvVar ()
 
const char * testing::internal::StringFromGTestEnv (const char *flag, const char *default_val)
 

Variables

constexpr BiggestInt testing::internal::kMaxBiggestInt = (std::numeric_limits<BiggestInt>::max)()
 

Macro Definition Documentation

#define GTEST_DEV_EMAIL_   "googletestframework@@googlegroups.com"

Definition at line 291 of file gtest-port.h.

#define GTEST_FLAG_PREFIX_   "gtest_"

Definition at line 292 of file gtest-port.h.

#define GTEST_FLAG_PREFIX_DASH_   "gtest-"

Definition at line 293 of file gtest-port.h.

#define GTEST_FLAG_PREFIX_UPPER_   "GTEST_"

Definition at line 294 of file gtest-port.h.

#define GTEST_NAME_   "Google Test"

Definition at line 295 of file gtest-port.h.

#define GTEST_PROJECT_URL_   "https://github.com/google/googletest/"

Definition at line 296 of file gtest-port.h.

#define GTEST_INIT_GOOGLE_TEST_NAME_   "testing::InitGoogleTest"

Definition at line 300 of file gtest-port.h.

#define GTEST_DISABLE_MSC_WARNINGS_PUSH_ (   warnings)

Definition at line 323 of file gtest-port.h.

#define GTEST_DISABLE_MSC_WARNINGS_POP_ ( )

Definition at line 324 of file gtest-port.h.

#define GTEST_DISABLE_MSC_DEPRECATED_PUSH_ ( )    GTEST_DISABLE_MSC_WARNINGS_PUSH_(4996)

Definition at line 337 of file gtest-port.h.

#define GTEST_DISABLE_MSC_DEPRECATED_POP_ ( )    GTEST_DISABLE_MSC_WARNINGS_POP_()

Definition at line 339 of file gtest-port.h.

#define GTEST_HAS_POSIX_RE   (!GTEST_OS_WINDOWS)

Definition at line 382 of file gtest-port.h.

#define GTEST_USES_POSIX_RE   1

Definition at line 397 of file gtest-port.h.

#define GTEST_HAS_EXCEPTIONS   0

Definition at line 455 of file gtest-port.h.

#define GTEST_HAS_STD_WSTRING
Value:
(!(GTEST_OS_LINUX_ANDROID || GTEST_OS_CYGWIN || GTEST_OS_SOLARIS || \
GTEST_OS_HAIKU || GTEST_OS_ESP32 || GTEST_OS_ESP8266))

Definition at line 465 of file gtest-port.h.

#define GTEST_HAS_RTTI   1

Definition at line 523 of file gtest-port.h.

#define GTEST_HAS_PTHREAD
Value:
(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_DRAGONFLY || GTEST_OS_GNU_KFREEBSD || GTEST_OS_OPENBSD || \
GTEST_OS_HAIKU)

Definition at line 542 of file gtest-port.h.

#define GTEST_HAS_CLONE   0

Definition at line 581 of file gtest-port.h.

#define GTEST_HAS_STREAM_REDIRECTION   1

Definition at line 595 of file gtest-port.h.

#define GTEST_WIDE_STRING_USES_UTF16_   (GTEST_OS_WINDOWS || GTEST_OS_CYGWIN || GTEST_OS_AIX || GTEST_OS_OS2)

Definition at line 621 of file gtest-port.h.

#define GTEST_AMBIGUOUS_ELSE_BLOCKER_   switch (0) case 0: default:

Definition at line 643 of file gtest-port.h.

static bool dummy2 GTEST_ATTRIBUTE_UNUSED_
Value:
=
StaticAssertTypeEq<const int, const int>()

Definition at line 665 of file gtest-port.h.

#define GTEST_ATTRIBUTE_PRINTF_ (   string_index,
  first_to_check 
)

Definition at line 682 of file gtest-port.h.

#define GTEST_DISALLOW_ASSIGN_ (   type)    type& operator=(type const &) = delete

Definition at line 688 of file gtest-port.h.

#define GTEST_DISALLOW_COPY_AND_ASSIGN_ (   type)
Value:
type(type const&) = delete; \
type& operator=(type const&) = delete

Definition at line 693 of file gtest-port.h.

#define GTEST_DISALLOW_MOVE_ASSIGN_ (   type)    type& operator=(type &&) noexcept = delete

Definition at line 699 of file gtest-port.h.

#define GTEST_DISALLOW_MOVE_AND_ASSIGN_ (   type)
Value:
type(type&&) noexcept = delete; \
type& operator=(type&&) noexcept = delete

Definition at line 704 of file gtest-port.h.

#define GTEST_MUST_USE_RESULT_

Definition at line 716 of file gtest-port.h.

#define GTEST_INTENTIONAL_CONST_COND_PUSH_ ( )    GTEST_DISABLE_MSC_WARNINGS_PUSH_(4127)

Definition at line 727 of file gtest-port.h.

#define GTEST_INTENTIONAL_CONST_COND_POP_ ( )    GTEST_DISABLE_MSC_WARNINGS_POP_()

Definition at line 729 of file gtest-port.h.

#define GTEST_HAS_SEH   0

Definition at line 743 of file gtest-port.h.

#define GTEST_IS_THREADSAFE
Value:
(GTEST_HAS_MUTEX_AND_THREAD_LOCAL_ || \
(GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_PHONE && !GTEST_OS_WINDOWS_RT) || \
#define GTEST_HAS_PTHREAD
Definition: gtest-port.h:542

Definition at line 750 of file gtest-port.h.

#define GTEST_API_

Definition at line 775 of file gtest-port.h.

#define GTEST_DEFAULT_DEATH_TEST_STYLE   "fast"

Definition at line 779 of file gtest-port.h.

#define GTEST_NO_INLINE_

Definition at line 786 of file gtest-port.h.

#define GTEST_HAS_CXXABI_H_   0

Definition at line 794 of file gtest-port.h.

#define GTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_

Definition at line 808 of file gtest-port.h.

#define GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_

Definition at line 820 of file gtest-port.h.

#define GTEST_ATTRIBUTE_NO_SANITIZE_HWADDRESS_

Definition at line 832 of file gtest-port.h.

#define GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_

Definition at line 844 of file gtest-port.h.

#define GTEST_COMPILE_ASSERT_ (   expr,
  msg 
)    static_assert(expr, #msg)

Definition at line 875 of file gtest-port.h.

#define GTEST_LOG_ (   severity)
Value:
::testing::internal::GTestLog(::testing::internal::GTEST_##severity, \
__FILE__, __LINE__).GetStream()
::std::ostream & GetStream()
Definition: gtest-port.h:970

Definition at line 980 of file gtest-port.h.

#define GTEST_CHECK_ (   condition)
Value:
; \
GTEST_LOG_(FATAL) << "Condition " #condition " failed. "
GTEST_API_ bool IsTrue(bool condition)
Definition: gtest.cc:6105
#define GTEST_LOG_(severity)
Definition: gtest-port.h:980
if(first)
Definition: uninit.c:101

Definition at line 1004 of file gtest-port.h.

#define GTEST_CHECK_POSIX_SUCCESS_ (   posix_call)
Value:
if (const int gtest_error = (posix_call)) \
GTEST_LOG_(FATAL) << #posix_call << "failed with error " \
<< gtest_error
#define GTEST_LOG_(severity)
Definition: gtest-port.h:980

Definition at line 1017 of file gtest-port.h.

#define GTEST_REFERENCE_TO_CONST_ (   T)    typename ::testing::internal::ConstRef<T>::type

Definition at line 1039 of file gtest-port.h.

#define GTEST_DECLARE_STATIC_MUTEX_ (   mutex)    extern ::testing::internal::Mutex mutex

Definition at line 1867 of file gtest-port.h.

#define GTEST_DEFINE_STATIC_MUTEX_ (   mutex)    ::testing::internal::Mutex mutex

Definition at line 1870 of file gtest-port.h.

#define GTEST_PATH_SEP_   "/"

Definition at line 1907 of file gtest-port.h.

#define GTEST_HAS_ALT_PATH_SEP_   0

Definition at line 1908 of file gtest-port.h.

#define GTEST_SNPRINTF_   snprintf

Definition at line 2127 of file gtest-port.h.

#define GTEST_FLAG (   name)    FLAGS_gtest_##name

Definition at line 2187 of file gtest-port.h.

#define GTEST_USE_OWN_FLAGFILE_FLAG_   1

Definition at line 2191 of file gtest-port.h.

#define GTEST_FLAG_SAVER_   ::testing::internal::GTestFlagSaver

Definition at line 2195 of file gtest-port.h.

#define GTEST_DECLARE_bool_ (   name)    GTEST_API_ extern bool GTEST_FLAG(name)

Definition at line 2198 of file gtest-port.h.

#define GTEST_DECLARE_int32_ (   name)    GTEST_API_ extern std::int32_t GTEST_FLAG(name)

Definition at line 2199 of file gtest-port.h.

#define GTEST_DECLARE_string_ (   name)    GTEST_API_ extern ::std::string GTEST_FLAG(name)

Definition at line 2201 of file gtest-port.h.

#define GTEST_DEFINE_bool_ (   name,
  default_val,
  doc 
)    GTEST_API_ bool GTEST_FLAG(name) = (default_val)

Definition at line 2205 of file gtest-port.h.

#define GTEST_DEFINE_int32_ (   name,
  default_val,
  doc 
)    GTEST_API_ std::int32_t GTEST_FLAG(name) = (default_val)

Definition at line 2207 of file gtest-port.h.

#define GTEST_DEFINE_string_ (   name,
  default_val,
  doc 
)    GTEST_API_ ::std::string GTEST_FLAG(name) = (default_val)

Definition at line 2209 of file gtest-port.h.

#define GTEST_EXCLUSIVE_LOCK_REQUIRED_ (   locks)

Definition at line 2216 of file gtest-port.h.

#define GTEST_LOCK_EXCLUDED_ (   locks)

Definition at line 2217 of file gtest-port.h.

#define GTEST_INTERNAL_DEPRECATED (   message)

Definition at line 2251 of file gtest-port.h.