proxygen
testing::internal::PrettyUnitTestResultPrinter Class Reference
Inheritance diagram for testing::internal::PrettyUnitTestResultPrinter:
testing::TestEventListener testing::TestEventListener testing::TestEventListener

Public Member Functions

 PrettyUnitTestResultPrinter ()
 
virtual void OnTestProgramStart (const UnitTest &)
 
virtual void OnTestIterationStart (const UnitTest &unit_test, int iteration)
 
virtual void OnEnvironmentsSetUpStart (const UnitTest &unit_test)
 
virtual void OnEnvironmentsSetUpEnd (const UnitTest &)
 
virtual void OnTestCaseStart (const TestCase &test_case)
 
virtual void OnTestStart (const TestInfo &test_info)
 
virtual void OnTestPartResult (const TestPartResult &result)
 
virtual void OnTestEnd (const TestInfo &test_info)
 
virtual void OnTestCaseEnd (const TestCase &test_case)
 
virtual void OnEnvironmentsTearDownStart (const UnitTest &unit_test)
 
virtual void OnEnvironmentsTearDownEnd (const UnitTest &)
 
virtual void OnTestIterationEnd (const UnitTest &unit_test, int iteration)
 
virtual void OnTestProgramEnd (const UnitTest &)
 
 PrettyUnitTestResultPrinter ()
 
virtual void OnTestProgramStart (const UnitTest &)
 
virtual void OnTestIterationStart (const UnitTest &unit_test, int iteration)
 
virtual void OnEnvironmentsSetUpStart (const UnitTest &unit_test)
 
virtual void OnEnvironmentsSetUpEnd (const UnitTest &)
 
virtual void OnTestCaseStart (const TestCase &test_case)
 
virtual void OnTestStart (const TestInfo &test_info)
 
virtual void OnTestPartResult (const TestPartResult &result)
 
virtual void OnTestEnd (const TestInfo &test_info)
 
virtual void OnTestCaseEnd (const TestCase &test_case)
 
virtual void OnEnvironmentsTearDownStart (const UnitTest &unit_test)
 
virtual void OnEnvironmentsTearDownEnd (const UnitTest &)
 
virtual void OnTestIterationEnd (const UnitTest &unit_test, int iteration)
 
virtual void OnTestProgramEnd (const UnitTest &)
 
 PrettyUnitTestResultPrinter ()
 
virtual void OnTestProgramStart (const UnitTest &)
 
virtual void OnTestIterationStart (const UnitTest &unit_test, int iteration)
 
virtual void OnEnvironmentsSetUpStart (const UnitTest &unit_test)
 
virtual void OnEnvironmentsSetUpEnd (const UnitTest &)
 
virtual void OnTestCaseStart (const TestCase &test_case)
 
virtual void OnTestStart (const TestInfo &test_info)
 
virtual void OnTestPartResult (const TestPartResult &result)
 
virtual void OnTestEnd (const TestInfo &test_info)
 
virtual void OnTestCaseEnd (const TestCase &test_case)
 
virtual void OnEnvironmentsTearDownStart (const UnitTest &unit_test)
 
virtual void OnEnvironmentsTearDownEnd (const UnitTest &)
 
virtual void OnTestIterationEnd (const UnitTest &unit_test, int iteration)
 
virtual void OnTestProgramEnd (const UnitTest &)
 
- Public Member Functions inherited from testing::TestEventListener
virtual ~TestEventListener ()
 
virtual ~TestEventListener ()
 
virtual ~TestEventListener ()
 

Static Public Member Functions

static void PrintTestName (const char *test_case, const char *test)
 
static void PrintTestName (const char *test_case, const char *test)
 
static void PrintTestName (const char *test_case, const char *test)
 

Static Private Member Functions

static void PrintFailedTests (const UnitTest &unit_test)
 
static void PrintFailedTests (const UnitTest &unit_test)
 
