mirror of
				https://github.com/catchorg/Catch2.git
				synced 2025-10-31 12:17:11 +01:00 
			
		
		
		
	Support for reporting skipped tests
- implemented by TeamCity reporter
This commit is contained in:
		| @@ -55,6 +55,11 @@ namespace Catch { | ||||
|             currentTestRunInfo.reset(); | ||||
|         } | ||||
|  | ||||
|         virtual void skipTest( TestCaseInfo const& ) { | ||||
|             // Don't do anything with this by default. | ||||
|             // It can optionally be overridden in the derived class. | ||||
|         } | ||||
|  | ||||
|         Ptr<IConfig> m_config; | ||||
|         std::ostream& stream; | ||||
|  | ||||
| @@ -185,6 +190,8 @@ namespace Catch { | ||||
|         } | ||||
|         virtual void testRunEndedCumulative() = 0; | ||||
|  | ||||
|         virtual void skipTest( TestCaseInfo const& ) {} | ||||
|  | ||||
|         Ptr<IConfig> m_config; | ||||
|         std::ostream& stream; | ||||
|         std::vector<AssertionStats> m_assertions; | ||||
|   | ||||
| @@ -49,8 +49,16 @@ namespace Catch { | ||||
|             prefs.shouldRedirectStdOut = true; | ||||
|             return prefs; | ||||
|         } | ||||
|          | ||||
|         // !TBD: ignored tests | ||||
|  | ||||
|         virtual void skipTest( TestCaseInfo const& testInfo ) { | ||||
|             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 */ ) {} | ||||
|          | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Phil Nash
					Phil Nash