Support for reporting skipped tests

- implemented by TeamCity reporter
This commit is contained in:
Phil Nash
2014-12-22 20:10:33 +00:00
parent 58dcb5ea92
commit 7619920f86
8 changed files with 45 additions and 12 deletions

View File

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

View File

@@ -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 */ ) {}