mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-23 05:46:11 +01:00
Some test case header refactoring
This commit is contained in:
parent
5a60ce2117
commit
0a87795535
@ -244,9 +244,8 @@ namespace Catch {
|
|||||||
}
|
}
|
||||||
void lazyPrintTestCaseInfo() {
|
void lazyPrintTestCaseInfo() {
|
||||||
if( !currentSectionInfo ) {
|
if( !currentSectionInfo ) {
|
||||||
stream << getDashes() << "\n"
|
printTestCaseHeader();
|
||||||
<< "Test case" << ": '" << unusedTestCaseInfo->name << "'\n";
|
stream << std::endl;
|
||||||
stream << getDashes() << "\n" << std::endl;
|
|
||||||
unusedTestCaseInfo.reset();
|
unusedTestCaseInfo.reset();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -260,9 +259,7 @@ namespace Catch {
|
|||||||
|
|
||||||
// Sections
|
// Sections
|
||||||
if( !sections.empty() ) {
|
if( !sections.empty() ) {
|
||||||
stream << getDashes() << "\n"
|
printTestCaseHeader();
|
||||||
<< "Test case" << ": '" << unusedTestCaseInfo->name << "'\n"
|
|
||||||
<< getDashes() << "\n";
|
|
||||||
|
|
||||||
std::string firstInset;
|
std::string firstInset;
|
||||||
std::string inset;
|
std::string inset;
|
||||||
@ -287,11 +284,15 @@ namespace Catch {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void printTestCaseHeader() {
|
||||||
|
printHeader( "Test case", unusedTestCaseInfo->name );
|
||||||
|
}
|
||||||
void printHeader( std::string const& _type, std::string const& _name ) {
|
void printHeader( std::string const& _type, std::string const& _name ) {
|
||||||
stream << getDashes() << "\n"
|
stream << getDashes() << "\n"
|
||||||
<< _type << ": '" << _name << "'\n"
|
<< _type << ": '" << _name << "'\n"
|
||||||
<< getDashes() << std::endl;
|
<< getDashes() << "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
void printTotals( const Totals& totals ) {
|
void printTotals( const Totals& totals ) {
|
||||||
if( totals.assertions.total() == 0 ) {
|
if( totals.assertions.total() == 0 ) {
|
||||||
stream << "No tests ran";
|
stream << "No tests ran";
|
||||||
|
Loading…
Reference in New Issue
Block a user