static void PrintFailedTests (const UnitTest &unit_test)
 

Detailed Description

Definition at line 3029 of file gtest.cc.

Constructor & Destructor Documentation

testing::internal::PrettyUnitTestResultPrinter::PrettyUnitTestResultPrinter ( )
inline

Definition at line 3031 of file gtest.cc.

3031 {}
testing::internal::PrettyUnitTestResultPrinter::PrettyUnitTestResultPrinter ( )
inline

Definition at line 3031 of file gtest.cc.

3031 {}
testing::internal::PrettyUnitTestResultPrinter::PrettyUnitTestResultPrinter ( )
inline

Definition at line 3031 of file gtest.cc.

3031 {}

Member Function Documentation

virtual void testing::internal::PrettyUnitTestResultPrinter::OnEnvironmentsSetUpEnd ( const UnitTest )
inlinevirtual

Implements testing::TestEventListener.

Definition at line 3040 of file gtest.cc.

3040 {}
virtual void testing::internal::PrettyUnitTestResultPrinter::OnEnvironmentsSetUpEnd ( const UnitTest )
inlinevirtual

Implements testing::TestEventListener.

Definition at line 3040 of file gtest.cc.

3040 {}
virtual void testing::internal::PrettyUnitTestResultPrinter::OnEnvironmentsSetUpEnd ( const UnitTest )
inlinevirtual

Implements testing::TestEventListener.

Definition at line 3040 of file gtest.cc.

3040 {}
virtual void testing::internal::PrettyUnitTestResultPrinter::OnEnvironmentsSetUpStart ( const UnitTest unit_test)
virtual
virtual void testing::internal::PrettyUnitTestResultPrinter::OnEnvironmentsSetUpStart ( const UnitTest unit_test)
virtual
void testing::internal::PrettyUnitTestResultPrinter::OnEnvironmentsSetUpStart ( const UnitTest unit_test)
virtual

Implements testing::TestEventListener.

Definition at line 3091 of file gtest.cc.

References testing::internal::COLOR_GREEN, and testing::internal::ColoredPrintf().

Referenced by OnTestProgramEnd().

3092  {
3093  ColoredPrintf(COLOR_GREEN, "[----------] ");
3094  printf("Global test environment set-up.\n");
3095  fflush(stdout);
3096 }
void ColoredPrintf(GTestColor color, const char *fmt,...)
Definition: gtest.cc:2956
virtual void testing::internal::PrettyUnitTestResultPrinter::OnEnvironmentsTearDownEnd ( const UnitTest )
inlinevirtual

Implements testing::TestEventListener.

Definition at line 3047 of file gtest.cc.

3047 {}
virtual void testing::internal::PrettyUnitTestResultPrinter::OnEnvironmentsTearDownEnd ( const UnitTest )
inlinevirtual

Implements testing::TestEventListener.

Definition at line 3047 of file gtest.cc.

3047 {}
virtual void testing::internal::PrettyUnitTestResultPrinter::OnEnvironmentsTearDownEnd ( const UnitTest )
inlinevirtual

Implements testing::TestEventListener.

Definition at line 3047 of file gtest.cc.

3047 {}
virtual void testing::internal::PrettyUnitTestResultPrinter::OnEnvironmentsTearDownStart ( const UnitTest unit_test)
virtual
void testing::internal::PrettyUnitTestResultPrinter::OnEnvironmentsTearDownStart ( const UnitTest unit_test)
virtual

Implements testing::TestEventListener.

Definition at line 3161 of file gtest.cc.

References testing::internal::COLOR_GREEN, and testing::internal::ColoredPrintf().

Referenced by OnTestProgramEnd().

