proxygen
testing::InitGoogleTestTest Class Reference
Inheritance diagram for testing::InitGoogleTestTest:
testing::Test testing::Test testing::Test

Protected Member Functions

virtual void SetUp ()
 
virtual void SetUp ()
 
virtual void SetUp ()
 
- Protected Member Functions inherited from testing::Test
 Test ()
 
virtual void TearDown ()
 
 Test ()
 
virtual void TearDown ()
 
 Test ()
 
virtual void TearDown ()
 

Static Protected Member Functions

template<typename CharType >
static void AssertStringArrayEq (size_t size1, CharType **array1, size_t size2, CharType **array2)
 
static void CheckFlags (const Flags &expected)
 
template<typename CharType >
static void TestParsingFlags (int argc1, const CharType **argv1, int argc2, const CharType **argv2, const Flags &expected, bool should_print_help)
 
template<typename CharType >
static void AssertStringArrayEq (size_t size1, CharType **array1, size_t size2, CharType **array2)
 
static void CheckFlags (const Flags &expected)
 
template<typename CharType >
static void TestParsingFlags (int argc1, const CharType **argv1, int argc2, const CharType **argv2, const Flags &expected, bool should_print_help)
 
template<typename CharType >
static void AssertStringArrayEq (size_t size1, CharType **array1, size_t size2, CharType **array2)
 
static void CheckFlags (const Flags &expected)
 
template<typename CharType >
static void TestParsingFlags (int argc1, const CharType **argv1, int argc2, const CharType **argv2, const Flags &expected, bool should_print_help)
 

Additional Inherited Members

- Public Types inherited from testing::Test
typedef internal::SetUpTestCaseFunc SetUpTestCaseFunc
 
typedef internal::TearDownTestCaseFunc TearDownTestCaseFunc
 
typedef internal::SetUpTestCaseFunc SetUpTestCaseFunc
 
typedef internal::TearDownTestCaseFunc TearDownTestCaseFunc
 
typedef internal::SetUpTestCaseFunc SetUpTestCaseFunc
 
typedef internal::TearDownTestCaseFunc TearDownTestCaseFunc
 
- Public Member Functions inherited from testing::Test
virtual ~Test ()
 
virtual ~Test ()
 
virtual ~Test ()
 
- Static Public Member Functions inherited from testing::Test
static void SetUpTestCase ()
 
static void TearDownTestCase ()
 
static bool HasFatalFailure ()
 
static bool HasNonfatalFailure ()
 
static bool HasFailure ()
 
static void RecordProperty (const std::string &key, const std::string &value)
 
static void RecordProperty (const std::string &key, int value)
 
static void SetUpTestCase ()
 
static void TearDownTestCase ()
 
static bool HasFatalFailure ()
 
static bool HasNonfatalFailure ()
 
static bool HasFailure ()
 
static void RecordProperty (const std::string &key, const std::string &value)
 
static void RecordProperty (const std::string &key, int value)
 
static void SetUpTestCase ()
 
static void TearDownTestCase ()
 
static bool HasFatalFailure ()
 
static bool HasNonfatalFailure ()
 
static bool HasFailure ()
 
static void RecordProperty (const std::string &key, const std::string &value)
 
static void RecordProperty (const std::string &key, int value)
 

Detailed Description

Definition at line 5605 of file gtest_unittest.cc.

Member Function Documentation

template<typename CharType >
static void testing::InitGoogleTestTest::AssertStringArrayEq ( size_t  size1,
CharType **  array1,
size_t  size2,
CharType **  array2 
)
inlinestaticprotected

Definition at line 5627 of file gtest_unittest.cc.

References ASSERT_EQ, ASSERT_STREQ, and i.

5628  {
5629  ASSERT_EQ(size1, size2) << " Array sizes different.";
5630 
5631  for (size_t i = 0; i != size1; i++) {
5632  ASSERT_STREQ(array1[i], array2[i]) << " where i == " << i;
5633  }
5634  }
#define ASSERT_STREQ(s1, s2)
Definition: gtest.h:2004
#define ASSERT_EQ(val1, val2)
Definition: gtest.h:1956
template<typename CharType >
static void testing::InitGoogleTestTest::AssertStringArrayEq ( size_t  size1,
CharType **  array1,
size_t  size2,
CharType **  array2 
)
inlinestaticprotected

Definition at line 5627 of file gtest_unittest.cc.

References ASSERT_EQ, ASSERT_STREQ, and i.

5628  {
5629  ASSERT_EQ(size1, size2) << " Array sizes different.";
5630 
5631  for (size_t i = 0; i != size1; i++) {
5632  ASSERT_STREQ(array1[i], array2[i]) << " where i == " << i;
5633  }
5634  }
#define ASSERT_STREQ(s1, s2)
Definition: gtest.h:2004
#define ASSERT_EQ(val1, val2)
Definition: gtest.h:1956
template<typename CharType >
static void testing::InitGoogleTestTest::AssertStringArrayEq ( size_t  size1,
CharType **  array1,
size_t  size2,
CharType **  array2 
)
inlinestaticprotected

Definition at line 5627 of file gtest_unittest.cc.

References ASSERT_EQ, ASSERT_STREQ, and i.

5628  {
5629  ASSERT_EQ(size1, size2) << " Array sizes different.";
5630 
5631  for (size_t i = 0; i != size1; i++) {
5632  ASSERT_STREQ(array1[i], array2[i]) << " where i == " << i;
5633  }
5634  }
#define ASSERT_STREQ(s1, s2)
Definition: gtest.h:2004
#define ASSERT_EQ(val1, val2)
Definition: gtest.h:1956
static void testing::InitGoogleTestTest::CheckFlags ( const Flags expected)
inlinestaticprotected

Definition at line 5637 of file gtest_unittest.cc.

References testing::Flags::also_run_disabled_tests, testing::Flags::break_on_failure, testing::Flags::catch_exceptions, testing::Flags::death_test_use_fork, EXPECT_EQ, EXPECT_STREQ, folly::pushmi::operators::filter, testing::Flags::filter, GTEST_FLAG, testing::Flags::list_tests, gmock_output_test::output, testing::Flags::output, testing::Flags::print_time, testing::Flags::random_seed, repeat(), testing::Flags::repeat, testing::Flags::shuffle, testing::Flags::stack_trace_depth, testing::Flags::stream_result_to, and testing::Flags::throw_on_failure.

5637  {
5638  EXPECT_EQ(expected.also_run_disabled_tests,
5639  GTEST_FLAG(also_run_disabled_tests));
5640  EXPECT_EQ(expected.break_on_failure, GTEST_FLAG(break_on_failure));
5641  EXPECT_EQ(expected.catch_exceptions, GTEST_FLAG(catch_exceptions));
5642  EXPECT_EQ(expected.death_test_use_fork, GTEST_FLAG(death_test_use_fork));
5643  EXPECT_STREQ(expected.filter, GTEST_FLAG(filter).c_str());
5644  EXPECT_EQ(expected.list_tests, GTEST_FLAG(list_tests));
5645  EXPECT_STREQ(expected.output, GTEST_FLAG(output).c_str());
5646  EXPECT_EQ(expected.print_time, GTEST_FLAG(print_time));
5647  EXPECT_EQ(expected.random_seed, GTEST_FLAG(random_seed));
5648  EXPECT_EQ(expected.repeat, GTEST_FLAG(repeat));
5649  EXPECT_EQ(expected.shuffle, GTEST_FLAG(shuffle));
5650  EXPECT_EQ(expected.stack_trace_depth, GTEST_FLAG(stack_trace_depth));
5651  EXPECT_STREQ(expected.stream_result_to,
5652  GTEST_FLAG(stream_result_to).c_str());
5653  EXPECT_EQ(expected.throw_on_failure, GTEST_FLAG(throw_on_failure));
5654  }
#define GTEST_FLAG(name)
Definition: gtest-port.h:2504
PUSHMI_INLINE_VAR constexpr detail::filter_fn filter
Definition: filter.h:75
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
#define EXPECT_STREQ(s1, s2)
Definition: gtest.h:1995
void repeat(F const &func)
static void testing::InitGoogleTestTest::CheckFlags ( const Flags expected)
inlinestaticprotected

Definition at line 5637 of file gtest_unittest.cc.

References testing::Flags::also_run_disabled_tests, testing::Flags::break_on_failure, testing::Flags::catch_exceptions, testing::Flags::death_test_use_fork, EXPECT_EQ, EXPECT_STREQ, folly::pushmi::operators::filter, testing::Flags::filter, GTEST_FLAG, testing::Flags::list_tests, gmock_output_test::output, testing::Flags::output, testing::Flags::print_time, testing::Flags::random_seed, repeat(), testing::Flags::repeat, testing::Flags::shuffle, testing::Flags::stack_trace_depth, testing::Flags::stream_result_to, and testing::Flags::throw_on_failure.

