Fix (hopefully) for #5 (reopened)

Adds name to JUnit reporter's testsuite element, even when running all tests.
Also removes redundant comment from the output.
This commit is contained in:
Phil Nash
2012-11-16 08:47:03 +00:00
parent be1cddb7ee
commit ef60d54671
3 changed files with 13 additions and 11 deletions

View File

@@ -13,7 +13,7 @@
namespace Catch {
// These numbers are maintained by a script
Version libraryVersion = { 0, 9, 1, "integration" };
Version libraryVersion = { 0, 9, 2, "integration" };
}
#endif // TWOBLUECUBES_CATCH_VERSION_HPP_INCLUDED

View File

@@ -79,8 +79,11 @@ namespace Catch {
virtual void StartTesting(){}
virtual void StartGroup( const std::string& groupName ) {
m_statsForSuites.push_back( Stats( groupName ) );
virtual void StartGroup( const std::string& groupName ) {
if( groupName.empty() )
m_statsForSuites.push_back( Stats( "all tests" ) );
else
m_statsForSuites.push_back( Stats( groupName ) );
m_currentStats = &m_statsForSuites.back();
}
@@ -188,8 +191,6 @@ namespace Catch {
std::vector<TestCaseStats>::const_iterator it = stats.m_testCaseStats.begin();
std::vector<TestCaseStats>::const_iterator itEnd = stats.m_testCaseStats.end();
for(; it != itEnd; ++it ) {
xml.writeBlankLine();
xml.writeComment( "Test case" );
XmlWriter::ScopedElement e = xml.scopedElement( "testcase" );
xml.writeAttribute( "classname", it->m_className );