3162  {
3163  ColoredPrintf(COLOR_GREEN, "[----------] ");
3164  printf("Global test environment tear-down\n");
3165  fflush(stdout);
3166 }
void ColoredPrintf(GTestColor color, const char *fmt,...)
Definition: gtest.cc:2956
virtual void testing::internal::PrettyUnitTestResultPrinter::OnEnvironmentsTearDownStart ( const UnitTest unit_test)
virtual
virtual void testing::internal::PrettyUnitTestResultPrinter::OnTestCaseEnd ( const TestCase test_case)
virtual
void testing::internal::PrettyUnitTestResultPrinter::OnTestCaseEnd ( const TestCase test_case)
virtual

Implements testing::TestEventListener.

Definition at line 3149 of file gtest.cc.

References testing::internal::COLOR_GREEN, testing::internal::ColoredPrintf(), testing::TestCase::elapsed_time(), testing::FormatCountableNoun(), GTEST_FLAG, testing::TestCase::name(), testing::internal::StreamableToString(), string, and testing::TestCase::test_to_run_count().

Referenced by OnTestProgramEnd().

3149  {
3150  if (!GTEST_FLAG(print_time)) return;
3151 
3152  const std::string counts =
3153  FormatCountableNoun(test_case.test_to_run_count(), "test", "tests");
3154  ColoredPrintf(COLOR_GREEN, "[----------] ");
3155  printf("%s from %s (%s ms total)\n\n",
3156  counts.c_str(), test_case.name(),
3157  internal::StreamableToString(test_case.elapsed_time()).c_str());
3158  fflush(stdout);
3159 }
#define GTEST_FLAG(name)
Definition: gtest-port.h:2504
void ColoredPrintf(GTestColor color, const char *fmt,...)
Definition: gtest.cc:2956
std::string StreamableToString(const T &streamable)
static std::string FormatCountableNoun(int count, const char *singular_form, const char *plural_form)
Definition: gtest.cc:2809
const char * string
Definition: Conv.cpp:212
virtual void testing::internal::PrettyUnitTestResultPrinter::OnTestCaseEnd ( const TestCase test_case)
virtual
virtual void testing::internal::PrettyUnitTestResultPrinter::OnTestCaseStart ( const TestCase test_case)
virtual
virtual void testing::internal::PrettyUnitTestResultPrinter::OnTestCaseStart ( const TestCase test_case)
virtual
void testing::internal::PrettyUnitTestResultPrinter::OnTestCaseStart ( const TestCase test_case)
virtual

Implements testing::TestEventListener.

Definition at line 3098 of file gtest.cc.

References testing::internal::COLOR_GREEN, testing::internal::ColoredPrintf(), testing::FormatCountableNoun(), testing::TestCase::name(), string, testing::TestCase::test_to_run_count(), and testing::TestCase::type_param().

Referenced by OnTestProgramEnd().

3098  {
3099  const std::string counts =
3100  FormatCountableNoun(test_case.test_to_run_count(), "test", "tests");
3101  ColoredPrintf(COLOR_GREEN, "[----------] ");
3102  printf("%s from %s", counts.c_str(), test_case.name());
3103  if (test_case.type_param() == NULL) {
3104  printf("\n");
3105  } else {
3106  printf(", where %s = %s\n", kTypeParamLabel, test_case.type_param());
3107  }
3108  fflush(stdout);
3109 }
void ColoredPrintf(GTestColor color, const char *fmt,...)
Definition: gtest.cc:2956
static std::string FormatCountableNoun(int count, const char *singular_form, const char *plural_form)
Definition: gtest.cc:2809
const char * string
Definition: Conv.cpp:212
static const char kTypeParamLabel[]
Definition: gtest.cc:3006
void testing::internal::PrettyUnitTestResultPrinter::OnTestEnd ( const TestInfo test_info)
virtual

Implements testing::TestEventListener.

Definition at line 3130 of file gtest.cc.

References testing::internal::COLOR_GREEN, testing::internal::COLOR_RED, testing::internal::ColoredPrintf(), testing::TestResult::elapsed_time(), testing::TestResult::Failed(), GTEST_FLAG, testing::TestInfo::name(), testing::TestResult::Passed(), testing::internal::PrintFullTestCommentIfPresent(), testing::TestInfo::result(), testing::internal::StreamableToString(), and testing::TestInfo::test_case_name().

