mirror of
https://github.com/catchorg/Catch2.git
synced 2025-05-27 15:09:33 +00:00
Added new cpp to VS project
Moved catch_self_test.cpp and added it to VS2010 project
This commit is contained in:
parent
6e0f58d474
commit
93b8a39c38
3 changed files with 8 additions and 4 deletions
41
projects/SelfTest/catch_self_test.cpp
Normal file
41
projects/SelfTest/catch_self_test.cpp
Normal file
|
@ -0,0 +1,41 @@
|
|||
/*
|
||||
* 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
|
||||
(
|
||||
const std::string& rawTestSpec
|
||||
)
|
||||
{
|
||||
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 );
|
||||
m_successes = runner.getSuccessCount();
|
||||
m_failures = runner.getFailureCount();
|
||||
}
|
||||
m_output = oss.str();
|
||||
return result;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue