diff --git a/googletest/samples/sample9_unittest.cc b/googletest/samples/sample9_unittest.cc index e502d08d..0245b531 100644 --- a/googletest/samples/sample9_unittest.cc +++ b/googletest/samples/sample9_unittest.cc @@ -29,7 +29,7 @@ // This sample shows how to use Google Test listener API to implement // an alternative console output and how to use the UnitTest reflection API -// to enumerate test cases and tests and to inspect their results. +// to enumerate test suites and tests and to inspect their results. #include @@ -38,7 +38,7 @@ using ::testing::EmptyTestEventListener; using ::testing::InitGoogleTest; using ::testing::Test; -using ::testing::TestCase; +using ::testing::TestSuite; using ::testing::TestEventListeners; using ::testing::TestInfo; using ::testing::TestPartResult; @@ -61,7 +61,7 @@ class TersePrinter : public EmptyTestEventListener { void OnTestStart(const TestInfo& test_info) override { fprintf(stdout, "*** Test %s.%s starting.\n", - test_info.test_case_name(), + test_info.test_suite_name(), test_info.name()); fflush(stdout); } @@ -81,7 +81,7 @@ class TersePrinter : public EmptyTestEventListener { void OnTestEnd(const TestInfo& test_info) override { fprintf(stdout, "*** Test %s.%s ending.\n", - test_info.test_case_name(), + test_info.test_suite_name(), test_info.name()); fflush(stdout); } diff --git a/googletest/src/gtest-internal-inl.h b/googletest/src/gtest-internal-inl.h index 0b25d2f0..62b5b10a 100644 --- a/googletest/src/gtest-internal-inl.h +++ b/googletest/src/gtest-internal-inl.h @@ -1148,15 +1148,15 @@ class StreamingListener : public EmptyTestEventListener { // Note that "event=TestCaseStart" is a wire format and has to remain // "case" for compatibility - void OnTestCaseStart(const TestCase& test_case) override { - SendLn(std::string("event=TestCaseStart&name=") + test_case.name()); + void OnTestSuiteStart(const TestSuite& test_suite) override { + SendLn(std::string("event=TestCaseStart&name=") + test_suite.name()); } // Note that "event=TestCaseEnd" is a wire format and has to remain // "case" for compatibility - void OnTestCaseEnd(const TestCase& test_case) override { - SendLn("event=TestCaseEnd&passed=" + FormatBool(test_case.Passed()) + - "&elapsed_time=" + StreamableToString(test_case.elapsed_time()) + + void OnTestSuiteEnd(const TestSuite& test_suite) override { + SendLn("event=TestCaseEnd&passed=" + FormatBool(test_suite.Passed()) + + "&elapsed_time=" + StreamableToString(test_suite.elapsed_time()) + "ms"); } diff --git a/googletest/test/gtest_unittest.cc b/googletest/test/gtest_unittest.cc index f70ca695..0f10df55 100644 --- a/googletest/test/gtest_unittest.cc +++ b/googletest/test/gtest_unittest.cc @@ -111,15 +111,15 @@ TEST_F(StreamingListenerTest, OnTestIterationEnd) { EXPECT_EQ("event=TestIterationEnd&passed=1&elapsed_time=0ms\n", *output()); } -TEST_F(StreamingListenerTest, OnTestCaseStart) { +TEST_F(StreamingListenerTest, OnTestSuiteStart) { *output() = ""; - streamer_.OnTestCaseStart(TestCase("FooTest", "Bar", nullptr, nullptr)); + streamer_.OnTestSuiteStart(TestSuite("FooTest", "Bar", nullptr, nullptr)); EXPECT_EQ("event=TestCaseStart&name=FooTest\n", *output()); } -TEST_F(StreamingListenerTest, OnTestCaseEnd) { +TEST_F(StreamingListenerTest, OnTestSuiteEnd) { *output() = ""; - streamer_.OnTestCaseEnd(TestCase("FooTest", "Bar", nullptr, nullptr)); + streamer_.OnTestSuiteEnd(TestSuite("FooTest", "Bar", nullptr, nullptr)); EXPECT_EQ("event=TestCaseEnd&passed=1&elapsed_time=0ms\n", *output()); }