Referenced by OnTestProgramEnd().

3130  {
3131  if (test_info.result()->Passed()) {
3132  ColoredPrintf(COLOR_GREEN, "[ OK ] ");
3133  } else {
3134  ColoredPrintf(COLOR_RED, "[ FAILED ] ");
3135  }
3136  PrintTestName(test_info.test_case_name(), test_info.name());
3137  if (test_info.result()->Failed())
3138  PrintFullTestCommentIfPresent(test_info);
3139 
3140  if (GTEST_FLAG(print_time)) {
3141  printf(" (%s ms)\n", internal::StreamableToString(
3142  test_info.result()->elapsed_time()).c_str());
3143  } else {
3144  printf("\n");
3145  }
3146  fflush(stdout);
3147 }
#define GTEST_FLAG(name)
Definition: gtest-port.h:2504
void PrintFullTestCommentIfPresent(const TestInfo &test_info)
Definition: gtest.cc:3009
void ColoredPrintf(GTestColor color, const char *fmt,...)
Definition: gtest.cc:2956
std::string StreamableToString(const T &streamable)
static void PrintTestName(const char *test_case, const char *test)
Definition: gtest.cc:3032
virtual void testing::internal::PrettyUnitTestResultPrinter::OnTestEnd ( const TestInfo test_info)
virtual
virtual void testing::internal::PrettyUnitTestResultPrinter::OnTestEnd ( const TestInfo test_info)
virtual
virtual void testing::internal::PrettyUnitTestResultPrinter::OnTestIterationEnd ( const UnitTest unit_test,
int  iteration 
)
virtual
void testing::internal::PrettyUnitTestResultPrinter::OnTestIterationEnd ( const UnitTest unit_test,
int  iteration 
)
virtual

Implements testing::TestEventListener.

Definition at line 3193 of file gtest.cc.

References testing::internal::COLOR_GREEN, testing::internal::COLOR_RED, testing::internal::COLOR_YELLOW, testing::internal::ColoredPrintf(), testing::UnitTest::elapsed_time(), testing::TestCase::failed_test_count(), testing::UnitTest::failed_test_count(), testing::FormatTestCaseCount(), testing::FormatTestCount(), GTEST_FLAG, testing::UnitTest::Passed(), testing::UnitTest::reportable_disabled_test_count(), testing::internal::StreamableToString(), testing::UnitTest::successful_test_count(), testing::UnitTest::test_case_to_run_count(), and testing::UnitTest::test_to_run_count().

Referenced by OnTestProgramEnd().

