Implemented more reporter methods and started to fill out Section impl

This commit is contained in:
Phil Nash
2010-11-29 19:40:44 +00:00
parent 3d6fa68970
commit e6b2b0e656
12 changed files with 223 additions and 35 deletions
+17 -3
View File
@@ -13,6 +13,8 @@
#ifndef TWOBLUECUBES_CATCH_SECTION_HPP_INCLUDED
#define TWOBLUECUBES_CATCH_SECTION_HPP_INCLUDED
#include "catch_capture.hpp"
#include <string>
namespace Catch
@@ -21,15 +23,27 @@ namespace Catch
{
public:
Section( const std::string& name, const std::string& description )
: m_name( name ),
m_sectionIncluded( ResultsCapture::acceptSectionStart( name, description, m_successes, m_failures ) )
{
(name, description); // !TBD notify the runner
}
~Section()
{
ResultsCapture::acceptSectionEnd( m_name, m_successes, m_failures );
}
// This indicates whether the section should be executed or not
operator bool()
{
// !TBD get this from runner
return true;
return m_sectionIncluded;
}
private:
std::string m_name;
std::size_t m_successes;
std::size_t m_failures;
bool m_sectionIncluded;
};
} // end namespace Catch