mirror of
https://github.com/catchorg/Catch2.git
synced 2025-05-25 14:09:26 +00:00
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:
parent
83a66a6255
commit
b213202ad7
16 changed files with 432 additions and 67 deletions
|
@ -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 )
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue