32 #ifndef GOOGLETEST_INCLUDE_GTEST_GTEST_TEST_PART_H_
33 #define GOOGLETEST_INCLUDE_GTEST_GTEST_TEST_PART_H_
37 #include "gtest/internal/gtest-internal.h"
38 #include "gtest/internal/gtest-string.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_; }
76 const char* file_name()
const {
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);
114 std::string file_name_;
118 std::string summary_;
119 std::string 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_;
GTEST_DISABLE_MSC_WARNINGS_PUSH_(4251) namespace testing
Definition: cmake-build-debug/googletest-src/googletest/include/gtest/gtest-test-part.h:40
#define GTEST_API_
Definition: cmake-build-debug/googletest-src/googletest/include/gtest/internal/gtest-port.h:775
#define GTEST_DISABLE_MSC_WARNINGS_POP_()
Definition: cmake-build-debug/googletest-src/googletest/include/gtest/internal/gtest-port.h:324
#define GTEST_DISALLOW_COPY_AND_ASSIGN_(type)
Definition: cmake-build-debug/googletest-src/googletest/include/gtest/internal/gtest-port.h:693
Definition: cmake-build-debug/googletest-src/googlemock/include/gmock/gmock-actions.h:154
std::ostream & operator<<(std::ostream &os, const Message &sb)
Definition: cmake-build-debug/googletest-src/googletest/include/gtest/gtest-message.h:199