mirror of
https://github.com/catchorg/Catch2.git
synced 2025-06-04 10:58:06 +00:00
Completed NoAssertions warning implementation
This commit is contained in:
parent
55764c8d47
commit
a70fbe3c1a
12 changed files with 668 additions and 513 deletions
|
@ -127,12 +127,19 @@ namespace Catch {
|
|||
virtual void StartSection( const std::string& sectionName, const std::string& ) {
|
||||
m_sectionSpans.push_back( SpanInfo( sectionName ) );
|
||||
}
|
||||
|
||||
|
||||
virtual void NoAssertionsInSection( const std::string& sectionName ) {
|
||||
StartSpansLazily();
|
||||
TextColour colour( TextColour::ResultError );
|
||||
m_config.stream << "\nNo assertions in section, '" << sectionName << "'\n" << std::endl;
|
||||
}
|
||||
virtual void NoAssertionsInTestCase( const std::string& testName ) {
|
||||
StartSpansLazily();
|
||||
TextColour colour( TextColour::ResultError );
|
||||
m_config.stream << "\nNo assertions in test case, '" << testName << "'\n" << std::endl;
|
||||
}
|
||||
|
||||
virtual void EndSection( const std::string& sectionName, const Counts& assertions ) {
|
||||
if( ( m_config.fullConfig.warnings & ConfigData::WarnAbout::NoAssertions ) && assertions.total() == 0 ) {
|
||||
StartSpansLazily();
|
||||
m_config.stream << "** No assertions in section **" << std::endl;
|
||||
}
|
||||
|
||||
SpanInfo& sectionSpan = m_sectionSpans.back();
|
||||
if( sectionSpan.emitted && !sectionSpan.name.empty() ) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue