mirror of
https://github.com/catchorg/Catch2.git
synced 2025-08-01 12:55:40 +02:00
Split TestCaseInfo into a data only component and the test case function and behaviour.
Reporters only get to see the former
This commit is contained in:
@@ -120,8 +120,8 @@ namespace Catch {
|
||||
}
|
||||
}
|
||||
|
||||
virtual void StartTestCase( const TestCase& testInfo ) {
|
||||
m_testSpan = testInfo.getName();
|
||||
virtual void StartTestCase( const TestCaseInfo& testInfo ) {
|
||||
m_testSpan = testInfo.name;
|
||||
}
|
||||
|
||||
virtual void StartSection( const std::string& sectionName, const std::string& ) {
|
||||
@@ -264,7 +264,7 @@ namespace Catch {
|
||||
m_config.stream << std::endl;
|
||||
}
|
||||
|
||||
virtual void EndTestCase( const TestCase& testInfo,
|
||||
virtual void EndTestCase( const TestCaseInfo& testInfo,
|
||||
const Totals& totals,
|
||||
const std::string& stdOut,
|
||||
const std::string& stdErr ) {
|
||||
@@ -279,7 +279,7 @@ namespace Catch {
|
||||
}
|
||||
|
||||
if( m_testSpan.emitted ) {
|
||||
m_config.stream << "[Finished: '" << testInfo.getName() << "' ";
|
||||
m_config.stream << "[Finished: '" << testInfo.name << "' ";
|
||||
ReportCounts( totals );
|
||||
m_config.stream << "]" << std::endl;
|
||||
}
|
||||
|
@@ -102,8 +102,8 @@ namespace Catch {
|
||||
|
||||
virtual void EndSection( const std::string&, const Counts& ) {}
|
||||
|
||||
virtual void StartTestCase( const Catch::TestCase& testInfo ) {
|
||||
m_currentStats->m_testCaseStats.push_back( TestCaseStats( testInfo.getClassName(), testInfo.getName() ) );
|
||||
virtual void StartTestCase( const Catch::TestCaseInfo& testInfo ) {
|
||||
m_currentStats->m_testCaseStats.push_back( TestCaseStats( testInfo.className, testInfo.name ) );
|
||||
m_currentTestCaseStats.push_back( &m_currentStats->m_testCaseStats.back() );
|
||||
}
|
||||
|
||||
@@ -151,7 +151,7 @@ namespace Catch {
|
||||
}
|
||||
}
|
||||
|
||||
virtual void EndTestCase( const Catch::TestCase&, const Totals&, const std::string& stdOut, const std::string& stdErr ) {
|
||||
virtual void EndTestCase( const Catch::TestCaseInfo&, const Totals&, const std::string& stdOut, const std::string& stdErr ) {
|
||||
m_currentTestCaseStats.pop_back();
|
||||
assert( m_currentTestCaseStats.empty() );
|
||||
TestCaseStats& testCaseStats = m_currentStats->m_testCaseStats.back();
|
||||
|
@@ -70,8 +70,8 @@ namespace Catch {
|
||||
m_xml.endElement();
|
||||
}
|
||||
|
||||
virtual void StartTestCase( const Catch::TestCase& testInfo ) {
|
||||
m_xml.startElement( "TestCase" ).writeAttribute( "name", testInfo.getName() );
|
||||
virtual void StartTestCase( const Catch::TestCaseInfo& testInfo ) {
|
||||
m_xml.startElement( "TestCase" ).writeAttribute( "name", testInfo.name );
|
||||
m_currentTestSuccess = true;
|
||||
}
|
||||
|
||||
@@ -129,7 +129,7 @@ namespace Catch {
|
||||
// !TBD
|
||||
}
|
||||
|
||||
virtual void EndTestCase( const Catch::TestCase&, const Totals&, const std::string&, const std::string& ) {
|
||||
virtual void EndTestCase( const Catch::TestCaseInfo&, const Totals&, const std::string&, const std::string& ) {
|
||||
m_xml.scopedElement( "OverallResult" ).writeAttribute( "success", m_currentTestSuccess );
|
||||
m_xml.endElement();
|
||||
}
|
||||
|
Reference in New Issue
Block a user