Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
gtest_xml_output_unittest_.cc File Reference
#include "gtest/gtest.h"
Include dependency graph for gtest_xml_output_unittest_.cc:

Go to the source code of this file.

Classes

class  SuccessfulTest
 
class  FailedTest
 
class  DisabledTest
 
class  PropertyRecordingTest
 
class  ValueParamTest
 

Functions

 TEST_F (SuccessfulTest, Succeeds)
 
 TEST_F (FailedTest, Fails)
 
 TEST_F (DisabledTest, DISABLED_test_not_run)
 
 TEST (MixedResultTest, Succeeds)
 
 TEST (MixedResultTest, Fails)
 
 TEST (MixedResultTest, DISABLED_test)
 
 TEST (XmlQuotingTest, OutputsCData)
 
 TEST (InvalidCharactersTest, InvalidCharactersInMessage)
 
 TEST_F (PropertyRecordingTest, OneProperty)
 
 TEST_F (PropertyRecordingTest, IntValuedProperty)
 
 TEST_F (PropertyRecordingTest, ThreeProperties)
 
 TEST_F (PropertyRecordingTest, TwoValuesForOneKeyUsesLastValue)
 
 TEST (NoFixtureTest, RecordProperty)
 
void ExternalUtilityThatCallsRecordProperty (const std::string &key, int value)
 
void ExternalUtilityThatCallsRecordProperty (const std::string &key, const std::string &value)
 
 TEST (NoFixtureTest, ExternalUtilityThatCallsRecordIntValuedProperty)
 
 TEST (NoFixtureTest, ExternalUtilityThatCallsRecordStringValuedProperty)
 
 TEST_P (ValueParamTest, HasValueParamAttribute)
 
 TEST_P (ValueParamTest, AnotherTestThatHasValueParamAttribute)
 
 INSTANTIATE_TEST_CASE_P (Single, ValueParamTest, Values(33, 42))
 
int main (int argc, char **argv)
 

Function Documentation

◆ ExternalUtilityThatCallsRecordProperty() [1/2]

void ExternalUtilityThatCallsRecordProperty ( const std::string & key,
const std::string & value )

Definition at line 128 of file gtest_xml_output_unittest_.cc.

129 {
131}
static void RecordProperty(const std::string &key, const std::string &value)
Definition gtest.cc:2253
#define value
Definition pkcs11.h:157
Here is the call graph for this function:

◆ ExternalUtilityThatCallsRecordProperty() [2/2]

void ExternalUtilityThatCallsRecordProperty ( const std::string & key,
int value )

Definition at line 124 of file gtest_xml_output_unittest_.cc.

124 {
126}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ INSTANTIATE_TEST_CASE_P()

INSTANTIATE_TEST_CASE_P ( Single ,
ValueParamTest ,
Values(33, 42)  )

◆ main()

int main ( int argc,
char ** argv )

Definition at line 170 of file gtest_xml_output_unittest_.cc.

170 {
171 InitGoogleTest(&argc, argv);
172
173 if (argc > 1 && strcmp(argv[1], "--shut_down_xml") == 0) {
174 TestEventListeners& listeners = UnitTest::GetInstance()->listeners();
175 delete listeners.Release(listeners.default_xml_generator());
176 }
177 testing::Test::RecordProperty("ad_hoc_property", "42");
178 return RUN_ALL_TESTS();
179}
int RUN_ALL_TESTS() GTEST_MUST_USE_RESULT_
Definition gtest.h:2328
char ** argv
GTEST_API_ void InitGoogleTest(int *argc, char **argv)
Definition gtest.cc:5787
Here is the call graph for this function:

◆ TEST() [1/8]

TEST ( InvalidCharactersTest ,
InvalidCharactersInMessage  )

Definition at line 91 of file gtest_xml_output_unittest_.cc.

91 {
92 FAIL() << "Invalid characters in brackets [\x1\x2]";
93}
#define FAIL()
Definition gtest.h:1858

◆ TEST() [2/8]

TEST ( MixedResultTest ,
DISABLED_test  )

Definition at line 80 of file gtest_xml_output_unittest_.cc.

80 {
81 FAIL() << "Unexpected failure: Disabled test should not be run";
82}

◆ TEST() [3/8]

TEST ( MixedResultTest ,
Fails  )

