Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorPhil Nash2014-12-20 01:02:17 +0000
committerPhil Nash2014-12-20 01:02:17 +0000
commit2771220a41ebe52efc94be80ee5f391324e9adea (patch)
treef8fcffd323315f97b614a27736ae690609311852 /include
parent8ec959e936a94d2a465669cb1e34d6e947e0e4b1 (diff)
downloadcatch3-2771220a41ebe52efc94be80ee5f391324e9adea.tar.gz
Cleaned up section headers
- and don't reprint test case name
Diffstat (limited to 'include')
-rw-r--r--include/reporters/catch_reporter_teamcity.hpp25
1 files changed, 10 insertions, 15 deletions
diff --git a/include/reporters/catch_reporter_teamcity.hpp b/include/reporters/catch_reporter_teamcity.hpp
index 47eafb19..ffb9bf5c 100644
--- a/include/reporters/catch_reporter_teamcity.hpp
+++ b/include/reporters/catch_reporter_teamcity.hpp
@@ -68,9 +68,11 @@ namespace Catch {
std::ostringstream msg;
if( !m_headerPrintedForThisSection )
- printTestCaseAndSectionHeader( msg );
+ printSectionHeader( msg );
m_headerPrintedForThisSection = true;
+ msg << result.getSourceInfo() << "\n";
+
switch( result.getResultType() ) {
case ResultWas::ExpressionFailed:
msg << "expression failed";
@@ -117,8 +119,6 @@ namespace Catch {
"with expansion:\n" <<
" " << result.getExpandedExpression() << "\n";
}
- msg << "\n" << result.getSourceInfo() << "\n";
- msg << "---------------------------------------";
stream << "##teamcity[testFailed"
<< " name='" << escape( currentTestCaseInfo->name )<< "'"
@@ -159,32 +159,27 @@ namespace Catch {
// }
private:
- void printTestCaseAndSectionHeader( std::ostream& os ) {
+ void printSectionHeader( std::ostream& os ) {
assert( !m_sectionStack.empty() );
- printOpenHeader( os, currentTestCaseInfo->name );
-
+
if( m_sectionStack.size() > 1 ) {
+ os << getLineOfChars<'-'>() << "\n";
+
std::vector<SectionInfo>::const_iterator
it = m_sectionStack.begin()+1, // Skip first section (test case)
itEnd = m_sectionStack.end();
for( ; it != itEnd; ++it )
- printHeaderString( os, it->name, 2 );
+ printHeaderString( os, it->name );
+ os << getLineOfChars<'-'>() << "\n";
}
SourceLineInfo lineInfo = m_sectionStack.front().lineInfo;
- if( !lineInfo.empty() ){
- os << getLineOfChars<'-'>() << "\n";
+ if( !lineInfo.empty() )
os << lineInfo << "\n";
- }
os << getLineOfChars<'.'>() << "\n\n";
}
- void printOpenHeader( std::ostream& os, std::string const& _name ) {
- os << getLineOfChars<'-'>() << "\n";
- printHeaderString( os, _name );
- }
-
// if string has a : in first line will set indent to follow it on
// subsequent lines
void printHeaderString( std::ostream& os, std::string const& _string, std::size_t indent = 0 ) {