3194  {
3195  ColoredPrintf(COLOR_GREEN, "[==========] ");
3196  printf("%s from %s ran.",
3197  FormatTestCount(unit_test.test_to_run_count()).c_str(),
3198  FormatTestCaseCount(unit_test.test_case_to_run_count()).c_str());
3199  if (GTEST_FLAG(print_time)) {
3200  printf(" (%s ms total)",
3201  internal::StreamableToString(unit_test.elapsed_time()).c_str());
3202  }
3203  printf("\n");
3204  ColoredPrintf(COLOR_GREEN, "[ PASSED ] ");
3205  printf("%s.\n", FormatTestCount(unit_test.successful_test_count()).c_str());
3206 
3207  int num_failures = unit_test.failed_test_count();
3208  if (!unit_test.Passed()) {
3209  const int failed_test_count = unit_test.failed_test_count();
3210  ColoredPrintf(COLOR_RED, "[ FAILED ] ");
3211  printf("%s, listed below:\n", FormatTestCount(failed_test_count).c_str());
3212  PrintFailedTests(unit_test);
3213  printf("\n%2d FAILED %s\n", num_failures,
3214  num_failures == 1 ? "TEST" : "TESTS");
3215  }
3216 
3217  int num_disabled = unit_test.reportable_disabled_test_count();
3218  if (num_disabled && !GTEST_FLAG(also_run_disabled_tests)) {
3219  if (!num_failures) {
3220  printf("\n"); // Add a spacer if no FAILURE banner is displayed.
3221  }
3223  " YOU HAVE %d DISABLED %s\n\n",
3224  num_disabled,
3225  num_disabled == 1 ? "TEST" : "TESTS");
3226  }
3227  // Ensure that Google Test output is printed before, e.g., heapchecker output.
3228  fflush(stdout);
3229 }
#define GTEST_FLAG(name)
Definition: gtest-port.h:2504
void ColoredPrintf(GTestColor color, const char *fmt,...)
Definition: gtest.cc:2956
std::string StreamableToString(const T &streamable)
static std::string FormatTestCaseCount(int test_case_count)
Definition: gtest.cc:2822
static std::string FormatTestCount(int test_count)
Definition: gtest.cc:2817
static void PrintFailedTests(const UnitTest &unit_test)
Definition: gtest.cc:3169
virtual void testing::internal::PrettyUnitTestResultPrinter::OnTestIterationEnd ( const UnitTest unit_test,
int  iteration 
)
virtual
virtual void testing::internal::PrettyUnitTestResultPrinter::OnTestIterationStart ( const UnitTest unit_test,
int  iteration 
)
virtual
void testing::internal::PrettyUnitTestResultPrinter::OnTestIterationStart ( const UnitTest unit_test,
int  iteration 
)
virtual

Implements testing::TestEventListener.

Definition at line 3056 of file gtest.cc.

References testing::internal::COLOR_GREEN, testing::internal::COLOR_YELLOW, testing::internal::ColoredPrintf(), folly::pushmi::operators::filter, testing::FormatTestCaseCount(), testing::FormatTestCount(), testing::internal::posix::GetEnv(), GTEST_FLAG, GTEST_NAME_, testing::internal::Int32FromEnvOrDie(), testing::UnitTest::random_seed(), repeat(), testing::internal::ShouldShard(), testing::UnitTest::test_case_to_run_count(), and testing::UnitTest::test_to_run_count().

Referenced by OnTestProgramEnd().

3057  {
3058  if (GTEST_FLAG(repeat) != 1)
3059  printf("\nRepeating all tests (iteration %d) . . .\n\n", iteration + 1);
3060 
3061  const char* const filter = GTEST_FLAG(filter).c_str();
3062 
3063  // Prints the filter if it's not *. This reminds the user that some
3064  // tests may be skipped.
3065  if (!String::CStringEquals(filter, kUniversalFilter)) {
3067  "Note: %s filter = %s\n", GTEST_NAME_, filter);
3068  }
3069 
3071  const Int32 shard_index = Int32FromEnvOrDie(kTestShardIndex, -1);
3073  "Note: This is test shard %d of %s.\n",
3074  static_cast<int>(shard_index) + 1,
3076  }
3077 
3078  if (GTEST_FLAG(shuffle)) {
3080  "Note: Randomizing tests' orders with a seed of %d .\n",
3081  unit_test.random_seed());
3082  }
3083 
3084  ColoredPrintf(COLOR_GREEN, "[==========] ");
3085  printf("Running %s from %s.\n",
3086  FormatTestCount(unit_test.test_to_run_count()).c_str(),
3087  FormatTestCaseCount(unit_test.test_case_to_run_count()).c_str());
3088  fflush(stdout);
3089 }
#define GTEST_FLAG(name)
Definition: gtest-port.h:2504
PUSHMI_INLINE_VAR constexpr detail::filter_fn filter
Definition: filter.h:75
TypeWithSize< 4 >::Int Int32
Definition: gtest-port.h:2494
void ColoredPrintf(GTestColor color, const char *fmt,...)
Definition: gtest.cc:2956
GTEST_API_ bool ShouldShard(const char *total_shards_str, const char *shard_index_str, bool in_subprocess_for_death_test)
Definition: gtest.cc:4715
static const char kTestTotalShards[]
Definition: gtest.cc:176
static bool CStringEquals(const char *lhs, const char *rhs)
Definition: gtest.cc:894
void repeat(F const &func)
static std::string FormatTestCaseCount(int test_case_count)
Definition: gtest.cc:2822
static const char kUniversalFilter[]
Definition: gtest.cc:168
static std::string FormatTestCount(int test_count)
Definition: gtest.cc:2817
static const char kTestShardIndex[]
Definition: gtest.cc:174
#define GTEST_NAME_
Definition: gtest-port.h:289
const char * GetEnv(const char *name)
Definition: gtest-port.h:2387
GTEST_API_ Int32 Int32FromEnvOrDie(const char *env_var, Int32 default_val)
Definition: gtest.cc:4760
virtual void testing::internal::PrettyUnitTestResultPrinter::OnTestIterationStart ( const UnitTest unit_test,
int  iteration 
)
virtual
void testing::internal::PrettyUnitTestResultPrinter::OnTestPartResult ( const TestPartResult result)
virtual

