From ca764ec8d90b7a2593ab05915ffa23a394305017 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Fri, 7 Apr 2017 11:15:37 +0100 Subject: [PATCH] =?UTF-8?q?TeamCity=20reporter=20=E2=80=9Cignores=E2=80=9D?= =?UTF-8?q?=20failures=20in=20tests=20marked=20=E2=80=9Cok=20to=20fail?= =?UTF-8?q?=E2=80=9D=20-=20also=20don=E2=80=99t=20report=20hidden/=20not-s?= =?UTF-8?q?elected=20tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/reporters/catch_reporter_teamcity.hpp | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/include/reporters/catch_reporter_teamcity.hpp b/include/reporters/catch_reporter_teamcity.hpp index 1e633f1d..9c12fc70 100644 --- a/include/reporters/catch_reporter_teamcity.hpp +++ b/include/reporters/catch_reporter_teamcity.hpp @@ -50,13 +50,6 @@ namespace Catch { } virtual void skipTest( TestCaseInfo const& testInfo ) CATCH_OVERRIDE { - stream << "##teamcity[testIgnored name='" - << escape( testInfo.name ) << "'"; - if( testInfo.isHidden() ) - stream << " message='hidden test'"; - else - stream << " message='test skipped because it didn|'t match the test spec'"; - stream << "]\n"; } virtual void noMatchingTestCases( std::string const& /* spec */ ) CATCH_OVERRIDE {} @@ -134,10 +127,19 @@ namespace Catch { " " << result.getExpandedExpression() << "\n"; } - stream << "##teamcity[testFailed" - << " name='" << escape( currentTestCaseInfo->name )<< "'" - << " message='" << escape( msg.str() ) << "'" - << "]\n"; + if( currentTestCaseInfo->okToFail() ) { + msg << "- failure ignore as test marked as 'ok to fail'\n"; + stream << "##teamcity[testIgnored" + << " name='" << escape( currentTestCaseInfo->name )<< "'" + << " message='" << escape( msg.str() ) << "'" + << "]\n"; + } + else { + stream << "##teamcity[testFailed" + << " name='" << escape( currentTestCaseInfo->name )<< "'" + << " message='" << escape( msg.str() ) << "'" + << "]\n"; + } } return true; } @@ -203,7 +205,6 @@ namespace Catch { } private: bool m_headerPrintedForThisSection; - }; #ifdef CATCH_IMPL