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 <ciso646>
#include <ctype.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <cerrno>
#include <cstdint>
#include <iostream>
#include <limits>
#include <locale>
#include <memory>
#include <ostream>
#include <string>
#include <tuple>
#include <type_traits>
#include <vector>
#include <sys/stat.h>
#include <sys/types.h>
#include "gtest/internal/custom/gtest-port.h"
#include "gtest/internal/gtest-port-arch.h"
#include <strings.h>
#include <unistd.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::Secret
 
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_INTERNAL_HAS_INCLUDE(...)   0
 
#define GTEST_HAS_MUTEX_AND_THREAD_LOCAL_   0
 
#define GTEST_HAS_NOTIFICATION_   0
 
#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   1
 
#define GTEST_USES_POSIX_RE   1
 
#define GTEST_HAS_EXCEPTIONS   0
 
#define GTEST_HAS_STD_WSTRING   1
 
#define GTEST_HAS_FILE_SYSTEM   1
 
#define GTEST_HAS_RTTI   1
 
#define GTEST_HAS_PTHREAD   0
 
#define GTEST_HAS_CLONE   0
 
#define GTEST_HAS_STREAM_REDIRECTION   1
 
#define GTEST_WIDE_STRING_USES_UTF16_   0
 
#define GTEST_CAN_STREAM_RESULTS_   0
 
#define GTEST_AMBIGUOUS_ELSE_BLOCKER_
 
#define GTEST_HAVE_ATTRIBUTE_(x)   0
 
#define GTEST_INTERNAL_HAVE_CPP_ATTRIBUTE(x)   0
 
#define GTEST_HAVE_FEATURE_(x)   0
 
#define GTEST_INTERNAL_ATTRIBUTE_MAYBE_UNUSED
 
#define GTEST_ATTRIBUTE_PRINTF_(string_index, first_to_check)
 
#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_API_
 
#define GTEST_DEFAULT_DEATH_TEST_STYLE   "fast"
 
#define GTEST_NO_INLINE_
 
#define GTEST_NO_TAIL_CALL_
 
#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_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_(name)   gtest_##name
 
#define GTEST_FLAG(name)   FLAGS_gtest_##name
 
#define GTEST_DEFINE_bool_(name, default_val, doc)
 
#define GTEST_DEFINE_int32_(name, default_val, doc)
 
#define GTEST_DEFINE_string_(name, default_val, doc)
 
#define GTEST_DECLARE_bool_(name)
 
#define GTEST_DECLARE_int32_(name)
 
#define GTEST_DECLARE_string_(name)
 
#define GTEST_FLAG_SAVER_   ::testing::internal::GTestFlagSaver
 
#define GTEST_FLAG_GET(name)   ::testing::GTEST_FLAG(name)
 
#define GTEST_FLAG_SET(name, value)   (void)(::testing::GTEST_FLAG(name) = value)
 
#define GTEST_USE_OWN_FLAGFILE_FLAG_   1
 
#define GTEST_EXCLUSIVE_LOCK_REQUIRED_(locks)
 
#define GTEST_LOCK_EXCLUDED_(locks)
 
#define GTEST_INTERNAL_DEPRECATED(message)
 
#define GTEST_INTERNAL_HAS_ANY   0
 
#define GTEST_INTERNAL_HAS_OPTIONAL   0
 
#define GTEST_INTERNAL_HAS_STD_SPAN   0
 
#define GTEST_INTERNAL_HAS_STRING_VIEW   0
 
#define GTEST_INTERNAL_HAS_VARIANT   0
 
#define GTEST_INTERNAL_HAS_COMPARE_LIB   0
 

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)
 
 testing::internal::GTEST_DISABLE_MSC_WARNINGS_PUSH_ (4251) class GTEST_API_ TypedTestSuitePState
 
GTEST_DISABLE_MSC_WARNINGS_POP_()
GTEST_API_
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<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 (char16_t ch)
 
bool testing::internal::IsXDigit (char32_t 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::Stat (const char *path, StatStruct *buf)
 
int testing::internal::posix::RmDir (const char *dir)
 
bool testing::internal::posix::IsDir (const StatStruct &st)
 
int testing::internal::posix::DoIsATTY (int fd)
 
int testing::internal::posix::StrCaseCmp (const char *s1, const char *s2)
 
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_INTERNAL_HAS_INCLUDE (   ...)    0

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

#define GTEST_HAS_MUTEX_AND_THREAD_LOCAL_   0

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

#define GTEST_HAS_NOTIFICATION_   0

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

#define GTEST_DEV_EMAIL_   "googletestframework@@googlegroups.com"

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

#define GTEST_FLAG_PREFIX_   "gtest_"

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

#define GTEST_FLAG_PREFIX_DASH_   "gtest-"

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

#define GTEST_FLAG_PREFIX_UPPER_   "GTEST_"

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

#define GTEST_NAME_   "Google Test"

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

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

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

#define GTEST_INIT_GOOGLE_TEST_NAME_   "testing::InitGoogleTest"

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

#define GTEST_DISABLE_MSC_WARNINGS_PUSH_ (   warnings)

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

#define GTEST_DISABLE_MSC_WARNINGS_POP_ ( )

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

#define GTEST_DISABLE_MSC_DEPRECATED_PUSH_ ( )    GTEST_DISABLE_MSC_WARNINGS_PUSH_(4996)

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

#define GTEST_DISABLE_MSC_DEPRECATED_POP_ ( )    GTEST_DISABLE_MSC_WARNINGS_POP_()

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

#define GTEST_HAS_POSIX_RE   1

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

#define GTEST_USES_POSIX_RE   1

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

#define GTEST_HAS_EXCEPTIONS   0

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

#define GTEST_HAS_STD_WSTRING   1

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

#define GTEST_HAS_FILE_SYSTEM   1

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

#define GTEST_HAS_RTTI   1

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

#define GTEST_HAS_PTHREAD   0

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

#define GTEST_HAS_CLONE   0

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

#define GTEST_HAS_STREAM_REDIRECTION   1

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

#define GTEST_WIDE_STRING_USES_UTF16_   0

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

#define GTEST_CAN_STREAM_RESULTS_   0

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

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

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

#define GTEST_HAVE_ATTRIBUTE_ (   x)    0

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

#define GTEST_INTERNAL_HAVE_CPP_ATTRIBUTE (   x)    0

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

#define GTEST_HAVE_FEATURE_ (   x)    0

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

#define GTEST_INTERNAL_ATTRIBUTE_MAYBE_UNUSED

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

#define GTEST_ATTRIBUTE_PRINTF_ (   string_index,
  first_to_check 
)

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

