aboutsummaryrefslogtreecommitdiffstats
path: root/src/gtest-internal-inl.h
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 /src/gtest-internal-inl.h
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 'src/gtest-internal-inl.h')
-rw-r--r--src/gtest-internal-inl.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/gtest-internal-inl.h b/src/gtest-internal-inl.h
index d6610430..302b6cdb 100644
--- a/src/gtest-internal-inl.h
+++ b/src/gtest-internal-inl.h
@@ -348,8 +348,7 @@ class TestPropertyKeyIs {
// Constructor.
//
// TestPropertyKeyIs has NO default constructor.
- explicit TestPropertyKeyIs(const char* key)
- : key_(key) {}
+ explicit TestPropertyKeyIs(const std::string& key) : key_(key) {}
// Returns true iff the test name of test property matches on key_.
bool operator()(const TestProperty& test_property) const {
@@ -712,6 +711,12 @@ class GTEST_API_ UnitTestImpl {
ad_hoc_test_result_.Clear();
}
+ // Adds a TestProperty to the current TestResult object when invoked in a
+ // context of a test or a test case, or to the global property set. If the
+ // result already contains a property with the same key, the value will be
+ // updated.
+ void RecordProperty(const TestProperty& test_property);
+
enum ReactionToSharding {
HONOR_SHARDING_PROTOCOL,
IGNORE_SHARDING_PROTOCOL
@@ -1038,8 +1043,9 @@ bool ParseNaturalNumber(const ::std::string& str, Integer* number) {
class TestResultAccessor {
public:
static void RecordProperty(TestResult* test_result,
+ const std::string& xml_element,
const TestProperty& property) {
- test_result->RecordProperty(property);
+ test_result->RecordProperty(xml_element, property);
}
static void ClearTestPartResults(TestResult* test_result) {