@@ -68,9 +68,11 @@ namespace Catch {
68
68
69
69
std::ostringstream msg;
70
70
if ( !m_headerPrintedForThisSection )
71
- printTestCaseAndSectionHeader ( msg );
71
+ printSectionHeader ( msg );
72
72
m_headerPrintedForThisSection = true ;
73
73
74
+ msg << result.getSourceInfo () << " \n " ;
75
+
74
76
switch ( result.getResultType () ) {
75
77
case ResultWas::ExpressionFailed:
76
78
msg << " expression failed" ;
@@ -117,8 +119,6 @@ namespace Catch {
117
119
" with expansion:\n " <<
118
120
"<
8000
/span> " << result.getExpandedExpression () << " \n " ;
119
121
}
120
- msg << " \n " << result.getSourceInfo () << " \n " ;
121
- msg << " ---------------------------------------" ;
122
122
123
123
stream << " ##teamcity[testFailed"
124
124
<< " name='" << escape ( currentTestCaseInfo->name )<< " '"
@@ -159,32 +159,27 @@ namespace Catch {
159
159
// }
160
160
161
161
private:
162
- void printTestCaseAndSectionHeader ( std::ostream& os ) {
162
+ void printSectionHeader ( std::ostream& os ) {
163
163
assert ( !m_sectionStack.empty () );
164
- printOpenHeader ( os, currentTestCaseInfo->name );
165
-
164
+
166
165
if ( m_sectionStack.size () > 1 ) {
166
+ os << getLineOfChars<' -' >() << " \n " ;
167
+
167
168
std::vector<SectionInfo>::const_iterator
168
169
it = m_sectionStack.begin ()+1 , // Skip first section (test case)
169
170
itEnd = m_sectionStack.end ();
170
171
for ( ; it != itEnd; ++it )
171
- printHeaderString ( os, it->name , 2 );
172
+ printHeaderString ( os, it->name );
173
+ os << getLineOfChars<' -' >() << " \n " ;
172
174
}
173
175
174
176
SourceLineInfo lineInfo = m_sectionStack.front ().lineInfo ;
175
177
176
- if ( !lineInfo.empty () ){
177
- os << getLineOfChars<' -' >() << " \n " ;
178
+ if ( !lineInfo.empty () )
178
179
os << lineInfo << " \n " ;
179
- }
180
180
os << getLineOfChars<' .' >() << " \n\n " ;
181
181
}
182
182
183
- void printOpenHeader ( std::ostream& os, std::string const & _name ) {
184
- os << getLineOfChars<' -' >() << " \n " ;
185
- printHeaderString ( os, _name );
186
- }
187
-
188
183
// if string has a : in first line will set indent to follow it on
189
184
// subsequent lines
190
185
void printHeaderString ( std::ostream& os, std::string const & _string, std::size_t indent = 0 ) {
0 commit comments