diff --git a/include/reporters/catch_reporter_teamcity.hpp b/include/reporters/catch_reporter_teamcity.hpp index e685a6ad..81a5dee9 100644 --- a/include/reporters/catch_reporter_teamcity.hpp +++ b/include/reporters/catch_reporter_teamcity.hpp @@ -150,6 +150,7 @@ namespace Catch { } virtual void testCaseStarting( TestCaseInfo const& testInfo ) CATCH_OVERRIDE { + m_testTimer.start(); StreamingReporterBase::testCaseStarting( testInfo ); stream << "##teamcity[testStarted name='" << escape( testInfo.name ) << "']\n"; @@ -166,7 +167,8 @@ namespace Catch { << escape( testCaseStats.testInfo.name ) << "' out='" << escape( testCaseStats.stdErr ) << "']\n"; stream << "##teamcity[testFinished name='" - << escape( testCaseStats.testInfo.name ) << "']\n"; + << escape( testCaseStats.testInfo.name ) << "' duration='" + << m_testTimer.getElapsedMilliseconds() << "']\n"; } private: @@ -205,6 +207,7 @@ namespace Catch { } private: bool m_headerPrintedForThisSection; + Timer m_testTimer; }; #ifdef CATCH_IMPL