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; }