diff options
| author | Phil Nash | 2012-02-24 08:59:35 +0000 |
|---|---|---|
| committer | Phil Nash | 2012-02-24 08:59:35 +0000 |
| commit | edd8f02becccbf459823e44ea9a42b43e0e80faa (patch) | |
| tree | d646dc4ce6709618363d9b71f489e4aed1c81c12 /include/internal | |
| parent | 9bbaeba3ae58dd8709d83f78feaca1637ac0ec29 (diff) | |
| download | catch3-edd8f02becccbf459823e44ea9a42b43e0e80faa.tar.gz | |
Pass totals around instead of individual success/ fail counts
Diffstat (limited to 'include/internal')
| -rw-r--r-- | include/internal/catch_interfaces_reporter.h | 13 | ||||
| -rw-r--r-- | include/internal/catch_runner_impl.hpp | 6 | ||||
| -rw-r--r-- | include/internal/catch_totals.hpp | 4 |
3 files changed, 12 insertions, 11 deletions
diff --git a/include/internal/catch_interfaces_reporter.h b/include/internal/catch_interfaces_reporter.h index 57ded854..baa16755 100644 --- a/include/internal/catch_interfaces_reporter.h +++ b/include/internal/catch_interfaces_reporter.h @@ -14,6 +14,7 @@ #define TWOBLUECUBES_CATCH_IREPORTERREGISTRY_INCLUDED #include "catch_common.h" +#include "catch_totals.hpp" #include <string> #include <ostream> @@ -54,8 +55,7 @@ namespace Catch () = 0; virtual void EndTesting - ( std::size_t succeeded, - std::size_t failed + ( const Totals& totals ) = 0; virtual void StartGroup @@ -64,8 +64,7 @@ namespace Catch virtual void EndGroup ( const std::string& groupName, - std::size_t succeeded, - std::size_t failed + const Totals& totals ) = 0; virtual void StartSection @@ -75,8 +74,7 @@ namespace Catch virtual void EndSection ( const std::string& sectionName, - std::size_t succeeded, - std::size_t failed + const Counts& assertions ) = 0; virtual void StartTestCase @@ -85,8 +83,7 @@ namespace Catch virtual void EndTestCase ( const TestCaseInfo& testInfo, - std::size_t succeeded, - std::size_t failed, + const Totals& totals, const std::string& stdOut, const std::string& stdErr ) = 0; diff --git a/include/internal/catch_runner_impl.hpp b/include/internal/catch_runner_impl.hpp index 1bd24c14..e9ff4b4b 100644 --- a/include/internal/catch_runner_impl.hpp +++ b/include/internal/catch_runner_impl.hpp @@ -317,7 +317,7 @@ namespace Catch ~Runner () { - m_reporter->EndTesting( m_totals.assertions.passed, m_totals.assertions.failed ); + m_reporter->EndTesting( m_totals ); Hub::setRunner( m_prevRunner ); Hub::setResultCapture( m_prevResultCapture ); } @@ -387,7 +387,7 @@ namespace Catch delete m_runningTest; m_runningTest = NULL; - m_reporter->EndTestCase( testInfo, m_totals.assertions.passed - prevTotals.assertions.passed, m_totals.assertions.failed - prevTotals.assertions.failed, redirectedCout, redirectedCerr ); + m_reporter->EndTestCase( testInfo, m_totals - prevTotals, redirectedCout, redirectedCerr ); } /////////////////////////////////////////////////////////////////////////// @@ -496,7 +496,7 @@ namespace Catch ) { m_runningTest->endSection( name ); - m_reporter->EndSection( name, m_totals.assertions.passed - prevAssertions.passed, m_totals.assertions.failed - prevAssertions.failed ); + m_reporter->EndSection( name, m_totals.assertions - prevAssertions ); } /////////////////////////////////////////////////////////////////////////// diff --git a/include/internal/catch_totals.hpp b/include/internal/catch_totals.hpp index 1a0c68b9..69815274 100644 --- a/include/internal/catch_totals.hpp +++ b/include/internal/catch_totals.hpp @@ -30,6 +30,10 @@ namespace Catch return diff; } + std::size_t total() const + { + return passed + failed; + } std::size_t passed; std::size_t failed; }; |