Implements testing::TestEventListener.

Definition at line 3119 of file gtest.cc.

References testing::TestPartResult::kSuccess, testing::internal::PrintTestPartResult(), and testing::TestPartResult::type().

Referenced by OnTestProgramEnd().

3120  {
3121  // If the test part succeeded, we don't need to do anything.
3122  if (result.type() == TestPartResult::kSuccess)
3123  return;
3124 
3125  // Print failure message from the assertion (e.g. expected this and got that).
3126  PrintTestPartResult(result);
3127  fflush(stdout);
3128 }
static void PrintTestPartResult(const TestPartResult &test_part_result)
Definition: gtest.cc:2860
virtual void testing::internal::PrettyUnitTestResultPrinter::OnTestPartResult ( const TestPartResult result)
virtual
virtual void testing::internal::PrettyUnitTestResultPrinter::OnTestPartResult ( const TestPartResult result)
virtual
virtual void testing::internal::PrettyUnitTestResultPrinter::OnTestProgramEnd ( const UnitTest )
inlinevirtual

Implements testing::TestEventListener.

Definition at line 3049 of file gtest.cc.

References testing::internal::COLOR_GREEN, testing::internal::COLOR_RED, testing::internal::ColoredPrintf(), testing::internal::String::CStringEquals(), testing::TestResult::elapsed_time(), testing::TestCase::elapsed_time(), testing::UnitTest::elapsed_time(), testing::TestResult::Failed(), testing::TestCase::failed_test_count(), testing::UnitTest::failed_test_count(), folly::pushmi::operators::filter, testing::FormatCountableNoun(), testing::FormatTestCaseCount(), testing::FormatTestCount(), testing::internal::posix::GetEnv(), testing::UnitTest::GetTestCase(), testing::TestCase::GetTestInfo(), GTEST_FLAG, GTEST_NAME_, i, testing::internal::Int32FromEnvOrDie(), testing::TestPartResult::kSuccess, testing::TestInfo::name(), testing::TestCase::name(), OnEnvironmentsSetUpStart(), OnEnvironmentsTearDownStart(), OnTestCaseEnd(), OnTestCaseStart(), OnTestEnd(), OnTestIterationEnd(), OnTestIterationStart(), OnTestPartResult(), OnTestStart(), testing::TestResult::Passed(), testing::UnitTest::Passed(), PrintFailedTests(), testing::internal::PrintFullTestCommentIfPresent(), testing::internal::PrintTestPartResult(), testing::UnitTest::random_seed(), repeat(), testing::UnitTest::reportable_disabled_test_count(), testing::TestInfo::result(), testing::TestInfo::should_run(), testing::TestCase::should_run(), testing::internal::ShouldShard(), testing::internal::StreamableToString(), string, testing::UnitTest::successful_test_count(), testing::TestInfo::test_case_name(), testing::UnitTest::test_case_to_run_count(), testing::TestCase::test_to_run_count(), testing::UnitTest::test_to_run_count(), testing::UnitTest::total_test_case_count(), testing::TestCase::total_test_count(), testing::TestPartResult::type(), and testing::TestCase::type_param().

