8000 Cleaned up section headers · log4cplus/Catch@2771220 · GitHub
[go: up one dir, main page]

Skip to content

Commit 2771220

Browse files
committed
Cleaned up section headers
- and don't reprint test case name
1 parent 8ec959e commit 2771220

File tree

1 file changed

+10
-15
lines changed

1 file changed

+10
-15
lines changed

include/reporters/catch_reporter_teamcity.hpp

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,11 @@ namespace Catch {
6868

6969
std::ostringstream msg;
7070
if( !m_headerPrintedForThisSection )
71-
printTestCaseAndSectionHeader( msg );
71+
printSectionHeader( msg );
7272
m_headerPrintedForThisSection = true;
7373

74+
msg << result.getSourceInfo() << "\n";
75+
7476
switch( result.getResultType() ) {
7577
case ResultWas::ExpressionFailed:
7678
msg << "expression failed";
@@ -117,8 +119,6 @@ namespace Catch {
117119
"with expansion:\n" <<
118120
"< 8000 /span> " << result.getExpandedExpression() << "\n";
119121
}
120-
msg << "\n" << result.getSourceInfo() << "\n";
121-
msg << "---------------------------------------";
122122

123123
stream << "##teamcity[testFailed"
124124
<< " name='" << escape( currentTestCaseInfo->name )<< "'"
@@ -159,32 +159,27 @@ namespace Catch {
159159
// }
160160

161161
private:
162-
void printTestCaseAndSectionHeader( std::ostream& os ) {
162+
void printSectionHeader( std::ostream& os ) {
163163
assert( !m_sectionStack.empty() );
164-
printOpenHeader( os, currentTestCaseInfo->name );
165-
164+
166165
if( m_sectionStack.size() > 1 ) {
166+
os << getLineOfChars<'-'>() << "\n";
167+
167168
std::vector<SectionInfo>::const_iterator
168169
it = m_sectionStack.begin()+1, // Skip first section (test case)
169170
itEnd = m_sectionStack.end();
170171
for( ; it != itEnd; ++it )
171-
printHeaderString( os, it->name, 2 );
172+
printHeaderString( os, it->name );
173+
os << getLineOfChars<'-'>() << "\n";
172174
}
173175

174176
SourceLineInfo lineInfo = m_sectionStack.front().lineInfo;
175177

176-
if( !lineInfo.empty() ){
177-
os << getLineOfChars<'-'>() << "\n";
178+
if( !lineInfo.empty() )
178179
os << lineInfo << "\n";
179-
}
180180
os << getLineOfChars<'.'>() << "\n\n";
181181
}
182182

183-
void printOpenHeader( std::ostream& os, std::string const& _name ) {
184-
os << getLineOfChars<'-'>() << "\n";
185-
printHeaderString( os, _name );
186-
}
187-
188183
// if string has a : in first line will set indent to follow it on
189184
// subsequent lines
190185
void printHeaderString( std::ostream& os, std::string const& _string, std::size_t indent = 0 ) {

0 commit comments

Comments
 (0)
0