summaryrefslogtreecommitdiff
path: root/src/gtest-internal-inl.h
diff options
context:
space:
mode:
authorvladlosev <vladlosev@861a406c-534a-0410-8894-cb66d6ee9925>2011-10-05 05:52:34 +0000
committervladlosev <vladlosev@861a406c-534a-0410-8894-cb66d6ee9925>2011-10-05 05:52:34 +0000
commit8883b42f2a78976dde09f31ca72806072e33bd5f (patch)
treedd74052e6e0f73cf9d68b55dab4f438b33c57820 /src/gtest-internal-inl.h
parente35019652516ad3b4e9bd8c49dbcfca9d443d7e4 (diff)
downloadgtest-8883b42f2a78976dde09f31ca72806072e33bd5f.tar.gz
gtest-8883b42f2a78976dde09f31ca72806072e33bd5f.tar.bz2
gtest-8883b42f2a78976dde09f31ca72806072e33bd5f.tar.xz
Implements the timestamp attribute for the testsuites element in the output XML (external contribution by Dirk Meister).
git-svn-id: http://googletest.googlecode.com/svn/trunk@600 861a406c-534a-0410-8894-cb66d6ee9925
Diffstat (limited to 'src/gtest-internal-inl.h')
-rw-r--r--src/gtest-internal-inl.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/gtest-internal-inl.h b/src/gtest-internal-inl.h
index 65a2101..8a85724 100644
--- a/src/gtest-internal-inl.h
+++ b/src/gtest-internal-inl.h
@@ -112,6 +112,12 @@ GTEST_API_ bool ShouldUseColor(bool stdout_is_tty);
// Formats the given time in milliseconds as seconds.
GTEST_API_ std::string FormatTimeInMillisAsSeconds(TimeInMillis ms);
+// Converts the given time in milliseconds to a date string in the ISO 8601
+// format, without the timezone information. N.B.: due to the use the
+// non-reentrant localtime() function, this function is not thread safe. Do
+// not use it in any code that can be called from multiple threads.
+GTEST_API_ std::string FormatEpochTimeInMillisAsIso8601(TimeInMillis ms);
+
// Parses a string for an Int32 flag, in the form of "--flag=value".
//
// On success, stores the value of the flag in *value, and returns
@@ -548,6 +554,10 @@ class GTEST_API_ UnitTestImpl {
// Gets the number of tests that should run.
int test_to_run_count() const;
+ // Gets the time of the test program start, in ms from the start of the
+ // UNIX epoch.
+ TimeInMillis start_timestamp() const { return start_timestamp_; }
+
// Gets the elapsed time, in milliseconds.
TimeInMillis elapsed_time() const { return elapsed_time_; }
@@ -880,6 +890,10 @@ class GTEST_API_ UnitTestImpl {
// Our random number generator.
internal::Random random_;
+ // The time of the test program start, in ms from the start of the
+ // UNIX epoch.
+ TimeInMillis start_timestamp_;
+
// How long the test took to run, in milliseconds.
TimeInMillis elapsed_time_;