1 #ifndef THIRD_PARTY_LLVM_LLVM_TOOLS_CLANG_TOOLS_EXTRA_TEST_CLANG_TIDY_INPUTS_GTEST_GTEST_H_ 2 #define THIRD_PARTY_LLVM_LLVM_TOOLS_CLANG_TOOLS_EXTRA_TEST_CLANG_TIDY_INPUTS_GTEST_GTEST_H_ 3 4 #include "gtest/gtest-typed-test.h" 5 6 namespace testing { 7 8 class Test { 9 public: 10 static void SetUpTestCase(); 11 static void TearDownTestCase(); 12 13 static void SetUpTestSuite(); 14 static void TearDownTestSuite(); 15 }; 16 17 class TestSuite {}; 18 using TestCase = TestSuite; 19 20 class TestInfo { 21 public: 22 const char *test_case_name() const; 23 24 const char *test_suite_name() const; 25 }; 26 27 class TestEventListener { 28 public: 29 virtual void OnTestCaseStart(const TestCase &); 30 virtual void OnTestCaseEnd(const TestCase &); 31 32 virtual void OnTestSuiteStart(const TestCase &); 33 virtual void OnTestSuiteEnd(const TestCase &); 34 }; 35 36 class EmptyTestEventListener : public TestEventListener { 37 public: 38 void OnTestCaseStart(const TestCase &) override; 39 void OnTestCaseEnd(const TestCase &) override; 40 41 void OnTestSuiteStart(const TestCase &) override; 42 void OnTestSuiteEnd(const TestCase &) override; 43 }; 44 45 class UnitTest { 46 public: 47 static UnitTest *GetInstance(); 48 49 TestCase *current_test_case() const; 50 int successful_test_case_count() const; 51 int failed_test_case_count() const; 52 int total_test_case_count() const; 53 int test_case_to_run_count() const; 54 const TestCase *GetTestCase(int) const; 55 56 TestSuite *current_test_suite() const; 57 int successful_test_suite_count() const; 58 int failed_test_suite_count() const; 59 int total_test_suite_count() const; 60 int test_suite_to_run_count() const; 61 const TestSuite *GetTestSuite(int) const; 62 }; 63 64 } // namespace testing 65 66 #endif // THIRD_PARTY_LLVM_LLVM_TOOLS_CLANG_TOOLS_EXTRA_TEST_CLANG_TIDY_INPUTS_GTEST_GTEST_H_ 67