summaryrefslogtreecommitdiff
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
commitdfbdf0bab51520595679a99710983daba6fc18eb (patch)
treeee51703ea3b410ad57ece30d0ed8864d8c104acf /src/gtest-internal-inl.h
parentf2ac1ec8018f164081b8c002bcfbd88a4b52f65e (diff)
downloadgtest-dfbdf0bab51520595679a99710983daba6fc18eb.tar.gz
gtest-dfbdf0bab51520595679a99710983daba6fc18eb.tar.bz2
gtest-dfbdf0bab51520595679a99710983daba6fc18eb.tar.xz
Implements support for calling Test::RecordProperty() outside of a test.
git-svn-id: http://googletest.googlecode.com/svn/trunk@648 861a406c-534a-0410-8894-cb66d6ee9925
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 d661043..302b6cd 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) {