52#ifndef GTEST_INCLUDE_GTEST_GTEST_H_
53#define GTEST_INCLUDE_GTEST_GTEST_H_
82# pragma warning(disable:4805)
83# pragma warning(disable:4100)
162#if GTEST_USE_OWN_FLAGFILE_FLAG_
167const int kMaxStackTraceDepth = 100;
172class DefaultGlobalTestPartResultReporter;
174class NoExecDeathTest;
175class FinalSuccessChecker;
177class StreamingListenerTest;
178class TestResultAccessor;
179class TestEventListenersAccessor;
180class TestEventRepeater;
181class UnitTestRecordPropertyTestHelper;
182class WindowsDeathTest;
183class FuchsiaDeathTest;
184class UnitTestImpl* GetUnitTestImpl();
185void ReportFailureInUnknownLocation(TestPartResult::Type result_type,
186 const std::string& message);
187std::set<std::string>* GetIgnoredParameterizedTestSuites();
198#ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_
199using TestCase = TestSuite;
287 AssertionResult(
const AssertionResult& other);
293#if defined(_MSC_VER) && (_MSC_VER < 1910 || _MSC_VER >= 1920)
304 template <
typename T>
305 explicit AssertionResult(
307 typename std::enable_if<
308 !std::is_convertible<T, AssertionResult>::value>::type*
311 : success_(success) {}
313#if defined(_MSC_VER) && (_MSC_VER < 1910 || _MSC_VER >= 1920)
318 AssertionResult& operator=(AssertionResult other) {
324 operator bool()
const {
return success_; }
327 AssertionResult operator!()
const;
333 const char* message()
const {
334 return message_.get() !=
nullptr ? message_->c_str() :
"";
337 const char* failure_message()
const {
return message(); }
341 AppendMessage(Message() <<
value);
348 ::std::ostream& (*basic_manipulator)(::std::ostream& stream)) {
349 AppendMessage(Message() << basic_manipulator);
355 void AppendMessage(
const Message& a_message) {
356 if (message_.get() ==
nullptr) message_.reset(new ::std::string);
357 message_->append(a_message.GetString().c_str());
361 void swap(AssertionResult& other);
369 std::unique_ptr< ::std::string> message_;
380GTEST_API_ AssertionResult AssertionFailure(
const Message& msg);
438#ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_
444 static bool HasFatalFailure();
447 static bool HasNonfatalFailure();
450 static bool IsSkipped();
454 static bool HasFailure() {
return HasFatalFailure() || HasNonfatalFailure(); }
469 static void RecordProperty(
const std::string& key,
const std::string&
value);
470 static void RecordProperty(
const std::string& key,
int value);
477 virtual void SetUp();
480 virtual void TearDown();
485 static bool HasSameFixtureClass();
580 int total_part_count()
const;
583 int test_property_count()
const;
586 bool Passed()
const {
return !Skipped() && !Failed(); }
589 bool Skipped()
const;
595 bool HasFatalFailure()
const;
598 bool HasNonfatalFailure()
const;
609 const TestPartResult& GetTestPartResult(
int i)
const;
620 friend class internal::DefaultGlobalTestPartResultReporter;
621 friend class internal::ExecDeathTest;
622 friend class internal::TestResultAccessor;
623 friend class internal::UnitTestImpl;
624 friend class internal::WindowsDeathTest;
625 friend class internal::FuchsiaDeathTest;
629 return test_part_results_;
634 return test_properties_;
649 void RecordProperty(
const std::string& xml_element,
655 static bool ValidateTestProperty(
const std::string& xml_element,
659 void AddTestPartResult(
const TestPartResult& test_part_result);
668 void ClearTestPartResults();
713#ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_
723 if (type_param_.get() !=
nullptr)
return type_param_->c_str();
730 if (value_param_.get() !=
nullptr)
return value_param_->c_str();
735 const char*
file()
const {
return location_.file.c_str(); }
738 int line()
const {
return location_.line; }
765 return matches_filter_ && !is_in_another_shard_;
772#if GTEST_HAS_DEATH_TEST
773 friend class internal::DefaultDeathTestFactory;
777 friend class internal::UnitTestImpl;
778 friend class internal::StreamingListenerTest;
779 friend TestInfo* internal::MakeAndRegisterTestInfo(
780 const char* test_suite_name,
const char* name,
const char* type_param,
788 TestInfo(
const std::string& test_suite_name,
const std::string& name,
789 const char* a_type_param,
790 const char* a_value_param,
798 return result_.increment_death_test_count();
855 TestSuite(
const char* name,
const char* a_type_param,
868 if (type_param_.get() !=
nullptr)
return type_param_->c_str();
876 int successful_test_count()
const;
879 int skipped_test_count()
const;
882 int failed_test_count()
const;
885 int reportable_disabled_test_count()
const;
888 int disabled_test_count()
const;
891 int reportable_test_count()
const;
894 int test_to_run_count()
const;
897 int total_test_count()
const;
900 bool Passed()
const {
return !Failed(); }
904 return failed_test_count() > 0 || ad_hoc_test_result().Failed();
916 const TestInfo* GetTestInfo(
int i)
const;
924 friend class internal::UnitTestImpl;
931 return test_info_list_;
943 void AddTestInfo(
TestInfo * test_info);
962 if (set_up_tc_ !=
nullptr) {
970 if (tear_down_tc_ !=
nullptr) {
1015 void UnshuffleTests();
1078#if GTEST_HAS_EXCEPTIONS
1082 :
public internal::GoogleTestFailureException {
1084 explicit AssertionException(
const TestPartResult& result)
1085 : GoogleTestFailureException(result) {}
1115#ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_
1134#ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_
1166#ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_
1174#ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_
1207 return default_result_printer_;
1218 return default_xml_generator_;
1224 friend class internal::DefaultGlobalTestPartResultReporter;
1225 friend class internal::NoExecDeathTest;
1227 friend class internal::UnitTestImpl;
1249 bool EventForwardingEnabled()
const;
1250 void SuppressEventForwarding();
1290 const char* original_working_dir()
const;
1297#ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_
1303 const TestInfo* current_test_info()
const
1307 int random_seed()
const;
1317 int successful_test_suite_count()
const;
1320 int failed_test_suite_count()
const;
1323 int total_test_suite_count()
const;
1327 int test_suite_to_run_count()
const;
1330#ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_
1331 int successful_test_case_count()
const;
1332 int failed_test_case_count()
const;
1333 int total_test_case_count()
const;
1334 int test_case_to_run_count()
const;
1338 int successful_test_count()
const;
1341 int skipped_test_count()
const;
1344 int failed_test_count()
const;
1347 int reportable_disabled_test_count()
const;
1350 int disabled_test_count()
const;
1353 int reportable_test_count()
const;
1356 int total_test_count()
const;
1359 int test_to_run_count()
const;
1370 bool Passed()
const;
1374 bool Failed()
const;
1381#ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_
1382 const TestCase* GetTestCase(
int i)
const;
1387 const TestResult& ad_hoc_test_result()
const;
1409 void AddTestPartResult(TestPartResult::Type result_type,
1410 const char* file_name,
1412 const std::string& message,
1413 const std::string& os_stack_trace)
1421 void RecordProperty(
const std::string& key,
const std::string&
value);
1428 internal::UnitTestImpl*
impl() {
return impl_; }
1429 const internal::UnitTestImpl*
impl()
const {
return impl_; }
1436 friend class internal::StreamingListenerTest;
1439 friend std::set<std::string>* internal::GetIgnoredParameterizedTestSuites();
1440 friend internal::UnitTestImpl* internal::GetUnitTestImpl();
1441 friend void internal::ReportFailureInUnknownLocation(
1442 TestPartResult::Type result_type,
1443 const std::string& message);
1453 void PushGTestTrace(
const internal::TraceInfo& trace)
1457 void PopGTestTrace()
1462 mutable internal::Mutex mutex_;
1468 internal::UnitTestImpl* impl_;
1493 return UnitTest::GetInstance()->AddEnvironment(env);
1520template <
typename T1,
typename T2>
1522 const char* rhs_expression,
1523 const T1& lhs,
const T2& rhs) {
1524 return EqFailure(lhs_expression,
1539template <
typename T1,
typename T2>
1541 const char* rhs_expression,
1545 return AssertionSuccess();
1554GTEST_API_ AssertionResult CmpHelperEQ(
const char* lhs_expression,
1555 const char* rhs_expression,
1563 typename T1,
typename T2,
1566 typename std::enable_if<!std::is_integral<T1>::value ||
1567 !std::is_pointer<T2>::value>::type* =
nullptr>
1568 static AssertionResult
Compare(
const char* lhs_expression,
1569 const char* rhs_expression,
const T1& lhs,
1571 return CmpHelperEQ(lhs_expression, rhs_expression, lhs, rhs);
1580 static AssertionResult
Compare(
const char* lhs_expression,
1581 const char* rhs_expression,
1584 return CmpHelperEQ(lhs_expression, rhs_expression, lhs, rhs);
1587 template <
typename T>
1589 const char* lhs_expression,
const char* rhs_expression,
1591 std::nullptr_t , T* rhs) {
1593 return CmpHelperEQ(lhs_expression, rhs_expression,
static_cast<T*
>(
nullptr),
1601template <
typename T1,
typename T2>
1603 const T1& val1,
const T2& val2,
1605 return AssertionFailure()
1606 <<
"Expected: (" << expr1 <<
") " << op <<
" (" << expr2
1622#define GTEST_IMPL_CMP_HELPER_(op_name, op)\
1623template <typename T1, typename T2>\
1624AssertionResult CmpHelper##op_name(const char* expr1, const char* expr2, \
1625 const T1& val1, const T2& val2) {\
1626 if (val1 op val2) {\
1627 return AssertionSuccess();\
1629 return CmpHelperOpFailure(expr1, expr2, val1, val2, #op);\
1632GTEST_API_ AssertionResult CmpHelper##op_name(\
1633 const char* expr1, const char* expr2, BiggestInt val1, BiggestInt val2)
1648#undef GTEST_IMPL_CMP_HELPER_
1654 const char* s2_expression,
1662 const char* s2_expression,
1670 const char* s2_expression,
1678 const char* s2_expression,
1687 const char* s2_expression,
1695 const char* s2_expression,
1710 const char* needle_expr,
const char* haystack_expr,
1711 const char* needle,
const char* haystack);
1713 const char* needle_expr,
const char* haystack_expr,
1714 const wchar_t* needle,
const wchar_t* haystack);
1716 const char* needle_expr,
const char* haystack_expr,
1717 const char* needle,
const char* haystack);
1719 const char* needle_expr,
const char* haystack_expr,
1720 const wchar_t* needle,
const wchar_t* haystack);
1722 const char* needle_expr,
const char* haystack_expr,
1723 const ::std::string& needle, const ::std::string& haystack);
1725 const char* needle_expr,
const char* haystack_expr,
1726 const ::std::string& needle, const ::std::string& haystack);
1728#if GTEST_HAS_STD_WSTRING
1730 const char* needle_expr,
const char* haystack_expr,
1731 const ::std::wstring& needle, const ::std::wstring& haystack);
1733 const char* needle_expr,
const char* haystack_expr,
1734 const ::std::wstring& needle, const ::std::wstring& haystack);
1746template <
typename RawType>
1748 const char* rhs_expression,
1750 RawType rhs_value) {
1753 if (lhs.AlmostEquals(rhs)) {
1754 return AssertionSuccess();
1757 ::std::stringstream lhs_ss;
1758 lhs_ss << std::setprecision(std::numeric_limits<RawType>::digits10 + 2)
1761 ::std::stringstream rhs_ss;
1762 rhs_ss << std::setprecision(std::numeric_limits<RawType>::digits10 + 2)
1765 return EqFailure(lhs_expression,
1775GTEST_API_ AssertionResult DoubleNearPredFormat(
const char* expr1,
1777 const char* abs_error_expr,
1790 const char* message);
1795 void operator=(
const Message& message)
const;
1804 const char* srcfile,
1807 : type(t), file(srcfile), line(line_num), message(msg) { }
1859template <
typename T>
1869 <<
"GetParam() can only be called inside a value-parameterized test "
1870 <<
"-- did you intend to write TEST_P instead of TEST_F?";
1878 parameter_ = parameter;
1888template <
typename T>
1894template <
typename T>
1903#define GTEST_SKIP() GTEST_SKIP_("")
1923#define ADD_FAILURE() GTEST_NONFATAL_FAILURE_("Failed")
1927#define ADD_FAILURE_AT(file, line) \
1928 GTEST_MESSAGE_AT_(file, line, "Failed", \
1929 ::testing::TestPartResult::kNonFatalFailure)
1932#define GTEST_FAIL() GTEST_FATAL_FAILURE_("Failed")
1935#define GTEST_FAIL_AT(file, line) \
1936 GTEST_MESSAGE_AT_(file, line, "Failed", \
1937 ::testing::TestPartResult::kFatalFailure)
1941#if !GTEST_DONT_DEFINE_FAIL
1942# define FAIL() GTEST_FAIL()
1946#define GTEST_SUCCEED() GTEST_SUCCESS_("Succeeded")
1950#if !GTEST_DONT_DEFINE_SUCCEED
1951# define SUCCEED() GTEST_SUCCEED()
1963#define EXPECT_THROW(statement, expected_exception) \
1964 GTEST_TEST_THROW_(statement, expected_exception, GTEST_NONFATAL_FAILURE_)
1965#define EXPECT_NO_THROW(statement) \
1966 GTEST_TEST_NO_THROW_(statement, GTEST_NONFATAL_FAILURE_)
1967#define EXPECT_ANY_THROW(statement) \
1968 GTEST_TEST_ANY_THROW_(statement, GTEST_NONFATAL_FAILURE_)
1969#define ASSERT_THROW(statement, expected_exception) \
1970 GTEST_TEST_THROW_(statement, expected_exception, GTEST_FATAL_FAILURE_)
1971#define ASSERT_NO_THROW(statement) \
1972 GTEST_TEST_NO_THROW_(statement, GTEST_FATAL_FAILURE_)
1973#define ASSERT_ANY_THROW(statement) \
1974 GTEST_TEST_ANY_THROW_(statement, GTEST_FATAL_FAILURE_)
1979#define EXPECT_TRUE(condition) \
1980 GTEST_TEST_BOOLEAN_(condition, #condition, false, true, \
1981 GTEST_NONFATAL_FAILURE_)
1982#define EXPECT_FALSE(condition) \
1983 GTEST_TEST_BOOLEAN_(!(condition), #condition, true, false, \
1984 GTEST_NONFATAL_FAILURE_)
1985#define ASSERT_TRUE(condition) \
1986 GTEST_TEST_BOOLEAN_(condition, #condition, false, true, \
1987 GTEST_FATAL_FAILURE_)
1988#define ASSERT_FALSE(condition) \
1989 GTEST_TEST_BOOLEAN_(!(condition), #condition, true, false, \
1990 GTEST_FATAL_FAILURE_)
2038#define EXPECT_EQ(val1, val2) \
2039 EXPECT_PRED_FORMAT2(::testing::internal::EqHelper::Compare, val1, val2)
2040#define EXPECT_NE(val1, val2) \
2041 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperNE, val1, val2)
2042#define EXPECT_LE(val1, val2) \
2043 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperLE, val1, val2)
2044#define EXPECT_LT(val1, val2) \
2045 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperLT, val1, val2)
2046#define EXPECT_GE(val1, val2) \
2047 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperGE, val1, val2)
2048#define EXPECT_GT(val1, val2) \
2049 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperGT, val1, val2)
2051#define GTEST_ASSERT_EQ(val1, val2) \
2052 ASSERT_PRED_FORMAT2(::testing::internal::EqHelper::Compare, val1, val2)
2053#define GTEST_ASSERT_NE(val1, val2) \
2054 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperNE, val1, val2)
2055#define GTEST_ASSERT_LE(val1, val2) \
2056 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperLE, val1, val2)
2057#define GTEST_ASSERT_LT(val1, val2) \
2058 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperLT, val1, val2)
2059#define GTEST_ASSERT_GE(val1, val2) \
2060 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperGE, val1, val2)
2061#define GTEST_ASSERT_GT(val1, val2) \
2062 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperGT, val1, val2)
2067#if !GTEST_DONT_DEFINE_ASSERT_EQ
2068# define ASSERT_EQ(val1, val2) GTEST_ASSERT_EQ(val1, val2)
2071#if !GTEST_DONT_DEFINE_ASSERT_NE
2072# define ASSERT_NE(val1, val2) GTEST_ASSERT_NE(val1, val2)
2075#if !GTEST_DONT_DEFINE_ASSERT_LE
2076# define ASSERT_LE(val1, val2) GTEST_ASSERT_LE(val1, val2)
2079#if !GTEST_DONT_DEFINE_ASSERT_LT
2080# define ASSERT_LT(val1, val2) GTEST_ASSERT_LT(val1, val2)
2083#if !GTEST_DONT_DEFINE_ASSERT_GE
2084# define ASSERT_GE(val1, val2) GTEST_ASSERT_GE(val1, val2)
2087#if !GTEST_DONT_DEFINE_ASSERT_GT
2088# define ASSERT_GT(val1, val2) GTEST_ASSERT_GT(val1, val2)
2107#define EXPECT_STREQ(s1, s2) \
2108 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTREQ, s1, s2)
2109#define EXPECT_STRNE(s1, s2) \
2110 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRNE, s1, s2)
2111#define EXPECT_STRCASEEQ(s1, s2) \
2112 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASEEQ, s1, s2)
2113#define EXPECT_STRCASENE(s1, s2)\
2114 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASENE, s1, s2)
2116#define ASSERT_STREQ(s1, s2) \
2117 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTREQ, s1, s2)
2118#define ASSERT_STRNE(s1, s2) \
2119 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRNE, s1, s2)
2120#define ASSERT_STRCASEEQ(s1, s2) \
2121 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASEEQ, s1, s2)
2122#define ASSERT_STRCASENE(s1, s2)\
2123 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASENE, s1, s2)
2139#define EXPECT_FLOAT_EQ(val1, val2)\
2140 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<float>, \
2143#define EXPECT_DOUBLE_EQ(val1, val2)\
2144 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<double>, \
2147#define ASSERT_FLOAT_EQ(val1, val2)\
2148 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<float>, \
2151#define ASSERT_DOUBLE_EQ(val1, val2)\
2152 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<double>, \
2155#define EXPECT_NEAR(val1, val2, abs_error)\
2156 EXPECT_PRED_FORMAT3(::testing::internal::DoubleNearPredFormat, \
2157 val1, val2, abs_error)
2159#define ASSERT_NEAR(val1, val2, abs_error)\
2160 ASSERT_PRED_FORMAT3(::testing::internal::DoubleNearPredFormat, \
2161 val1, val2, abs_error)
2170GTEST_API_ AssertionResult FloatLE(
const char* expr1,
const char* expr2,
2171 float val1,
float val2);
2172GTEST_API_ AssertionResult DoubleLE(
const char* expr1,
const char* expr2,
2173 double val1,
double val2);
2187# define EXPECT_HRESULT_SUCCEEDED(expr) \
2188 EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr))
2190# define ASSERT_HRESULT_SUCCEEDED(expr) \
2191 ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr))
2193# define EXPECT_HRESULT_FAILED(expr) \
2194 EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr))
2196# define ASSERT_HRESULT_FAILED(expr) \
2197 ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr))
2211#define ASSERT_NO_FATAL_FAILURE(statement) \
2212 GTEST_TEST_NO_FATAL_FAILURE_(statement, GTEST_FATAL_FAILURE_)
2213#define EXPECT_NO_FATAL_FAILURE(statement) \
2214 GTEST_TEST_NO_FATAL_FAILURE_(statement, GTEST_NONFATAL_FAILURE_)
2233 template <
typename T>
2235 PushTrace(file, line, (
Message() << message).GetString());
2240 PushTrace(file, line, message ? message :
"(null)");
2244 PushTrace(file, line, message);
2254 void PushTrace(
const char* file,
int line, std::string message);
2276#define SCOPED_TRACE(message) \
2277 ::testing::ScopedTrace GTEST_CONCAT_TOKEN_(gtest_trace_, __LINE__)(\
2278 __FILE__, __LINE__, (message))
2310template <
typename T1,
typename T2>
2311constexpr bool StaticAssertTypeEq() noexcept {
2312 static_assert(std::is_same<T1, T2>::value,
"T1 and T2 are not the same type");
2341#define GTEST_TEST(test_suite_name, test_name) \
2342 GTEST_TEST_(test_suite_name, test_name, ::testing::Test, \
2343 ::testing::internal::GetTestTypeId())
2347#if !GTEST_DONT_DEFINE_TEST
2348#define TEST(test_suite_name, test_name) GTEST_TEST(test_suite_name, test_name)
2378#if !GTEST_DONT_DEFINE_TEST
2379#define TEST_F(test_fixture, test_name)\
2380 GTEST_TEST_(test_fixture, test_name, test_fixture, \
2381 ::testing::internal::GetTypeId<test_fixture>())
2389# pragma warning(pop)
2449template <
int&... ExplicitParameterBarrier,
typename Factory>
2451 const char* type_param,
const char* value_param,
2452 const char* file,
int line, Factory factory) {
2453 using TestT =
typename std::remove_pointer<
decltype(factory())>::type;
2457 explicit FactoryImpl(Factory f) : factory_(std::move(f)) {}
2458 Test* CreateTest()
override {
return factory_(); }
2464 return internal::MakeAndRegisterTestInfo(
2465 test_suite_name, test_name, type_param, value_param,
2469 new FactoryImpl{std::move(factory)});
2485 return ::testing::UnitTest::GetInstance()->Run();
std::ostream & operator<<(std::ostream &os, const Epetra_Object &obj)
void OnTestStart(const TestInfo &) override
void OnTestSuiteStart(const TestSuite &) override
void OnTestIterationStart(const UnitTest &, int) override
void OnEnvironmentsTearDownStart(const UnitTest &) override
void OnEnvironmentsSetUpStart(const UnitTest &) override
void OnTestEnd(const TestInfo &) override
void OnTestCaseStart(const TestCase &) override
void OnEnvironmentsSetUpEnd(const UnitTest &) override
void OnTestProgramEnd(const UnitTest &) override
void OnTestIterationEnd(const UnitTest &, int) override
void OnTestPartResult(const TestPartResult &) override
void OnTestCaseEnd(const TestCase &) override
void OnTestProgramStart(const UnitTest &) override
void OnEnvironmentsTearDownEnd(const UnitTest &) override
void OnTestSuiteEnd(const TestSuite &) override
virtual Setup_should_be_spelled_SetUp * Setup()
ScopedTrace(const char *file, int line, const std::string &message)
ScopedTrace(const char *file, int line, const T &message)
ScopedTrace(const char *file, int line, const char *message)
GTEST_DISALLOW_COPY_AND_ASSIGN_(ScopedTrace)
virtual void OnTestPartResult(const TestPartResult &test_part_result)=0
virtual void OnTestSuiteStart(const TestSuite &)
virtual ~TestEventListener()
virtual void OnEnvironmentsTearDownStart(const UnitTest &unit_test)=0
virtual void OnTestIterationEnd(const UnitTest &unit_test, int iteration)=0
virtual void OnTestProgramStart(const UnitTest &unit_test)=0
virtual void OnTestIterationStart(const UnitTest &unit_test, int iteration)=0
virtual void OnTestCaseEnd(const TestCase &)
virtual void OnTestSuiteEnd(const TestSuite &)
virtual void OnEnvironmentsTearDownEnd(const UnitTest &unit_test)=0
virtual void OnEnvironmentsSetUpStart(const UnitTest &unit_test)=0
virtual void OnEnvironmentsSetUpEnd(const UnitTest &unit_test)=0
virtual void OnTestStart(const TestInfo &test_info)=0
virtual void OnTestEnd(const TestInfo &test_info)=0
virtual void OnTestCaseStart(const TestCase &)
virtual void OnTestProgramEnd(const UnitTest &unit_test)=0
TestEventListener * default_xml_generator_
GTEST_DISALLOW_COPY_AND_ASSIGN_(TestEventListeners)
internal::TestEventRepeater * repeater_
TestEventListener * default_result_printer() const
TestEventListener * default_result_printer_
TestEventListener * default_xml_generator() const
const char * file() const
const char * value_param() const
GTEST_DISALLOW_COPY_AND_ASSIGN_(TestInfo)
bool is_reportable() const
internal::TestFactoryBase *const factory_
const std::unique_ptr< const ::std::string > type_param_
int increment_death_test_count()
internal::CodeLocation location_
bool is_in_another_shard_
bool is_in_another_shard() const
const char * type_param() const
const char * name() const
const TestResult * result() const
const std::string test_suite_name_
static void ClearTestResult(TestInfo *test_info)
const char * test_case_name() const
const internal::TypeId fixture_class_id_
const std::unique_ptr< const ::std::string > value_param_
const char * test_suite_name() const
const char * value() const
TestProperty(const std::string &a_key, const std::string &a_value)
void SetValue(const std::string &new_value)
const std::vector< TestPartResult > & test_part_results() const
int increment_death_test_count()
std::vector< TestProperty > test_properties_
const std::vector< TestProperty > & test_properties() const
void set_start_timestamp(TimeInMillis start)
internal::Mutex test_properites_mutex_
TimeInMillis elapsed_time() const
TimeInMillis elapsed_time_
int death_test_count() const
TimeInMillis start_timestamp_
void set_elapsed_time(TimeInMillis elapsed)
GTEST_DISALLOW_COPY_AND_ASSIGN_(TestResult)
TimeInMillis start_timestamp() const
std::vector< TestPartResult > test_part_results_
static bool TestDisabled(const TestInfo *test_info)
TimeInMillis start_timestamp_
static bool TestSkipped(const TestInfo *test_info)
internal::TearDownTestSuiteFunc tear_down_tc_
const char * name() const
TimeInMillis elapsed_time() const
static bool TestPassed(const TestInfo *test_info)
const char * type_param() const
const TestResult & ad_hoc_test_result() const
GTEST_DISALLOW_COPY_AND_ASSIGN_(TestSuite)
const std::unique_ptr< const ::std::string > type_param_
std::vector< TestInfo * > & test_info_list()
internal::SetUpTestSuiteFunc set_up_tc_
std::vector< TestInfo * > test_info_list_
static bool TestReportableDisabled(const TestInfo *test_info)
void set_should_run(bool should)
static bool TestReportable(const TestInfo *test_info)
std::vector< int > test_indices_
TimeInMillis start_timestamp() const
TestResult ad_hoc_test_result_
static void ClearTestSuiteResult(TestSuite *test_suite)
const std::vector< TestInfo * > & test_info_list() const
static bool ShouldRunTest(const TestInfo *test_info)
void RunTearDownTestSuite()
static bool TestFailed(const TestInfo *test_info)
TimeInMillis elapsed_time_
virtual void TestBody()=0
static void SetUpTestCase()
GTEST_DISALLOW_COPY_AND_ASSIGN_(Test)
static void TearDownTestSuite()
const std::unique_ptr< GTEST_FLAG_SAVER_ > gtest_flag_saver_
static void SetUpTestSuite()
static void TearDownTestCase()
virtual Setup_should_be_spelled_SetUp * Setup()
const internal::UnitTestImpl * impl() const
internal::UnitTestImpl * impl()
static const ParamType & GetParam()
static void SetParam(const ParamType *parameter)
virtual ~WithParamInterface()
static const ParamType * parameter_
GTEST_DISALLOW_COPY_AND_ASSIGN_(AssertHelper)
AssertHelperData *const data_
static AssertionResult Compare(const char *lhs_expression, const char *rhs_expression, const T1 &lhs, const T2 &rhs)
static AssertionResult Compare(const char *lhs_expression, const char *rhs_expression, std::nullptr_t, T *rhs)
static AssertionResult Compare(const char *lhs_expression, const char *rhs_expression, BiggestInt lhs, BiggestInt rhs)
#define GTEST_ATTRIBUTE_UNUSED_
#define GTEST_DECLARE_bool_(name)
#define GTEST_LOCK_EXCLUDED_(locks)
#define GTEST_DISABLE_MSC_WARNINGS_PUSH_(warnings)
#define GTEST_MUST_USE_RESULT_
#define GTEST_DECLARE_string_(name)
#define GTEST_DECLARE_int32_(name)
#define GTEST_DISABLE_MSC_WARNINGS_POP_()
#define GTEST_CHECK_(condition)
#define GTEST_DISALLOW_COPY_AND_ASSIGN_(type)
#define GTEST_IMPL_CMP_HELPER_(op_name, op)
int RUN_ALL_TESTS() GTEST_MUST_USE_RESULT_
AssertionResult CmpHelperEQFailure(const char *lhs_expression, const char *rhs_expression, const T1 &lhs, const T2 &rhs)
GTEST_API_ AssertionResult CmpHelperSTRCASEEQ(const char *s1_expression, const char *s2_expression, const char *s1, const char *s2)
AssertionResult CmpHelperEQ(const char *lhs_expression, const char *rhs_expression, const T1 &lhs, const T2 &rhs)
GTEST_API_ AssertionResult CmpHelperSTREQ(const char *s1_expression, const char *s2_expression, const char *s1, const char *s2)
GTEST_API_ AssertionResult CmpHelperSTRCASENE(const char *s1_expression, const char *s2_expression, const char *s1, const char *s2)
AssertionResult CmpHelperOpFailure(const char *expr1, const char *expr2, const T1 &val1, const T2 &val2, const char *op)
std::string FormatForComparisonFailureMessage(const T1 &value, const T2 &)
AssertionResult CmpHelperFloatingPointEQ(const char *lhs_expression, const char *rhs_expression, RawType lhs_value, RawType rhs_value)
GTEST_API_ std::string StringStreamToString(::std::stringstream *stream)
void(*)() SetUpTestSuiteFunc
void(*)() TearDownTestSuiteFunc
GTEST_API_ AssertionResult CmpHelperSTRNE(const char *s1_expression, const char *s2_expression, const char *s1, const char *s2)
Environment * AddGlobalTestEnvironment(Environment *env)
TestInfo * RegisterTest(const char *test_suite_name, const char *test_name, const char *type_param, const char *value_param, const char *file, int line, Factory factory)
internal::TimeInMillis TimeInMillis
GTEST_API_ void InitGoogleTest(int *argc, char **argv)
GTEST_DISALLOW_COPY_AND_ASSIGN_(AssertHelperData)
TestPartResult::Type const type
AssertHelperData(TestPartResult::Type t, const char *srcfile, int line_num, const char *msg)
std::string const message