More formatting/ colour tweaks

This commit is contained in:
Phil Nash
2013-04-01 11:25:54 +01:00
parent 67e9f01d38
commit 2c90533a26
4 changed files with 29 additions and 19 deletions

View File

@@ -271,15 +271,13 @@ namespace Catch {
unusedGroupInfo.reset();
}
}
void lazyPrintTestCaseInfo() {
if( !currentSectionInfo ) {
printClosedHeader( unusedTestCaseInfo->name );
stream << std::endl;
}
}
void printTestCaseAndSectionHeader() {
printOpenHeader( unusedTestCaseInfo->name );
printOpenHeader( unusedTestCaseInfo->name,
currentSectionInfo
? currentSectionInfo->lineInfo
: unusedTestCaseInfo->lineInfo );
if( currentSectionInfo ) {
TextColour colourGuard( TextColour::Headers );
std::vector<ThreadedSectionInfo*> sections;
for( ThreadedSectionInfo* section = currentSectionInfo.get();
section;
@@ -300,9 +298,16 @@ namespace Catch {
printOpenHeader( _name );
stream << getDots() << "\n";
}
void printOpenHeader( std::string const& _name ) {
stream << getDashes() << "\n"
<< _name << "\n";
void printOpenHeader( std::string const& _name, SourceLineInfo const& _lineInfo = SourceLineInfo() ) {
stream << getDashes() << "\n";
if( !_lineInfo.empty() ){
TextColour colourGuard( TextColour::FileName );
stream << _lineInfo << "\n\n";
}
{
TextColour colourGuard( TextColour::Headers );
stream << _name << "\n";
}
}
void printTotals( const Totals& totals ) {