MCPcopy Create free account
hub / github.com/awslabs/aws-lambda-cpp / OnTestIterationStart

Method OnTestIterationStart

tests/gtest/gtest-all.cc:4622–4655  ·  view source on GitHub ↗

Fired before each iteration of tests starts.

Source from the content-addressed store, hash-verified

4620
4621 // Fired before each iteration of tests starts.
4622void PrettyUnitTestResultPrinter::OnTestIterationStart(
4623 const UnitTest& unit_test, int iteration) {
4624 if (GTEST_FLAG(repeat) != 1)
4625 printf("\nRepeating all tests (iteration %d) . . .\n\n", iteration + 1);
4626
4627 const char* const filter = GTEST_FLAG(filter).c_str();
4628
4629 // Prints the filter if it's not *. This reminds the user that some
4630 // tests may be skipped.
4631 if (!String::CStringEquals(filter, kUniversalFilter)) {
4632 ColoredPrintf(COLOR_YELLOW,
4633 "Note: %s filter = %s\n", GTEST_NAME_, filter);
4634 }
4635
4636 if (internal::ShouldShard(kTestTotalShards, kTestShardIndex, false)) {
4637 const Int32 shard_index = Int32FromEnvOrDie(kTestShardIndex, -1);
4638 ColoredPrintf(COLOR_YELLOW,
4639 "Note: This is test shard %d of %s.\n",
4640 static_cast<int>(shard_index) + 1,
4641 internal::posix::GetEnv(kTestTotalShards));
4642 }
4643
4644 if (GTEST_FLAG(shuffle)) {
4645 ColoredPrintf(COLOR_YELLOW,
4646 "Note: Randomizing tests' orders with a seed of %d .\n",
4647 unit_test.random_seed());
4648 }
4649
4650 ColoredPrintf(COLOR_GREEN, "[==========] ");
4651 printf("Running %s from %s.\n",
4652 FormatTestCount(unit_test.test_to_run_count()).c_str(),
4653 FormatTestSuiteCount(unit_test.test_suite_to_run_count()).c_str());
4654 fflush(stdout);
4655}
4656
4657void PrettyUnitTestResultPrinter::OnEnvironmentsSetUpStart(
4658 const UnitTest& /*unit_test*/) {

Callers 1

RunAllTestsMethod · 0.45

Calls 10

ColoredPrintfFunction · 0.85
ShouldShardFunction · 0.85
Int32FromEnvOrDieFunction · 0.85
GetEnvFunction · 0.85
FormatTestCountFunction · 0.85
FormatTestSuiteCountFunction · 0.85
random_seedMethod · 0.80
test_to_run_countMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected