mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-16 18:52:25 +01:00
initial draft of changes to support Borland c++ Builder 5 / free compiler 5.5
This commit is contained in:
parent
b981632f7c
commit
203fd68187
5
.gitignore
vendored
5
.gitignore
vendored
@ -15,3 +15,8 @@ projects/VS2010/TestCatch/_UpgradeReport_Files/
|
|||||||
projects/VS2010/TestCatch/TestCatch/TestCatch.vcxproj.filters
|
projects/VS2010/TestCatch/TestCatch/TestCatch.vcxproj.filters
|
||||||
projects/VisualStudio/TestCatch/UpgradeLog.XML
|
projects/VisualStudio/TestCatch/UpgradeLog.XML
|
||||||
UpgradeLog.XML
|
UpgradeLog.XML
|
||||||
|
/projects\CPPBuilder5/*.~cpp
|
||||||
|
/single_include/*.~HPP
|
||||||
|
/projects\CPPBuilder5/*.~cpp
|
||||||
|
/projects\CPPBuilder5/*.~cpp
|
||||||
|
/projects\CPPBuilder5/*.~cpp
|
||||||
|
@ -61,7 +61,7 @@ namespace Catch {
|
|||||||
|
|
||||||
class CommandParser {
|
class CommandParser {
|
||||||
public:
|
public:
|
||||||
CommandParser( int argc, char const * const * argv ) : m_argc( static_cast<std::size_t>( argc ) ), m_argv( argv ) {}
|
CommandParser( int argc, char* const argv[] ) : m_argc( static_cast<std::size_t>( argc ) ), m_argv( argv ) {}
|
||||||
|
|
||||||
Command find( const std::string& arg1, const std::string& arg2, const std::string& arg3 ) const {
|
Command find( const std::string& arg1, const std::string& arg2, const std::string& arg3 ) const {
|
||||||
return find( arg1 ) + find( arg2 ) + find( arg3 );
|
return find( arg1 ) + find( arg2 ) + find( arg3 );
|
||||||
|
@ -54,7 +54,7 @@ namespace Catch {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void set( TextColour::Colours colour ) {
|
void set( TextColour::Colours colour ) {
|
||||||
WORD consoleColour = mapConsoleColour( colour );
|
WORD consoleColour = Catch::mapConsoleColour( colour );
|
||||||
if( consoleColour > 0 )
|
if( consoleColour > 0 )
|
||||||
SetConsoleTextAttribute( hStdout, consoleColour );
|
SetConsoleTextAttribute( hStdout, consoleColour );
|
||||||
}
|
}
|
||||||
|
@ -62,7 +62,7 @@ namespace Catch
|
|||||||
std::string::size_type start = str.find_first_not_of( "\n\r\t " );
|
std::string::size_type start = str.find_first_not_of( "\n\r\t " );
|
||||||
std::string::size_type end = str.find_last_not_of( "\n\r\t " );
|
std::string::size_type end = str.find_last_not_of( "\n\r\t " );
|
||||||
|
|
||||||
return start != std::string::npos ? str.substr( start, 1+end-start ) : "";
|
return start != std::string::npos ? str.substr( start, 1+end-start ) : std::string();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -73,7 +73,7 @@ namespace Catch {
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::string getExpandedExpression() const {
|
std::string getExpandedExpression() const {
|
||||||
return hasExpression() ? getExpandedExpressionInternal() : "";
|
return hasExpression() ? getExpandedExpressionInternal() : std::string();
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string getMessage() const {
|
std::string getMessage() const {
|
||||||
|
@ -227,7 +227,7 @@ namespace Catch {
|
|||||||
virtual std::string getCurrentTestName() const {
|
virtual std::string getCurrentTestName() const {
|
||||||
return m_runningTest
|
return m_runningTest
|
||||||
? m_runningTest->getTestCaseInfo().getName()
|
? m_runningTest->getTestCaseInfo().getName()
|
||||||
: "";
|
: std::string();
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual const ResultInfo* getLastResult() const {
|
virtual const ResultInfo* getLastResult() const {
|
||||||
|
@ -71,7 +71,7 @@ namespace Catch {
|
|||||||
if( counts.passed )
|
if( counts.passed )
|
||||||
m_config.stream() << counts.failed << " of " << counts.total() << " " << label << "s failed";
|
m_config.stream() << counts.failed << " of " << counts.total() << " " << label << "s failed";
|
||||||
else
|
else
|
||||||
m_config.stream() << ( counts.failed > 1 ? allPrefix : "" ) << pluralise( counts.failed, label ) << " failed";
|
m_config.stream() << ( counts.failed > 1 ? allPrefix : std::string() ) << pluralise( counts.failed, label ) << " failed";
|
||||||
}
|
}
|
||||||
|
|
||||||
void ReportCounts( const Totals& totals, const std::string& allPrefix = "All " ) {
|
void ReportCounts( const Totals& totals, const std::string& allPrefix = "All " ) {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Generated: 2012-07-05 18:47:13.729198
|
* Generated: 2012-07-19 00:07:37.689000
|
||||||
* ----------------------------------------------------------
|
* ----------------------------------------------------------
|
||||||
* This file has been merged from multiple headers. Please don't edit it directly
|
* This file has been merged from multiple headers. Please don't edit it directly
|
||||||
* Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved.
|
* Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved.
|
||||||
@ -318,7 +318,7 @@ namespace Catch
|
|||||||
std::string::size_type start = str.find_first_not_of( "\n\r\t " );
|
std::string::size_type start = str.find_first_not_of( "\n\r\t " );
|
||||||
std::string::size_type end = str.find_last_not_of( "\n\r\t " );
|
std::string::size_type end = str.find_last_not_of( "\n\r\t " );
|
||||||
|
|
||||||
return start != std::string::npos ? str.substr( start, 1+end-start ) : "";
|
return start != std::string::npos ? str.substr( start, 1+end-start ) : std::string();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -759,7 +759,7 @@ namespace Catch {
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::string getExpandedExpression() const {
|
std::string getExpandedExpression() const {
|
||||||
return hasExpression() ? getExpandedExpressionInternal() : "";
|
return hasExpression() ? getExpandedExpressionInternal() : std::string();
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string getMessage() const {
|
std::string getMessage() const {
|
||||||
@ -2212,9 +2212,6 @@ namespace Catch {
|
|||||||
inline std::string toString( NSString* const& nsstring ) {
|
inline std::string toString( NSString* const& nsstring ) {
|
||||||
return std::string( "@\"" ) + [nsstring UTF8String] + "\"";
|
return std::string( "@\"" ) + [nsstring UTF8String] + "\"";
|
||||||
}
|
}
|
||||||
inline std::string toString( NSObject* const& nsObject ) {
|
|
||||||
return toString( [nsObject description] );
|
|
||||||
}
|
|
||||||
|
|
||||||
namespace Matchers {
|
namespace Matchers {
|
||||||
namespace Impl {
|
namespace Impl {
|
||||||
@ -2986,7 +2983,7 @@ namespace Catch {
|
|||||||
virtual std::string getCurrentTestName() const {
|
virtual std::string getCurrentTestName() const {
|
||||||
return m_runningTest
|
return m_runningTest
|
||||||
? m_runningTest->getTestCaseInfo().getName()
|
? m_runningTest->getTestCaseInfo().getName()
|
||||||
: "";
|
: std::string();
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual const ResultInfo* getLastResult() const {
|
virtual const ResultInfo* getLastResult() const {
|
||||||
@ -3210,7 +3207,7 @@ namespace Catch {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void set( TextColour::Colours colour ) {
|
void set( TextColour::Colours colour ) {
|
||||||
WORD consoleColour = mapConsoleColour( colour );
|
WORD consoleColour = Catch::mapConsoleColour( colour );
|
||||||
if( consoleColour > 0 )
|
if( consoleColour > 0 )
|
||||||
SetConsoleTextAttribute( hStdout, consoleColour );
|
SetConsoleTextAttribute( hStdout, consoleColour );
|
||||||
}
|
}
|
||||||
@ -3551,7 +3548,7 @@ namespace Catch {
|
|||||||
|
|
||||||
class CommandParser {
|
class CommandParser {
|
||||||
public:
|
public:
|
||||||
CommandParser( int argc, char const * const * argv ) : m_argc( static_cast<std::size_t>( argc ) ), m_argv( argv ) {}
|
CommandParser( int argc, char* const argv[] ) : m_argc( static_cast<std::size_t>( argc ) ), m_argv( argv ) {}
|
||||||
|
|
||||||
Command find( const std::string& arg1, const std::string& arg2, const std::string& arg3 ) const {
|
Command find( const std::string& arg1, const std::string& arg2, const std::string& arg3 ) const {
|
||||||
return find( arg1 ) + find( arg2 ) + find( arg3 );
|
return find( arg1 ) + find( arg2 ) + find( arg3 );
|
||||||
@ -3799,7 +3796,7 @@ namespace Catch {
|
|||||||
if( counts.passed )
|
if( counts.passed )
|
||||||
m_config.stream() << counts.failed << " of " << counts.total() << " " << label << "s failed";
|
m_config.stream() << counts.failed << " of " << counts.total() << " " << label << "s failed";
|
||||||
else
|
else
|
||||||
m_config.stream() << ( counts.failed > 1 ? allPrefix : "" ) << pluralise( counts.failed, label ) << " failed";
|
m_config.stream() << ( counts.failed > 1 ? allPrefix : std::string() ) << pluralise( counts.failed, label ) << " failed";
|
||||||
}
|
}
|
||||||
|
|
||||||
void ReportCounts( const Totals& totals, const std::string& allPrefix = "All " ) {
|
void ReportCounts( const Totals& totals, const std::string& allPrefix = "All " ) {
|
||||||
|
Loading…
Reference in New Issue
Block a user