diff options
author | vladlosev <vladlosev@861a406c-534a-0410-8894-cb66d6ee9925> | 2011-10-05 05:52:34 +0000 |
---|---|---|
committer | vladlosev <vladlosev@861a406c-534a-0410-8894-cb66d6ee9925> | 2011-10-05 05:52:34 +0000 |
commit | 431a8be1662a3bc9601240914f412b0436d94703 (patch) | |
tree | dd74052e6e0f73cf9d68b55dab4f438b33c57820 /src/gtest-internal-inl.h | |
parent | 69a40b7d4ab4171cbe4ef920e7a5171109e2064c (diff) | |
download | googletest-431a8be1662a3bc9601240914f412b0436d94703.tar.gz googletest-431a8be1662a3bc9601240914f412b0436d94703.tar.bz2 googletest-431a8be1662a3bc9601240914f412b0436d94703.zip |
Implements the timestamp attribute for the testsuites element in the output XML (external contribution by Dirk Meister).
Diffstat (limited to 'src/gtest-internal-inl.h')
-rw-r--r-- | src/gtest-internal-inl.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/gtest-internal-inl.h b/src/gtest-internal-inl.h index 65a2101a..8a85724b 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_; |