Added self-test for section ordering

Added MockReporter for tracking test runs.
Added intrusive smart pointer. Config holds reporter by smart pointer, so we can route the mock reporter through multiple test runs
This commit is contained in:
Phil Nash committed 2012-05-04 07:55:11 +01:00
1 parent 83a66a6255
commit b213202ad7
16 files changed
+432 -67

No files matched your search

+15 -8
View File
@@ -13,18 +13,18 @@
#define CATCH_CONFIG_MAIN
#include "catch_self_test.hpp"
namespace Catch
{
///////////////////////////////////////////////////////////////////////////
std::size_t EmbeddedRunner::runMatching
(
const std::string& rawTestSpec
)
namespace Catch{
std::size_t EmbeddedRunner::runMatching(
const std::string& rawTestSpec,
const std::string& reporter )
{
std::ostringstream oss;
Config config;
config.setStreamBuf( oss.rdbuf() );
config.setReporter( "basic" );
//if( reporter == "mock" ) // !TBD
config.setReporter( m_reporter.get() );
std::size_t result;
@@ -37,4 +37,11 @@ namespace Catch
m_output = oss.str();
return result;
}
const std::string MockReporter::recordGroups = "[g]";
const std::string MockReporter::recordTestCases = "[tc]";
const std::string MockReporter::recordSections =" [s]";
INTERNAL_CATCH_REGISTER_REPORTER( "mock", MockReporter )
}