Definition at line 75 of file gtest_xml_output_unittest_.cc.

75 {
76 EXPECT_EQ(1, 2);
77 ASSERT_EQ(2, 3);
78}
#define ASSERT_EQ(val1, val2)
Definition gtest.h:1988
#define EXPECT_EQ(val1, val2)
Definition gtest.h:1954

◆ TEST() [4/8]

TEST ( MixedResultTest ,
Succeeds  )

Definition at line 70 of file gtest_xml_output_unittest_.cc.

70 {
71 EXPECT_EQ(1, 1);
72 ASSERT_EQ(1, 1);
73}

◆ TEST() [5/8]

TEST ( NoFixtureTest ,
ExternalUtilityThatCallsRecordIntValuedProperty  )

Definition at line 133 of file gtest_xml_output_unittest_.cc.

133 {
134 ExternalUtilityThatCallsRecordProperty("key_for_utility_int", 1);
135}
void ExternalUtilityThatCallsRecordProperty(const std::string &key, int value)
Here is the call graph for this function:

◆ TEST() [6/8]

TEST ( NoFixtureTest ,
ExternalUtilityThatCallsRecordStringValuedProperty  )

Definition at line 137 of file gtest_xml_output_unittest_.cc.

137 {
138 ExternalUtilityThatCallsRecordProperty("key_for_utility_string", "1");
139}
Here is the call graph for this function:

◆ TEST() [7/8]

TEST ( NoFixtureTest ,
RecordProperty  )

Definition at line 120 of file gtest_xml_output_unittest_.cc.

120 {
121 RecordProperty("key", "1");
122}

◆ TEST() [8/8]

TEST ( XmlQuotingTest ,
OutputsCData  )

Definition at line 84 of file gtest_xml_output_unittest_.cc.

84 {
85 FAIL() << "XML output: "
86 "<?xml encoding=\"utf-8\"><top><![CDATA[cdata text]]></top>";
87}

◆ TEST_F() [1/7]

TEST_F ( DisabledTest ,
DISABLED_test_not_run  )

Definition at line 66 of file gtest_xml_output_unittest_.cc.

66 {
67 FAIL() << "Unexpected failure: Disabled test should not be run";
68}

◆ TEST_F() [2/7]

TEST_F ( FailedTest ,
Fails  )

Definition at line 59 of file gtest_xml_output_unittest_.cc.

59 {
60 ASSERT_EQ(1, 2);
61}

◆ TEST_F() [3/7]

TEST_F ( PropertyRecordingTest ,
IntValuedProperty  )

Definition at line 105 of file gtest_xml_output_unittest_.cc.

105 {
106 RecordProperty("key_int", 1);
107}

◆ TEST_F() [4/7]

TEST_F ( PropertyRecordingTest ,
OneProperty  )

Definition at line 101 of file gtest_xml_output_unittest_.cc.

101 {
102 RecordProperty("key_1", "1");
103}

◆ TEST_F() [5/7]

TEST_F ( PropertyRecordingTest ,
ThreeProperties  )

Definition at line 109 of file gtest_xml_output_unittest_.cc.

109 {
110 RecordProperty("key_1", "1");
111 RecordProperty("key_2", "2");
112 RecordProperty("key_3", "3");
113}

◆ TEST_F() [6/7]

TEST_F ( PropertyRecordingTest ,
TwoValuesForOneKeyUsesLastValue  )

Definition at line 115 of file gtest_xml_output_unittest_.cc.

115 {
116 RecordProperty("key_1", "1");
117 RecordProperty("key_1", "2");
118}

◆ TEST_F() [7/7]

TEST_F ( SuccessfulTest ,
Succeeds  )

Definition at line 51 of file gtest_xml_output_unittest_.cc.

51 {
52 SUCCEED() << "This is a success.";
53 ASSERT_EQ(1, 1);
54}
#define SUCCEED()
Definition gtest.h:1867

◆ TEST_P() [1/2]

TEST_P ( ValueParamTest ,
AnotherTestThatHasValueParamAttribute  )

Definition at line 145 of file gtest_xml_output_unittest_.cc.

145{}

◆ TEST_P() [2/2]

TEST_P ( ValueParamTest ,
HasValueParamAttribute  )

Definition at line 144 of file gtest_xml_output_unittest_.cc.

144{}