42 using ::testing::TestEventListeners;
43 using ::testing::TestWithParam;
44 using ::testing::UnitTest;
45 using ::testing::Test;
52 SUCCEED() <<
"This is a success.";
67 FAIL() <<
"Unexpected failure: Disabled test should not be run";
77 TEST(MixedResultTest, Succeeds) {
82 TEST(MixedResultTest, Fails) {
87 TEST(MixedResultTest, DISABLED_test) {
88 FAIL() <<
"Unexpected failure: Disabled test should not be run";
91 TEST(XmlQuotingTest, OutputsCData) {
92 FAIL() <<
"XML output: "
93 "<?xml encoding=\"utf-8\"><top><![CDATA[cdata text]]></top>";
98 TEST(InvalidCharactersTest, InvalidCharactersInMessage) {
99 FAIL() <<
"Invalid characters in brackets [\x1\x2]";
106 RecordProperty(
"TearDownTestSuite",
"aye");
111 RecordProperty(
"key_1",
"1");
115 RecordProperty(
"key_int", 1);
119 RecordProperty(
"key_1",
"1");
120 RecordProperty(
"key_2",
"2");
121 RecordProperty(
"key_3",
"3");
125 RecordProperty(
"key_1",
"1");
126 RecordProperty(
"key_1",
"2");
129 TEST(NoFixtureTest, RecordProperty) {
130 RecordProperty(
"key",
"1");
142 TEST(NoFixtureTest, ExternalUtilityThatCallsRecordIntValuedProperty) {
146 TEST(NoFixtureTest, ExternalUtilityThatCallsRecordStringValuedProperty) {
157 #if GTEST_HAS_TYPED_TEST
161 typedef testing::Types<int, long> TypedTestTypes;
166 #if GTEST_HAS_TYPED_TEST_P
169 template <
typename T>
170 class TypeParameterizedTestSuite :
public Test {};
172 TYPED_TEST_P(TypeParameterizedTestSuite, HasTypeParamAttribute) {}
174 typedef testing::Types<int, long> TypeParameterizedTestSuiteTypes;
176 TypeParameterizedTestSuiteTypes);
179 int main(
int argc,
char** argv) {
182 if (argc > 1 && strcmp(argv[1],
"--shut_down_xml") == 0) {
183 TestEventListeners& listeners = UnitTest::GetInstance()->listeners();
184 delete listeners.Release(listeners.default_xml_generator());