3049 {}
virtual void testing::internal::PrettyUnitTestResultPrinter::OnTestProgramEnd ( const UnitTest )
inlinevirtual

Implements testing::TestEventListener.

Definition at line 3049 of file gtest.cc.

References testing::internal::COLOR_GREEN, testing::internal::COLOR_RED, testing::internal::ColoredPrintf(), testing::internal::String::CStringEquals(), testing::TestResult::elapsed_time(), testing::TestCase::elapsed_time(), testing::UnitTest::elapsed_time(), testing::TestResult::Failed(), testing::TestCase::failed_test_count(), testing::UnitTest::failed_test_count(), folly::pushmi::operators::filter, testing::FormatCountableNoun(), testing::FormatTestCaseCount(), testing::FormatTestCount(), testing::internal::posix::GetEnv(), testing::UnitTest::GetTestCase(), testing::TestCase::GetTestInfo(), GTEST_FLAG, GTEST_NAME_, i, testing::internal::Int32FromEnvOrDie(), testing::TestPartResult::kSuccess, testing::TestInfo::name(), testing::TestCase::name(), OnEnvironmentsSetUpStart(), OnEnvironmentsTearDownStart(), OnTestCaseEnd(), OnTestCaseStart(), OnTestEnd(), OnTestIterationEnd(), OnTestIterationStart(), OnTestPartResult(), OnTestStart(), testing::TestResult::Passed(), testing::UnitTest::Passed(), PrintFailedTests(), testing::internal::PrintFullTestCommentIfPresent(), testing::internal::PrintTestPartResult(), testing::UnitTest::random_seed(), repeat(), testing::UnitTest::reportable_disabled_test_count(), testing::TestInfo::result(), testing::TestInfo::should_run(), testing::TestCase::should_run(), testing::internal::ShouldShard(), testing::internal::StreamableToString(), string, testing::UnitTest::successful_test_count(), testing::TestInfo::test_case_name(), testing::UnitTest::test_case_to_run_count(), testing::TestCase::test_to_run_count(), testing::UnitTest::test_to_run_count(), testing::UnitTest::total_test_case_count(), testing::TestCase::total_test_count(), testing::TestPartResult::type(), and testing::TestCase::type_param().

3049 {}
virtual void testing::internal::PrettyUnitTestResultPrinter::OnTestProgramEnd ( const UnitTest )
inlinevirtual

Implements testing::TestEventListener.

Definition at line 3049 of file gtest.cc.

3049 {}
virtual void testing::internal::PrettyUnitTestResultPrinter::OnTestProgramStart ( const UnitTest )
inlinevirtual

Implements testing::TestEventListener.

Definition at line 3037 of file gtest.cc.

3037 {}
virtual void testing::internal::PrettyUnitTestResultPrinter::OnTestProgramStart ( const UnitTest )
inlinevirtual

Implements testing::TestEventListener.

Definition at line 3037 of file gtest.cc.

3037 {}
virtual void testing::internal::PrettyUnitTestResultPrinter::OnTestProgramStart ( const UnitTest )
inlinevirtual

Implements testing::TestEventListener.

Definition at line 3037 of file gtest.cc.

3037 {}
void testing::internal::PrettyUnitTestResultPrinter::OnTestStart ( const TestInfo test_info)
virtual

Implements testing::TestEventListener.

Definition at line 3111 of file gtest.cc.

