2012-02-15 09:20:06 +01:00
|
|
|
/*
|
|
|
|
* catch_self_test.cpp
|
|
|
|
* Catch
|
|
|
|
*
|
|
|
|
* Created by Phil on 14/02/2012.
|
|
|
|
* Copyright 2012 Two Blue Cubes Ltd. All rights reserved.
|
|
|
|
*
|
|
|
|
* Distributed under the Boost Software License, Version 1.0. (See accompanying
|
|
|
|
* file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define CATCH_CONFIG_MAIN
|
|
|
|
#include "catch_self_test.hpp"
|
|
|
|
|
|
|
|
namespace Catch
|
|
|
|
{
|
|
|
|
///////////////////////////////////////////////////////////////////////////
|
|
|
|
std::size_t EmbeddedRunner::runMatching
|
|
|
|
(
|
2012-02-23 19:51:21 +01:00
|
|
|
const std::string& rawTestSpec
|
|
|
|
)
|
2012-02-15 09:20:06 +01:00
|
|
|
{
|
|
|
|
std::ostringstream oss;
|
|
|
|
Config config;
|
|
|
|
config.setStreamBuf( oss.rdbuf() );
|
|
|
|
config.setReporter( "basic" );
|
|
|
|
|
|
|
|
std::size_t result;
|
|
|
|
|
|
|
|
// Scoped because Runner doesn't report EndTesting until its destructor
|
|
|
|
{
|
|
|
|
Runner runner( config );
|
|
|
|
result = runner.runMatching( rawTestSpec );
|
2012-02-23 19:51:21 +01:00
|
|
|
m_totals = runner.getTotals();
|
2012-02-15 09:20:06 +01:00
|
|
|
}
|
|
|
|
m_output = oss.str();
|
|
|
|
return result;
|
|
|
|
}
|
2012-02-15 19:36:36 +01:00
|
|
|
}
|