39 #include "gtest/gtest.h"
42 using ::testing::TestEventListeners;
43 using ::testing::TestWithParam;
44 using ::testing::UnitTest;
52 SUCCEED() <<
"This is a success.";
67 FAIL() <<
"Unexpected failure: Disabled test should not be run";
78 GTEST_SKIP() <<
"It is good practice to tell why you skip a test.";
83 GTEST_SKIP() <<
"It is good practice to tell why you skip a test.";
86 TEST(MixedResultTest, Succeeds) {
91 TEST(MixedResultTest, Fails) {
96 TEST(MixedResultTest, DISABLED_test) {
97 FAIL() <<
"Unexpected failure: Disabled test should not be run";
100 TEST(XmlQuotingTest, OutputsCData) {
101 FAIL() <<
"XML output: "
102 "<?xml encoding=\"utf-8\"><top><![CDATA[cdata text]]></top>";
107 TEST(InvalidCharactersTest, InvalidCharactersInMessage) {
108 FAIL() <<
"Invalid characters in brackets [\x1\x2]";
115 RecordProperty(
"TearDownTestSuite",
"aye");
120 RecordProperty(
"key_1",
"1");
124 RecordProperty(
"key_int", 1);
128 RecordProperty(
"key_1",
"1");
129 RecordProperty(
"key_2",
"2");
130 RecordProperty(
"key_3",
"3");
134 RecordProperty(
"key_1",
"1");
135 RecordProperty(
"key_1",
"2");
138 TEST(NoFixtureTest, RecordProperty) {
139 RecordProperty(
"key",
"1");
151 TEST(NoFixtureTest, ExternalUtilityThatCallsRecordIntValuedProperty) {
155 TEST(NoFixtureTest, ExternalUtilityThatCallsRecordStringValuedProperty) {
175 template <
typename T>
184 int main(
int argc,
char** argv) {
187 if (argc > 1 && strcmp(argv[1],
"--shut_down_xml") == 0) {
188 TestEventListeners& listeners = UnitTest::GetInstance()->listeners();
189 delete listeners.Release(listeners.default_xml_generator());