INFO() now works correctly

This commit is contained in:
Phil Nash
2010-12-27 22:05:13 +00:00
parent a36b8d0779
commit 89c464709e
5 changed files with 42 additions and 7 deletions

View File

@@ -164,7 +164,22 @@ namespace Catch
else if( !result.ok() )
m_failures++;
m_reporter->Result( result );
if( !result.ok() )
{
std::vector<ResultInfo>::const_iterator it = m_info.begin();
std::vector<ResultInfo>::const_iterator itEnd = m_info.end();
for(; it != itEnd; ++it )
m_reporter->Result( *it );
}
if( result.getResultType() == ResultWas::Info )
{
m_info.push_back( result );
}
else
{
m_info.clear();
m_reporter->Result( result );
}
}
virtual bool sectionStarted( const std::string& name, const std::string& description, std::size_t& successes, std::size_t& failures )
@@ -202,6 +217,7 @@ namespace Catch
std::size_t m_failures;
ITestReporter* m_reporter;
std::vector<ScopedInfo*> m_scopedInfos;
std::vector<ResultInfo> m_info;
};
}