aboutsummaryrefslogtreecommitdiffstats
path: root/test/gtest_xml_output_unittest_.cc
diff options
context:
space:
mode:
authorvladlosev <vladlosev@861a406c-534a-0410-8894-cb66d6ee9925>2013-04-05 20:50:46 +0000
committervladlosev <vladlosev@861a406c-534a-0410-8894-cb66d6ee9925>2013-04-05 20:50:46 +0000
commitf5fa71f728ce77c5d5c1a940a9bd8bb1d64c9f78 (patch)
treeee51703ea3b410ad57ece30d0ed8864d8c104acf /test/gtest_xml_output_unittest_.cc
parent5f18b68bfc96e69f8b1e5b7b5449f4890c1a2016 (diff)
downloadgoogletest-f5fa71f728ce77c5d5c1a940a9bd8bb1d64c9f78.tar.gz
googletest-f5fa71f728ce77c5d5c1a940a9bd8bb1d64c9f78.tar.bz2
googletest-f5fa71f728ce77c5d5c1a940a9bd8bb1d64c9f78.zip
Implements support for calling Test::RecordProperty() outside of a test.
Diffstat (limited to 'test/gtest_xml_output_unittest_.cc')
-rw-r--r--test/gtest_xml_output_unittest_.cc10
1 files changed, 7 insertions, 3 deletions
diff --git a/test/gtest_xml_output_unittest_.cc b/test/gtest_xml_output_unittest_.cc
index bf0c871b..48b8771b 100644
--- a/test/gtest_xml_output_unittest_.cc
+++ b/test/gtest_xml_output_unittest_.cc
@@ -95,6 +95,9 @@ TEST(InvalidCharactersTest, InvalidCharactersInMessage) {
}
class PropertyRecordingTest : public Test {
+ public:
+ static void SetUpTestCase() { RecordProperty("SetUpTestCase", "yes"); }
+ static void TearDownTestCase() { RecordProperty("TearDownTestCase", "aye"); }
};
TEST_F(PropertyRecordingTest, OneProperty) {
@@ -120,12 +123,12 @@ TEST(NoFixtureTest, RecordProperty) {
RecordProperty("key", "1");
}
-void ExternalUtilityThatCallsRecordProperty(const char* key, int value) {
+void ExternalUtilityThatCallsRecordProperty(const std::string& key, int value) {
testing::Test::RecordProperty(key, value);
}
-void ExternalUtilityThatCallsRecordProperty(const char* key,
- const char* value) {
+void ExternalUtilityThatCallsRecordProperty(const std::string& key,
+ const std::string& value) {
testing::Test::RecordProperty(key, value);
}
@@ -173,5 +176,6 @@ int main(int argc, char** argv) {
TestEventListeners& listeners = UnitTest::GetInstance()->listeners();
delete listeners.Release(listeners.default_xml_generator());
}
+ testing::Test::RecordProperty("ad_hoc_property", "42");
return RUN_ALL_TESTS();
}