Added new cpp to VS project

Moved catch_self_test.cpp and added it to VS2010 project
This commit is contained in:
Phil Nash
2012-02-17 09:05:20 +00:00
parent 6e0f58d474
commit 93b8a39c38
3 changed files with 8 additions and 4 deletions

View File

@@ -17,7 +17,7 @@
4A6D0C3D149B3D9E00DB3EAA /* MiscTests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4A6D0C34149B3D9E00DB3EAA /* MiscTests.cpp */; };
4A6D0C3E149B3D9E00DB3EAA /* TestMain.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4A6D0C35149B3D9E00DB3EAA /* TestMain.cpp */; };
4A6D0C3F149B3D9E00DB3EAA /* TrickyTests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4A6D0C36149B3D9E00DB3EAA /* TrickyTests.cpp */; };
4A73282E14E9A6390044823F /* catch_self_test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4A73282D14E9A6390044823F /* catch_self_test.cpp */; };
4AE1840B14EE4F230066340D /* catch_self_test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4AE1840A14EE4F230066340D /* catch_self_test.cpp */; };
/* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */
@@ -83,7 +83,7 @@
4A6D0C66149B3E3D00DB3EAA /* catch_reporter_basic.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = catch_reporter_basic.hpp; sourceTree = "<group>"; };
4A6D0C67149B3E3D00DB3EAA /* catch_reporter_junit.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = catch_reporter_junit.hpp; sourceTree = "<group>"; };
4A6D0C68149B3E3D00DB3EAA /* catch_reporter_xml.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = catch_reporter_xml.hpp; sourceTree = "<group>"; };
4A73282D14E9A6390044823F /* catch_self_test.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = catch_self_test.cpp; sourceTree = "<group>"; };
4AE1840A14EE4F230066340D /* catch_self_test.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = catch_self_test.cpp; path = ../../../SelfTest/catch_self_test.cpp; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@@ -118,7 +118,7 @@
children = (
4A6D0C35149B3D9E00DB3EAA /* TestMain.cpp */,
4A6D0C2E149B3D9E00DB3EAA /* catch_self_test.hpp */,
4A73282D14E9A6390044823F /* catch_self_test.cpp */,
4AE1840A14EE4F230066340D /* catch_self_test.cpp */,
4A6D0C40149B3DAB00DB3EAA /* Tests */,
4A6D0C41149B3DE900DB3EAA /* Catch */,
4A6D0C26149B3D3B00DB3EAA /* CatchSelfTest.1 */,
@@ -262,7 +262,7 @@
4A6D0C3D149B3D9E00DB3EAA /* MiscTests.cpp in Sources */,
4A6D0C3E149B3D9E00DB3EAA /* TestMain.cpp in Sources */,
4A6D0C3F149B3D9E00DB3EAA /* TrickyTests.cpp in Sources */,
4A73282E14E9A6390044823F /* catch_self_test.cpp in Sources */,
4AE1840B14EE4F230066340D /* catch_self_test.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};

View File

@@ -1,41 +0,0 @@
/*
* 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;
}
}