mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-26 07:16:10 +01:00
Reformatted basic reporter signatures
This commit is contained in:
parent
4b162c1341
commit
f063c2ae2a
@ -22,13 +22,17 @@ namespace Catch
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
BasicReporter( const IReporterConfig& config )
|
BasicReporter
|
||||||
|
(
|
||||||
|
const IReporterConfig& config
|
||||||
|
)
|
||||||
: m_config( config )
|
: m_config( config )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
static std::string getDescription()
|
static std::string getDescription
|
||||||
|
()
|
||||||
{
|
{
|
||||||
return "Reports test results as lines of text";
|
return "Reports test results as lines of text";
|
||||||
}
|
}
|
||||||
@ -36,7 +40,11 @@ namespace Catch
|
|||||||
private:
|
private:
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
void ReportCounts( std::size_t succeeded, std::size_t failed )
|
void ReportCounts
|
||||||
|
(
|
||||||
|
std::size_t succeeded,
|
||||||
|
std::size_t failed
|
||||||
|
)
|
||||||
{
|
{
|
||||||
if( failed + succeeded == 0 )
|
if( failed + succeeded == 0 )
|
||||||
m_config.stream() << "No tests ran";
|
m_config.stream() << "No tests ran";
|
||||||
@ -51,13 +59,18 @@ namespace Catch
|
|||||||
private: // IReporter
|
private: // IReporter
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
virtual void StartTesting()
|
virtual void StartTesting
|
||||||
|
()
|
||||||
{
|
{
|
||||||
m_config.stream() << "[Started testing]" << std::endl;
|
m_config.stream() << "[Started testing]" << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
virtual void EndTesting( std::size_t succeeded, std::size_t failed )
|
virtual void EndTesting
|
||||||
|
(
|
||||||
|
std::size_t succeeded,
|
||||||
|
std::size_t failed
|
||||||
|
)
|
||||||
{
|
{
|
||||||
m_config.stream() << "[Testing completed. ";
|
m_config.stream() << "[Testing completed. ";
|
||||||
ReportCounts( succeeded, failed );
|
ReportCounts( succeeded, failed );
|
||||||
@ -65,14 +78,22 @@ namespace Catch
|
|||||||
}
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
virtual void StartGroup( const std::string& groupName )
|
virtual void StartGroup
|
||||||
|
(
|
||||||
|
const std::string& groupName
|
||||||
|
)
|
||||||
{
|
{
|
||||||
if( !groupName.empty() )
|
if( !groupName.empty() )
|
||||||
m_config.stream() << "[Started group: '" << groupName << "']" << std::endl;
|
m_config.stream() << "[Started group: '" << groupName << "']" << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
virtual void EndGroup( const std::string& groupName, std::size_t succeeded, std::size_t failed )
|
virtual void EndGroup
|
||||||
|
(
|
||||||
|
const std::string& groupName,
|
||||||
|
std::size_t succeeded,
|
||||||
|
std::size_t failed
|
||||||
|
)
|
||||||
{
|
{
|
||||||
if( !groupName.empty() )
|
if( !groupName.empty() )
|
||||||
{
|
{
|
||||||
@ -83,14 +104,21 @@ namespace Catch
|
|||||||
}
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
virtual void StartTestCase( const TestCaseInfo& testInfo )
|
virtual void StartTestCase
|
||||||
|
(
|
||||||
|
const TestCaseInfo& testInfo
|
||||||
|
)
|
||||||
{
|
{
|
||||||
m_config.stream() << std::endl << "[Running: " << testInfo.getName() << "]" << std::endl;
|
m_config.stream() << std::endl << "[Running: " << testInfo.getName() << "]" << std::endl;
|
||||||
m_firstSectionInTestCase = true;
|
m_firstSectionInTestCase = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
virtual void StartSection( const std::string& sectionName, const std::string /*description*/ )
|
virtual void StartSection
|
||||||
|
(
|
||||||
|
const std::string& sectionName,
|
||||||
|
const std::string /*description*/
|
||||||
|
)
|
||||||
{
|
{
|
||||||
if( m_firstSectionInTestCase )
|
if( m_firstSectionInTestCase )
|
||||||
{
|
{
|
||||||
@ -101,7 +129,12 @@ namespace Catch
|
|||||||
}
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
virtual void EndSection( const std::string& sectionName, std::size_t succeeded, std::size_t failed )
|
virtual void EndSection
|
||||||
|
(
|
||||||
|
const std::string& sectionName,
|
||||||
|
std::size_t succeeded,
|
||||||
|
std::size_t failed
|
||||||
|
)
|
||||||
{
|
{
|
||||||
m_config.stream() << "[End of section: '" << sectionName << "'. ";
|
m_config.stream() << "[End of section: '" << sectionName << "'. ";
|
||||||
ReportCounts( succeeded, failed );
|
ReportCounts( succeeded, failed );
|
||||||
@ -109,7 +142,10 @@ namespace Catch
|
|||||||
}
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
virtual void Result( const ResultInfo& resultInfo )
|
virtual void Result
|
||||||
|
(
|
||||||
|
const ResultInfo& resultInfo
|
||||||
|
)
|
||||||
{
|
{
|
||||||
if( !m_config.includeSuccessfulResults() && resultInfo.getResultType() == ResultWas::Ok )
|
if( !m_config.includeSuccessfulResults() && resultInfo.getResultType() == ResultWas::Ok )
|
||||||
return;
|
return;
|
||||||
@ -155,7 +191,14 @@ namespace Catch
|
|||||||
}
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
virtual void EndTestCase( const TestCaseInfo& testInfo, std::size_t succeeded, std::size_t failed, const std::string& stdOut, const std::string& stdErr )
|
virtual void EndTestCase
|
||||||
|
(
|
||||||
|
const TestCaseInfo& testInfo,
|
||||||
|
std::size_t succeeded,
|
||||||
|
std::size_t failed,
|
||||||
|
const std::string& stdOut,
|
||||||
|
const std::string& stdErr
|
||||||
|
)
|
||||||
{
|
{
|
||||||
if( !stdOut.empty() )
|
if( !stdOut.empty() )
|
||||||
m_config.stream() << "[stdout: " << trim( stdOut ) << "]\n";
|
m_config.stream() << "[stdout: " << trim( stdOut ) << "]\n";
|
||||||
|
Loading…
Reference in New Issue
Block a user