5637  {
5638  EXPECT_EQ(expected.also_run_disabled_tests,
5639  GTEST_FLAG(also_run_disabled_tests));
5640  EXPECT_EQ(expected.break_on_failure, GTEST_FLAG(break_on_failure));
5641  EXPECT_EQ(expected.catch_exceptions, GTEST_FLAG(catch_exceptions));
5642  EXPECT_EQ(expected.death_test_use_fork, GTEST_FLAG(death_test_use_fork));
5643  EXPECT_STREQ(expected.filter, GTEST_FLAG(filter).c_str());
5644  EXPECT_EQ(expected.list_tests, GTEST_FLAG(list_tests));
5645  EXPECT_STREQ(expected.output, GTEST_FLAG(output).c_str());
5646  EXPECT_EQ(expected.print_time, GTEST_FLAG(print_time));
5647  EXPECT_EQ(expected.random_seed, GTEST_FLAG(random_seed));
5648  EXPECT_EQ(expected.repeat, GTEST_FLAG(repeat));
5649  EXPECT_EQ(expected.shuffle, GTEST_FLAG(shuffle));
5650  EXPECT_EQ(expected.stack_trace_depth, GTEST_FLAG(stack_trace_depth));
5651  EXPECT_STREQ(expected.stream_result_to,
5652  GTEST_FLAG(stream_result_to).c_str());
5653  EXPECT_EQ(expected.throw_on_failure, GTEST_FLAG(throw_on_failure));
5654  }
#define GTEST_FLAG(name)
Definition: gtest-port.h:2504
PUSHMI_INLINE_VAR constexpr detail::filter_fn filter
Definition: filter.h:75
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
#define EXPECT_STREQ(s1, s2)
Definition: gtest.h:1995
void repeat(F const &func)
static void testing::InitGoogleTestTest::CheckFlags ( const Flags expected)
inlinestaticprotected

Definition at line 5637 of file gtest_unittest.cc.

References testing::Flags::also_run_disabled_tests, testing::Flags::break_on_failure, testing::Flags::catch_exceptions, testing::Flags::death_test_use_fork, EXPECT_EQ, EXPECT_STREQ, folly::pushmi::operators::filter, testing::Flags::filter, GTEST_FLAG, testing::Flags::list_tests, gmock_output_test::output, testing::Flags::output, testing::Flags::print_time, testing::Flags::random_seed, repeat(), testing::Flags::repeat, testing::Flags::shuffle, testing::Flags::stack_trace_depth, testing::Flags::stream_result_to, and testing::Flags::throw_on_failure.

5637  {
5638  EXPECT_EQ(expected.also_run_disabled_tests,
5639  GTEST_FLAG(also_run_disabled_tests));
5640  EXPECT_EQ(expected.break_on_failure, GTEST_FLAG(break_on_failure));
5641  EXPECT_EQ(expected.catch_exceptions, GTEST_FLAG(catch_exceptions));
5642  EXPECT_EQ(expected.death_test_use_fork, GTEST_FLAG(death_test_use_fork));
5643  EXPECT_STREQ(expected.filter, GTEST_FLAG(filter).c_str());
5644  EXPECT_EQ(expected.list_tests, GTEST_FLAG(list_tests));
5645  EXPECT_STREQ(expected.output, GTEST_FLAG(output).c_str());
5646  EXPECT_EQ(expected.print_time, GTEST_FLAG(print_time));
5647  EXPECT_EQ(expected.random_seed, GTEST_FLAG(random_seed));
5648  EXPECT_EQ(expected.repeat, GTEST_FLAG(repeat));
5649  EXPECT_EQ(expected.shuffle, GTEST_FLAG(shuffle));
5650  EXPECT_EQ(expected.stack_trace_depth, GTEST_FLAG(stack_trace_depth));
5651  EXPECT_STREQ(expected.stream_result_to,
5652  GTEST_FLAG(stream_result_to).c_str());
5653  EXPECT_EQ(expected.throw_on_failure, GTEST_FLAG(throw_on_failure));
5654  }
#define GTEST_FLAG(name)
Definition: gtest-port.h:2504
PUSHMI_INLINE_VAR constexpr detail::filter_fn filter
Definition: filter.h:75
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
#define EXPECT_STREQ(s1, s2)
Definition: gtest.h:1995
void repeat(F const &func)
virtual void testing::InitGoogleTestTest::SetUp ( )
inlineprotectedvirtual

Reimplemented from testing::Test.

Definition at line 5608 of file gtest_unittest.cc.

