32 #ifndef GTEST_INCLUDE_GTEST_GTEST_TEST_PART_H_
33 #define GTEST_INCLUDE_GTEST_GTEST_TEST_PART_H_
63 TestPartResult(Type a_type,
const char* a_file_name,
int a_line_number,
64 const char* a_message)
66 file_name_(a_file_name ==
nullptr ?
"" : a_file_name),
67 line_number_(a_line_number),
68 summary_(ExtractSummary(a_message)),
69 message_(a_message) {}
72 Type type()
const {
return type_; }
77 return file_name_.empty() ? nullptr : file_name_.c_str();
82 int line_number()
const {
return line_number_; }
85 const char* summary()
const {
return summary_.c_str(); }
88 const char* message()
const {
return message_.c_str(); }
91 bool skipped()
const {
return type_ == kSkip; }
94 bool passed()
const {
return type_ == kSuccess; }
97 bool nonfatally_failed()
const {
return type_ == kNonFatalFailure; }
100 bool fatally_failed()
const {
return type_ == kFatalFailure; }
103 bool failed()
const {
return fatally_failed() || nonfatally_failed(); }
110 static std::string ExtractSummary(
const char* message);
123 std::ostream&
operator<<(std::ostream& os,
const TestPartResult& result);
131 TestPartResultArray() {}
134 void Append(
const TestPartResult& result);
137 const TestPartResult& GetTestPartResult(
int index)
const;
143 std::vector<TestPartResult> array_;
149 class GTEST_API_ TestPartResultReporterInterface {
151 virtual ~TestPartResultReporterInterface() {}
153 virtual void ReportTestPartResult(
const TestPartResult& result) = 0;
165 :
public TestPartResultReporterInterface {
167 HasNewFatalFailureHelper();
168 ~HasNewFatalFailureHelper()
override;
169 void ReportTestPartResult(
const TestPartResult& result)
override;
170 bool has_new_fatal_failure()
const {
return has_new_fatal_failure_; }
172 bool has_new_fatal_failure_;
173 TestPartResultReporterInterface* original_reporter_;
#define GTEST_DISABLE_MSC_WARNINGS_POP_()
#define GTEST_DISALLOW_COPY_AND_ASSIGN_(type)
GTEST_DISABLE_MSC_WARNINGS_PUSH_(4251) namespace testing
constexpr const char * file_name(const char *str)
std::ostream & operator<<(std::ostream &output, const CloverFieldParam ¶m)