References testing::internal::COLOR_GREEN, testing::internal::ColoredPrintf(), testing::TestInfo::name(), and testing::TestInfo::test_case_name().

Referenced by OnTestProgramEnd().

3111  {
3112  ColoredPrintf(COLOR_GREEN, "[ RUN ] ");
3113  PrintTestName(test_info.test_case_name(), test_info.name());
3114  printf("\n");
3115  fflush(stdout);
3116 }
void ColoredPrintf(GTestColor color, const char *fmt,...)
Definition: gtest.cc:2956
static void PrintTestName(const char *test_case, const char *test)
Definition: gtest.cc:3032
virtual void testing::internal::PrettyUnitTestResultPrinter::OnTestStart ( const TestInfo test_info)
virtual
virtual void testing::internal::PrettyUnitTestResultPrinter::OnTestStart ( const TestInfo test_info)
virtual
void testing::internal::PrettyUnitTestResultPrinter::PrintFailedTests ( const UnitTest unit_test)
staticprivate

Definition at line 3169 of file gtest.cc.

References testing::internal::COLOR_RED, testing::internal::ColoredPrintf(), testing::TestCase::failed_test_count(), testing::UnitTest::failed_test_count(), testing::UnitTest::GetTestCase(), testing::TestCase::GetTestInfo(), i, testing::TestInfo::name(), testing::TestCase::name(), testing::TestResult::Passed(), testing::internal::PrintFullTestCommentIfPresent(), testing::TestInfo::result(), testing::TestInfo::should_run(), testing::TestCase::should_run(), testing::UnitTest::total_test_case_count(), and testing::TestCase::total_test_count().

Referenced by OnTestProgramEnd().

3169  {
3170  const int failed_test_count = unit_test.failed_test_count();
3171  if (failed_test_count == 0) {
3172  return;
3173  }
3174 
3175  for (int i = 0; i < unit_test.total_test_case_count(); ++i) {
3176  const TestCase& test_case = *unit_test.GetTestCase(i);
3177  if (!test_case.should_run() || (test_case.failed_test_count() == 0)) {
3178  continue;
3179  }
3180  for (int j = 0; j < test_case.total_test_count(); ++j) {
3181  const TestInfo& test_info = *test_case.GetTestInfo(j);
3182  if (!test_info.should_run() || test_info.result()->Passed()) {
3183  continue;
3184  }
3185  ColoredPrintf(COLOR_RED, "[ FAILED ] ");
3186  printf("%s.%s", test_case.name(), test_info.name());
3187  PrintFullTestCommentIfPresent(test_info);
3188  printf("\n");
3189  }
3190  }
3191 }
void PrintFullTestCommentIfPresent(const TestInfo &test_info)
Definition: gtest.cc:3009
void ColoredPrintf(GTestColor color, const char *fmt,...)
Definition: gtest.cc:2956
static void testing::internal::PrettyUnitTestResultPrinter::PrintFailedTests ( const UnitTest unit_test)
staticprivate
static void testing::internal::PrettyUnitTestResultPrinter::PrintFailedTests ( const UnitTest unit_test)
staticprivate
static void testing::internal::PrettyUnitTestResultPrinter::PrintTestName ( const char *  test_case,
const char *  test 
)
inlinestatic

Definition at line 3032 of file gtest.cc.

3032  {
3033  printf("%s.%s", test_case, test);
3034  }
static void testing::internal::PrettyUnitTestResultPrinter::PrintTestName ( const char *  test_case,
const char *  test 
)
inlinestatic

Definition at line 3032 of file gtest.cc.

3032  {
3033  printf("%s.%s", test_case, test);
3034  }
static void testing::internal::PrettyUnitTestResultPrinter::PrintTestName ( const char *  test_case,
const char *  test 
)
inlinestatic

Definition at line 3032 of file gtest.cc.

3032  {
3033  printf("%s.%s", test_case, test);
3034  }

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