References folly::pushmi::operators::filter, GTEST_FLAG, testing::kMaxStackTraceDepth, gmock_output_test::output, and repeat().

5608  {
5609  GTEST_FLAG(also_run_disabled_tests) = false;
5610  GTEST_FLAG(break_on_failure) = false;
5611  GTEST_FLAG(catch_exceptions) = false;
5612  GTEST_FLAG(death_test_use_fork) = false;
5613  GTEST_FLAG(filter) = "";
5614  GTEST_FLAG(list_tests) = false;
5615  GTEST_FLAG(output) = "";
5616  GTEST_FLAG(print_time) = true;
5617  GTEST_FLAG(random_seed) = 0;
5618  GTEST_FLAG(repeat) = 1;
5619  GTEST_FLAG(shuffle) = false;
5620  GTEST_FLAG(stack_trace_depth) = kMaxStackTraceDepth;
5621  GTEST_FLAG(stream_result_to) = "";
5622  GTEST_FLAG(throw_on_failure) = false;
5623  }
#define GTEST_FLAG(name)
Definition: gtest-port.h:2504
PUSHMI_INLINE_VAR constexpr detail::filter_fn filter
Definition: filter.h:75
const int kMaxStackTraceDepth
Definition: gtest.h:147
void repeat(F const &func)
virtual void testing::InitGoogleTestTest::SetUp ( )
inlineprotectedvirtual

Reimplemented from testing::Test.

Definition at line 5608 of file gtest_unittest.cc.

References folly::pushmi::operators::filter, GTEST_FLAG, testing::kMaxStackTraceDepth, gmock_output_test::output, and repeat().

5608  {
5609  GTEST_FLAG(also_run_disabled_tests) = false;
5610  GTEST_FLAG(break_on_failure) = false;
5611  GTEST_FLAG(catch_exceptions) = false;
5612  GTEST_FLAG(death_test_use_fork) = false;
5613  GTEST_FLAG(filter) = "";
5614  GTEST_FLAG(list_tests) = false;
5615  GTEST_FLAG(output) = "";
5616  GTEST_FLAG(print_time) = true;
5617  GTEST_FLAG(random_seed) = 0;
5618  GTEST_FLAG(repeat) = 1;
5619  GTEST_FLAG(shuffle) = false;
5620  GTEST_FLAG(stack_trace_depth) = kMaxStackTraceDepth;
5621  GTEST_FLAG(stream_result_to) = "";
5622  GTEST_FLAG(throw_on_failure) = false;
5623  }
#define GTEST_FLAG(name)
Definition: gtest-port.h:2504
PUSHMI_INLINE_VAR constexpr detail::filter_fn filter
Definition: filter.h:75
const int kMaxStackTraceDepth
Definition: gtest.h:147
void repeat(F const &func)
virtual void testing::InitGoogleTestTest::SetUp ( )
inlineprotectedvirtual

Reimplemented from testing::Test.

Definition at line 5608 of file gtest_unittest.cc.

References folly::pushmi::operators::filter, GTEST_FLAG, testing::kMaxStackTraceDepth, gmock_output_test::output, and repeat().

Referenced by testing::TEST_F().

5608  {
5609  GTEST_FLAG(also_run_disabled_tests) = false;
5610  GTEST_FLAG(break_on_failure) = false;
5611  GTEST_FLAG(catch_exceptions) = false;
5612  GTEST_FLAG(death_test_use_fork) = false;
5613  GTEST_FLAG(filter) = "";
5614  GTEST_FLAG(list_tests) = false;
5615  GTEST_FLAG(output) = "";
5616  GTEST_FLAG(print_time) = true;
5617  GTEST_FLAG(random_seed) = 0;
5618  GTEST_FLAG(repeat) = 1;
5619  GTEST_FLAG(shuffle) = false;
5620  GTEST_FLAG(stack_trace_depth) = kMaxStackTraceDepth;
5621  GTEST_FLAG(stream_result_to) = "";
5622  GTEST_FLAG(throw_on_failure) = false;
5623  }
#define GTEST_FLAG(name)
Definition: gtest-port.h:2504
PUSHMI_INLINE_VAR constexpr detail::filter_fn filter
Definition: filter.h:75
const int kMaxStackTraceDepth
Definition: gtest.h:147
void repeat(F const &func)
template<typename CharType >
static void testing::InitGoogleTestTest::TestParsingFlags ( int  argc1,
const CharType **  argv1,
int  argc2,
const CharType **  argv2,
const Flags expected,
bool  should_print_help 
)
inlinestaticprotected

