From ede3dd13fa3774983309f6e95d4df0cd477319e2 Mon Sep 17 00:00:00 2001 From: Peter Nemere Date: Mon, 6 Jun 2016 14:32:07 +1000 Subject: [PATCH] Modified team city reporter to report testIgnored if it was skipped, eg due to the [mayfail] tag --- include/reporters/catch_reporter_teamcity.hpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/include/reporters/catch_reporter_teamcity.hpp b/include/reporters/catch_reporter_teamcity.hpp index 1e633f1d..60f619bc 100644 --- a/include/reporters/catch_reporter_teamcity.hpp +++ b/include/reporters/catch_reporter_teamcity.hpp @@ -134,10 +134,21 @@ namespace Catch { " " << result.getExpandedExpression() << "\n"; } + // If we're allowing this to fail, report it as an ignored test in team city + if (currentTestCaseInfo->okToFail()) + { + stream << "##teamcity[testIgnored" + << " name='" << escape(currentTestCaseInfo->name) << "'" + << " message='" << escape(std::string("[FailedButIgnored] ") + msg.str()) << "'" + << "]\n"; + } + else + { stream << "##teamcity[testFailed" << " name='" << escape( currentTestCaseInfo->name )<< "'" << " message='" << escape( msg.str() ) << "'" << "]\n"; + } } return true; }