#define GTEST_MUST_USE_RESULT_

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

#define GTEST_INTENTIONAL_CONST_COND_PUSH_ ( )    GTEST_DISABLE_MSC_WARNINGS_PUSH_(4127)

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

#define GTEST_INTENTIONAL_CONST_COND_POP_ ( )    GTEST_DISABLE_MSC_WARNINGS_POP_()

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

#define GTEST_HAS_SEH   0

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

#define GTEST_API_

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

#define GTEST_DEFAULT_DEATH_TEST_STYLE   "fast"

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

#define GTEST_NO_INLINE_

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

#define GTEST_NO_TAIL_CALL_

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

#define GTEST_HAS_CXXABI_H_   0

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

#define GTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_

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

#define GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_

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

#define GTEST_ATTRIBUTE_NO_SANITIZE_HWADDRESS_

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

#define GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_

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

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

Definition at line 1093 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:6399
#define GTEST_LOG_(severity)
Definition: gtest-port.h:1093
if(first)
Definition: uninit.c:110

Definition at line 1118 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:1093

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

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

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

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

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

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

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

#define GTEST_PATH_SEP_   "/"

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

#define GTEST_HAS_ALT_PATH_SEP_   0

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

#define GTEST_SNPRINTF_   snprintf

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

#define GTEST_FLAG_NAME_ (   name)    gtest_##name

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

#define GTEST_FLAG (   name)    FLAGS_gtest_##name

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

#define GTEST_DEFINE_bool_ (   name,
  default_val,
  doc 
)
Value:
namespace testing { \
GTEST_API_ bool GTEST_FLAG(name) = (default_val); \
} \
static_assert(true, "no-op to require trailing semicolon")
#define GTEST_API_
Definition: gtest-port.h:882
#define GTEST_FLAG(name)
Definition: gtest-port.h:2274

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

#define GTEST_DEFINE_int32_ (   name,
  default_val,
  doc 
)
Value:
namespace testing { \
GTEST_API_ std::int32_t GTEST_FLAG(name) = (default_val); \
} \
static_assert(true, "no-op to require trailing semicolon")
#define GTEST_API_
Definition: gtest-port.h:882
#define GTEST_FLAG(name)
Definition: gtest-port.h:2274

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

#define GTEST_DEFINE_string_ (   name,
  default_val,
  doc 
)
Value:
namespace testing { \
GTEST_API_ ::std::string GTEST_FLAG(name) = (default_val); \
} \
static_assert(true, "no-op to require trailing semicolon")
#define GTEST_FLAG(name)
Definition: gtest-port.h:2274

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

#define GTEST_DECLARE_bool_ (   name)
Value:
namespace testing { \
GTEST_API_ extern bool GTEST_FLAG(name); \
} \
static_assert(true, "no-op to require trailing semicolon")
#define GTEST_API_
Definition: gtest-port.h:882
#define GTEST_FLAG(name)
Definition: gtest-port.h:2274

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

#define GTEST_DECLARE_int32_ (   name)
Value:
namespace testing { \
GTEST_API_ extern std::int32_t GTEST_FLAG(name); \
} \
static_assert(true, "no-op to require trailing semicolon")
#define GTEST_API_
Definition: gtest-port.h:882
#define GTEST_FLAG(name)
Definition: gtest-port.h:2274

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

#define GTEST_DECLARE_string_ (   name)
Value:
namespace testing { \
GTEST_API_ extern ::std::string GTEST_FLAG(name); \
} \
static_assert(true, "no-op to require trailing semicolon")
#define GTEST_API_
Definition: gtest-port.h:882
#define GTEST_FLAG(name)
Definition: gtest-port.h:2274

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

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

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

#define GTEST_FLAG_GET (   name)    ::testing::GTEST_FLAG(name)

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

#define GTEST_FLAG_SET (   name,
  value 
)    (void)(::testing::GTEST_FLAG(name) = value)

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

#define GTEST_USE_OWN_FLAGFILE_FLAG_   1

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

#define GTEST_EXCLUSIVE_LOCK_REQUIRED_ (   locks)

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

#define GTEST_LOCK_EXCLUDED_ (   locks)

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

#define GTEST_INTERNAL_DEPRECATED (   message)

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

#define GTEST_INTERNAL_HAS_ANY   0

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

#define GTEST_INTERNAL_HAS_OPTIONAL   0

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

#define GTEST_INTERNAL_HAS_STD_SPAN   0

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

#define GTEST_INTERNAL_HAS_STRING_VIEW   0

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

#define GTEST_INTERNAL_HAS_VARIANT   0

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

#define GTEST_INTERNAL_HAS_COMPARE_LIB   0

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