Definition at line 5660 of file gtest_unittest.cc.

References testing::internal::CaptureStdout(), EXPECT_EQ, EXPECT_PRED_FORMAT2, testing::internal::g_help_flag, testing::internal::GetCapturedStdout(), testing::IsNotSubstring(), testing::IsSubstring(), testing::internal::ParseGoogleTestFlagsOnly(), and string.

5662  {
5663  const bool saved_help_flag = ::testing::internal::g_help_flag;
5665 
5666 #if GTEST_HAS_STREAM_REDIRECTION
5667  CaptureStdout();
5668 #endif
5669 
5670  // Parses the command line.
5671  internal::ParseGoogleTestFlagsOnly(&argc1, const_cast<CharType**>(argv1));
5672 
5673 #if GTEST_HAS_STREAM_REDIRECTION
5674  const std::string captured_stdout = GetCapturedStdout();
5675 #endif
5676 
5677  // Verifies the flag values.
5678  CheckFlags(expected);
5679 
5680  // Verifies that the recognized flags are removed from the command
5681  // line.
5682  AssertStringArrayEq(argc1 + 1, argv1, argc2 + 1, argv2);
5683 
5684  // ParseGoogleTestFlagsOnly should neither set g_help_flag nor print the
5685  // help message for the flags it recognizes.
5686  EXPECT_EQ(should_print_help, ::testing::internal::g_help_flag);
5687 
5688 #if GTEST_HAS_STREAM_REDIRECTION
5689  const char* const expected_help_fragment =
5690  "This program contains tests written using";
5691  if (should_print_help) {
5692  EXPECT_PRED_FORMAT2(IsSubstring, expected_help_fragment, captured_stdout);
5693  } else {
5695  expected_help_fragment, captured_stdout);
5696  }
5697 #endif // GTEST_HAS_STREAM_REDIRECTION
5698 
5699  ::testing::internal::g_help_flag = saved_help_flag;
5700  }
GTEST_API_ bool g_help_flag
Definition: gtest.cc:188
#define EXPECT_PRED_FORMAT2(pred_format, v1, v2)
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
static void CheckFlags(const Flags &expected)
GTEST_API_ AssertionResult IsSubstring(const char *needle_expr, const char *haystack_expr, const char *needle, const char *haystack)
Definition: gtest.cc:1606
static void AssertStringArrayEq(size_t size1, CharType **array1, size_t size2, CharType **array2)
const char * string
Definition: Conv.cpp:212
GTEST_API_ void ParseGoogleTestFlagsOnly(int *argc, char **argv)
Definition: gtest.cc:5332
std::string GetCapturedStdout()
GTEST_API_ AssertionResult IsNotSubstring(const char *needle_expr, const char *haystack_expr, const char *needle, const char *haystack)
Definition: gtest.cc:1618
template<typename CharType >
static void testing::InitGoogleTestTest::TestParsingFlags ( int  argc1,
const CharType **  argv1,
int  argc2,
const CharType **  argv2,
const Flags expected,
bool  should_print_help 
)
inlinestaticprotected

Definition at line 5660 of file gtest_unittest.cc.

References testing::internal::CaptureStdout(), EXPECT_EQ, EXPECT_PRED_FORMAT2, testing::internal::g_help_flag, testing::internal::GetCapturedStdout(), testing::IsNotSubstring(), testing::IsSubstring(), testing::internal::ParseGoogleTestFlagsOnly(), and string.

