mirror of
				https://github.com/catchorg/Catch2.git
				synced 2025-11-03 21:49:32 +01:00 
			
		
		
		
	TeamCity reporter “ignores” failures in tests marked “ok to fail”
- also don’t report hidden/ not-selected tests
This commit is contained in:
		@@ -50,13 +50,6 @@ namespace Catch {
 | 
				
			|||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        virtual void skipTest( TestCaseInfo const& testInfo ) CATCH_OVERRIDE {
 | 
					        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 {}
 | 
					        virtual void noMatchingTestCases( std::string const& /* spec */ ) CATCH_OVERRIDE {}
 | 
				
			||||||
@@ -134,10 +127,19 @@ namespace Catch {
 | 
				
			|||||||
                        "  " << result.getExpandedExpression() << "\n";
 | 
					                        "  " << result.getExpandedExpression() << "\n";
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                stream << "##teamcity[testFailed"
 | 
					                if( currentTestCaseInfo->okToFail() ) {
 | 
				
			||||||
                    << " name='" << escape( currentTestCaseInfo->name )<< "'"
 | 
					                    msg << "- failure ignore as test marked as 'ok to fail'\n";
 | 
				
			||||||
                    << " message='" << escape( msg.str() ) << "'"
 | 
					                    stream << "##teamcity[testIgnored"
 | 
				
			||||||
                    << "]\n";
 | 
					                           << " name='" << escape( currentTestCaseInfo->name )<< "'"
 | 
				
			||||||
 | 
					                           << " message='" << escape( msg.str() ) << "'"
 | 
				
			||||||
 | 
					                           << "]\n";
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					                else {
 | 
				
			||||||
 | 
					                    stream << "##teamcity[testFailed"
 | 
				
			||||||
 | 
					                           << " name='" << escape( currentTestCaseInfo->name )<< "'"
 | 
				
			||||||
 | 
					                           << " message='" << escape( msg.str() ) << "'"
 | 
				
			||||||
 | 
					                           << "]\n";
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            return true;
 | 
					            return true;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
@@ -203,7 +205,6 @@ namespace Catch {
 | 
				
			|||||||
        }
 | 
					        }
 | 
				
			||||||
    private:
 | 
					    private:
 | 
				
			||||||
        bool m_headerPrintedForThisSection;
 | 
					        bool m_headerPrintedForThisSection;
 | 
				
			||||||
 | 
					 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#ifdef CATCH_IMPL
 | 
					#ifdef CATCH_IMPL
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user