From 3afd077b554779607ed8ccbf34c365eb73ba460d Mon Sep 17 00:00:00 2001 From: Alex Glyde Date: Mon, 6 Mar 2017 10:35:03 -0500 Subject: [PATCH] teamcity reporter should time durations explicitly --- include/reporters/catch_reporter_teamcity.hpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/include/reporters/catch_reporter_teamcity.hpp b/include/reporters/catch_reporter_teamcity.hpp index 1e633f1d..12403f07 100644 --- a/include/reporters/catch_reporter_teamcity.hpp +++ b/include/reporters/catch_reporter_teamcity.hpp @@ -148,6 +148,7 @@ namespace Catch { } virtual void testCaseStarting( TestCaseInfo const& testInfo ) CATCH_OVERRIDE { + testTimer.start(); StreamingReporterBase::testCaseStarting( testInfo ); stream << "##teamcity[testStarted name='" << escape( testInfo.name ) << "']\n"; @@ -164,7 +165,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='" + << testTimer.getElapsedMilliseconds() << "']\n"; } private: @@ -203,7 +205,7 @@ namespace Catch { } private: bool m_headerPrintedForThisSection; - + Timer testTimer; }; #ifdef CATCH_IMPL