5662  {
5663  const bool saved_help_flag = ::testing::internal::g_help_flag;
5665 
5666 #if GTEST_HAS_STREAM_REDIRECTION
5667  CaptureStdout();
5668 #endif
5669 
5670  // Parses the command line.
5671  internal::ParseGoogleTestFlagsOnly(&argc1, const_cast<CharType**>(argv1));
5672 
5673 #if GTEST_HAS_STREAM_REDIRECTION
5674  const std::string captured_stdout = GetCapturedStdout();
5675 #endif
5676 
5677  // Verifies the flag values.
5678  CheckFlags(expected);
5679 
5680  // Verifies that the recognized flags are removed from the command
5681  // line.
5682  AssertStringArrayEq(argc1 + 1, argv1, argc2 + 1, argv2);
5683 
5684  // ParseGoogleTestFlagsOnly should neither set g_help_flag nor print the
5685  // help message for the flags it recognizes.
5686  EXPECT_EQ(should_print_help, ::testing::internal::g_help_flag);
5687 
5688 #if GTEST_HAS_STREAM_REDIRECTION
5689  const char* const expected_help_fragment =
5690  "This program contains tests written using";
5691  if (should_print_help) {
5692  EXPECT_PRED_FORMAT2(IsSubstring, expected_help_fragment, captured_stdout);
5693  } else {
5695  expected_help_fragment, captured_stdout);
5696  }
5697 #endif // GTEST_HAS_STREAM_REDIRECTION
5698 
5699  ::testing::internal::g_help_flag = saved_help_flag;
5700  }
GTEST_API_ bool g_help_flag
Definition: gtest.cc:188
#define EXPECT_PRED_FORMAT2(pred_format, v1, v2)
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
static void CheckFlags(const Flags &expected)
GTEST_API_ AssertionResult IsSubstring(const char *needle_expr, const char *haystack_expr, const char *needle, const char *haystack)
Definition: gtest.cc:1606
static void AssertStringArrayEq(size_t size1, CharType **array1, size_t size2, CharType **array2)
const char * string
Definition: Conv.cpp:212
GTEST_API_ void ParseGoogleTestFlagsOnly(int *argc, char **argv)
Definition: gtest.cc:5332
std::string GetCapturedStdout()
GTEST_API_ AssertionResult IsNotSubstring(const char *needle_expr, const char *haystack_expr, const char *needle, const char *haystack)
Definition: gtest.cc:1618
template<typename CharType >
static void testing::InitGoogleTestTest::TestParsingFlags ( int  argc1,
const CharType **  argv1,
int  argc2,
const CharType **  argv2,
const Flags expected,
bool  should_print_help 
)
inlinestaticprotected

Definition at line 5660 of file gtest_unittest.cc.

References testing::internal::CaptureStdout(), EXPECT_EQ, EXPECT_PRED_FORMAT2, testing::internal::g_help_flag, testing::internal::GetCapturedStdout(), testing::IsNotSubstring(), testing::IsSubstring(), testing::internal::ParseGoogleTestFlagsOnly(), and string.

5662  {
5663  const bool saved_help_flag = ::testing::internal::g_help_flag;
5665 
5666 #if GTEST_HAS_STREAM_REDIRECTION
5667  CaptureStdout();
5668 #endif
5669 
5670  // Parses the command line.
5671  internal::ParseGoogleTestFlagsOnly(&argc1, const_cast<CharType**>(argv1));
5672 
5673 #if GTEST_HAS_STREAM_REDIRECTION
5674  const std::string captured_stdout = GetCapturedStdout();
5675 #endif
5676 
5677  // Verifies the flag values.
5678  CheckFlags(expected);
5679 
5680  // Verifies that the recognized flags are removed from the command
5681  // line.
5682  AssertStringArrayEq(argc1 + 1, argv1, argc2 + 1, argv2);
5683 
5684  // ParseGoogleTestFlagsOnly should neither set g_help_flag nor print the
5685  // help message for the flags it recognizes.
5686  EXPECT_EQ(should_print_help, ::testing::internal::g_help_flag);
5687 
5688 #if GTEST_HAS_STREAM_REDIRECTION
5689  const char* const expected_help_fragment =
5690  "This program contains tests written using";
5691  if (should_print_help) {
5692  EXPECT_PRED_FORMAT2(IsSubstring, expected_help_fragment, captured_stdout);
5693  } else {
5695  expected_help_fragment, captured_stdout);
5696  }
5697 #endif // GTEST_HAS_STREAM_REDIRECTION
5698 
5699  ::testing::internal::g_help_flag = saved_help_flag;
5700  }
GTEST_API_ bool g_help_flag
Definition: gtest.cc:188
#define EXPECT_PRED_FORMAT2(pred_format, v1, v2)
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
static void CheckFlags(const Flags &expected)
GTEST_API_ AssertionResult IsSubstring(const char *needle_expr, const char *haystack_expr, const char *needle, const char *haystack)
Definition: gtest.cc:1606
static void AssertStringArrayEq(size_t size1, CharType **array1, size_t size2, CharType **array2)
const char * string
Definition: Conv.cpp:212
GTEST_API_ void ParseGoogleTestFlagsOnly(int *argc, char **argv)
Definition: gtest.cc:5332
std::string GetCapturedStdout()
GTEST_API_ AssertionResult IsNotSubstring(const char *needle_expr, const char *haystack_expr, const char *needle, const char *haystack)
Definition: gtest.cc:1618

The documentation for this class was generated from the following file: