proxygen
testing::internal::posix Namespace Reference

Typedefs

typedef struct stat StatStruct
 

Functions

int FileNo (FILE *file)
 
int IsATTY (int fd)
 
int Stat (const char *path, StatStruct *buf)
 
int StrCaseCmp (const char *s1, const char *s2)
 
char * StrDup (const char *src)
 
int RmDir (const char *dir)
 
bool IsDir (const StatStruct &st)
 
const char * StrNCpy (char *dest, const char *src, size_t n)
 
int ChDir (const char *dir)
 
FILEFOpen (const char *path, const char *mode)
 
FILEFReopen (const char *path, const char *mode, FILE *stream)
 
FILEFDOpen (int fd, const char *mode)
 
int FClose (FILE *fp)
 
int Read (int fd, void *buf, unsigned int count)
 
int Write (int fd, const void *buf, unsigned int count)
 
int Close (int fd)
 
const char * StrError (int errnum)
 
const char * GetEnv (const char *name)
 
void Abort ()
 

Typedef Documentation

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

Function Documentation

int testing::internal::posix::ChDir ( const char *  dir)
inline

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

2365 { return chdir(dir); }
int testing::internal::posix::Close ( int  fd)
inline

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

References folly::netops::close().

2384 { return close(fd); }
int close(NetworkSocket s)
Definition: NetOps.cpp:90
int testing::internal::posix::FClose ( FILE fp)
inline

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

Referenced by testing::internal::ParseGoogleTestFlag(), and testing::internal::GTestLog::~GTestLog().

2376 { return fclose(fp); }
FILE * testing::internal::posix::FDOpen ( int  fd,
const char *  mode 
)
inline

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

2374 { return fdopen(fd, mode); }
folly::Optional< PskKeyExchangeMode > mode
int testing::internal::posix::FileNo ( FILE file)
inline

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

Referenced by testing::internal::ColoredPrintf().

2340 { return fileno(file); }
FILE * testing::internal::posix::FReopen ( const char *  path,
const char *  mode,
FILE stream 
)
inline

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

Referenced by main().

2371  {
2372  return freopen(path, mode, stream);
2373 }
folly::Optional< PskKeyExchangeMode > mode
const char * testing::internal::posix::GetEnv ( const char *  name)
inline

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

References Abort(), GTEST_DISABLE_MSC_WARNINGS_POP_, and name.

Referenced by testing::internal::BoolFromGTestEnv(), testing::internal::FlagToEnvVar(), testing::internal::Int32FromEnvOrDie(), testing::internal::Int32FromGTestEnv(), main(), testing::internal::PrettyUnitTestResultPrinter::OnTestIterationStart(), testing::internal::PrettyUnitTestResultPrinter::OnTestProgramEnd(), testing::UnitTest::Run(), testing::internal::ShouldUseColor(), testing::internal::StringFromGTestEnv(), testing::internal::TearDownEnvironment(), testing::internal::TempDir(), testing::internal::WriteToShardStatusFileIfNeeded(), and testing::internal::ScopedPrematureExitFile::~ScopedPrematureExitFile().

2387  {
2388 #if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_WINDOWS_PHONE | GTEST_OS_WINDOWS_RT
2389  // We are on Windows CE, which has no environment variables.
2390  static_cast<void>(name); // To prevent 'unused argument' warning.
2391  return NULL;
2392 #elif defined(__BORLANDC__) || defined(__SunOS_5_8) || defined(__SunOS_5_9)
2393  // Environment variables which we programmatically clear will be set to the
2394  // empty string rather than unset (NULL). Handle that case.
2395  const char* const env = getenv(name);
2396  return (env != NULL && env[0] != '\0') ? env : NULL;
2397 #else
2398  return getenv(name);
2399 #endif
2400 }
const char * name
Definition: http_parser.c:437
int testing::internal::posix::IsATTY ( int  fd)
inline

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

Referenced by testing::internal::ColoredPrintf().

2341 { return isatty(fd); }
bool testing::internal::posix::IsDir ( const StatStruct st)
inline

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

References GTEST_DISABLE_MSC_WARNINGS_PUSH_.

Referenced by testing::internal::FilePath::DirectoryExists(), and testing::internal::IsPathSeparator().

2348 { return S_ISDIR(st.st_mode); }
int testing::internal::posix::Read ( int  fd,
void *  buf,
unsigned int  count 
)
inline

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

References fizz::detail::read().

2378  {
2379  return static_cast<int>(read(fd, buf, count));
2380 }
size_t read(T &out, folly::io::Cursor &cursor)
Definition: Types-inl.h:258
int * count
int testing::internal::posix::RmDir ( const char *  dir)
inline

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

Referenced by testing::TEST_F().

2347 { return rmdir(dir); }
int testing::internal::posix::Stat ( const char *  path,
StatStruct buf 
)
inline
int testing::internal::posix::StrCaseCmp ( const char *  s1,
const char *  s2 
)
inline

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

Referenced by testing::internal::String::CaseInsensitiveCStringEquals().

2343  {
2344  return strcasecmp(s1, s2);
2345 }
char * testing::internal::posix::StrDup ( const char *  src)
inline

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

Referenced by testing::internal::GetThreadCount().

2346 { return strdup(src); }
const char * testing::internal::posix::StrError ( int  errnum)
inline

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

2385 { return strerror(errnum); }
const char * testing::internal::posix::StrNCpy ( char *  dest,
const char *  src,
size_t  n 
)
inline

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

2356  {
2357  return strncpy(dest, src, n);
2358 }
dest
Definition: upload.py:394
int testing::internal::posix::Write ( int  fd,
const void *  buf,
unsigned int  count 
)
inline

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

References fizz::detail::write().

2381  {
2382  return static_cast<int>(write(fd, buf, count));
2383 }
void write(const T &in, folly::io::Appender &appender)
Definition: Types-inl.h:112
int * count