36 #ifndef GTEST_INCLUDE_GTEST_GTEST_SPI_H_ 37 #define GTEST_INCLUDE_GTEST_GTEST_SPI_H_ 55 class GTEST_API_ ScopedFakeTestPartResultReporter
56 :
public TestPartResultReporterInterface {
60 INTERCEPT_ONLY_CURRENT_THREAD,
68 explicit ScopedFakeTestPartResultReporter(TestPartResultArray* result);
71 ScopedFakeTestPartResultReporter(InterceptMode intercept_mode,
72 TestPartResultArray* result);
75 ~ScopedFakeTestPartResultReporter()
override;
82 void ReportTestPartResult(
const TestPartResult& result)
override;
87 const InterceptMode intercept_mode_;
88 TestPartResultReporterInterface* old_reporter_;
89 TestPartResultArray*
const result_;
104 SingleFailureChecker(
const TestPartResultArray* results,
105 TestPartResult::Type
type,
const std::string& substr);
106 ~SingleFailureChecker();
108 const TestPartResultArray*
const results_;
109 const TestPartResult::Type type_;
110 const std::string substr_;
144 #define EXPECT_FATAL_FAILURE(statement, substr) \ 146 class GTestExpectFatalFailureHelper {\ 148 static void Execute() { statement; }\ 150 ::testing::TestPartResultArray gtest_failures;\ 151 ::testing::internal::SingleFailureChecker gtest_checker(\ 152 >est_failures, ::testing::TestPartResult::kFatalFailure, (substr));\ 154 ::testing::ScopedFakeTestPartResultReporter gtest_reporter(\ 155 ::testing::ScopedFakeTestPartResultReporter:: \ 156 INTERCEPT_ONLY_CURRENT_THREAD, >est_failures);\ 157 GTestExpectFatalFailureHelper::Execute();\ 159 } while (::testing::internal::AlwaysFalse()) 161 #define EXPECT_FATAL_FAILURE_ON_ALL_THREADS(statement, substr) \ 163 class GTestExpectFatalFailureHelper {\ 165 static void Execute() { statement; }\ 167 ::testing::TestPartResultArray gtest_failures;\ 168 ::testing::internal::SingleFailureChecker gtest_checker(\ 169 >est_failures, ::testing::TestPartResult::kFatalFailure, (substr));\ 171 ::testing::ScopedFakeTestPartResultReporter gtest_reporter(\ 172 ::testing::ScopedFakeTestPartResultReporter:: \ 173 INTERCEPT_ALL_THREADS, >est_failures);\ 174 GTestExpectFatalFailureHelper::Execute();\ 176 } while (::testing::internal::AlwaysFalse()) 210 #define EXPECT_NONFATAL_FAILURE(statement, substr) \ 212 ::testing::TestPartResultArray gtest_failures;\ 213 ::testing::internal::SingleFailureChecker gtest_checker(\ 214 >est_failures, ::testing::TestPartResult::kNonFatalFailure, \ 217 ::testing::ScopedFakeTestPartResultReporter gtest_reporter(\ 218 ::testing::ScopedFakeTestPartResultReporter:: \ 219 INTERCEPT_ONLY_CURRENT_THREAD, >est_failures);\ 220 if (::testing::internal::AlwaysTrue()) { statement; }\ 222 } while (::testing::internal::AlwaysFalse()) 224 #define EXPECT_NONFATAL_FAILURE_ON_ALL_THREADS(statement, substr) \ 226 ::testing::TestPartResultArray gtest_failures;\ 227 ::testing::internal::SingleFailureChecker gtest_checker(\ 228 >est_failures, ::testing::TestPartResult::kNonFatalFailure, \ 231 ::testing::ScopedFakeTestPartResultReporter gtest_reporter(\ 232 ::testing::ScopedFakeTestPartResultReporter::INTERCEPT_ALL_THREADS, \ 234 if (::testing::internal::AlwaysTrue()) { statement; }\ 236 } while (::testing::internal::AlwaysFalse()) 238 #endif // GTEST_INCLUDE_GTEST_GTEST_SPI_H_ Definition: gmock-actions.h:59
#define GTEST_DISABLE_MSC_WARNINGS_POP_()
Definition: gtest-port.h:314
#define GTEST_API_
Definition: gtest-port.h:759
type
Definition: upload.py:443
GTEST_DISABLE_MSC_WARNINGS_PUSH_(4251) namespace testing
Definition: gtest-spi.h:41
#define GTEST_DISALLOW_COPY_AND_ASSIGN_(type)
Definition: gtest-port.h:688