mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-22 21:36:11 +01:00
dev build 3
This commit is contained in:
parent
a49f088032
commit
e4fa62a14e
@ -1,6 +1,6 @@
|
|||||||
![catch logo](catch-logo-small.png)
|
![catch logo](catch-logo-small.png)
|
||||||
|
|
||||||
*v1.3.0-develop.2*
|
*v1.3.0-develop.3*
|
||||||
|
|
||||||
Build status (on Travis CI) [![Build Status](https://travis-ci.org/philsquared/Catch.png)](https://travis-ci.org/philsquared/Catch)
|
Build status (on Travis CI) [![Build Status](https://travis-ci.org/philsquared/Catch.png)](https://travis-ci.org/philsquared/Catch)
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@ namespace Catch {
|
|||||||
return os;
|
return os;
|
||||||
}
|
}
|
||||||
|
|
||||||
Version libraryVersion( 1, 3, 0, "develop", 2 );
|
Version libraryVersion( 1, 3, 0, "develop", 3 );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Catch v1.3.0-develop.2
|
* Catch v1.3.0-develop.3
|
||||||
* Generated: 2015-11-06 18:05:44.676531
|
* Generated: 2015-11-18 08:39:33.879583
|
||||||
* ----------------------------------------------------------
|
* ----------------------------------------------------------
|
||||||
* 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.
|
||||||
@ -2454,6 +2454,8 @@ using namespace Generators;
|
|||||||
#define TWOBLUECUBES_CATCH_INTERFACES_EXCEPTION_H_INCLUDED
|
#define TWOBLUECUBES_CATCH_INTERFACES_EXCEPTION_H_INCLUDED
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
// #included from: catch_interfaces_registry_hub.h
|
// #included from: catch_interfaces_registry_hub.h
|
||||||
#define TWOBLUECUBES_CATCH_INTERFACES_REGISTRY_HUB_H_INCLUDED
|
#define TWOBLUECUBES_CATCH_INTERFACES_REGISTRY_HUB_H_INCLUDED
|
||||||
|
|
||||||
@ -2491,14 +2493,16 @@ namespace Catch {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
namespace Catch {
|
namespace Catch {
|
||||||
|
|
||||||
typedef std::string(*exceptionTranslateFunction)();
|
typedef std::string(*exceptionTranslateFunction)();
|
||||||
|
|
||||||
|
struct IExceptionTranslator;
|
||||||
|
typedef std::vector<const IExceptionTranslator*> ExceptionTranslators;
|
||||||
|
|
||||||
struct IExceptionTranslator {
|
struct IExceptionTranslator {
|
||||||
virtual ~IExceptionTranslator();
|
virtual ~IExceptionTranslator();
|
||||||
virtual std::string translate() const = 0;
|
virtual std::string translate( ExceptionTranslators::const_iterator it, ExceptionTranslators::const_iterator itEnd ) const = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct IExceptionTranslatorRegistry {
|
struct IExceptionTranslatorRegistry {
|
||||||
@ -2516,9 +2520,12 @@ namespace Catch {
|
|||||||
: m_translateFunction( translateFunction )
|
: m_translateFunction( translateFunction )
|
||||||
{}
|
{}
|
||||||
|
|
||||||
virtual std::string translate() const {
|
virtual std::string translate( ExceptionTranslators::const_iterator it, ExceptionTranslators::const_iterator itEnd ) const CATCH_OVERRIDE {
|
||||||
try {
|
try {
|
||||||
throw;
|
if( it == itEnd )
|
||||||
|
throw;
|
||||||
|
else
|
||||||
|
return (*it)->translate( it+1, itEnd );
|
||||||
}
|
}
|
||||||
catch( T& ex ) {
|
catch( T& ex ) {
|
||||||
return m_translateFunction( ex );
|
return m_translateFunction( ex );
|
||||||
@ -6059,7 +6066,7 @@ namespace Catch {
|
|||||||
Catch::cout() << "For more detail usage please see the project docs\n" << std::endl;
|
Catch::cout() << "For more detail usage please see the project docs\n" << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
int applyCommandLine( int argc, char* const argv[], OnUnusedOptions::DoWhat unusedOptionBehaviour = OnUnusedOptions::Fail ) {
|
int applyCommandLine( int argc, char const* const argv[], OnUnusedOptions::DoWhat unusedOptionBehaviour = OnUnusedOptions::Fail ) {
|
||||||
try {
|
try {
|
||||||
m_cli.setThrowOnUnrecognisedTokens( unusedOptionBehaviour == OnUnusedOptions::Fail );
|
m_cli.setThrowOnUnrecognisedTokens( unusedOptionBehaviour == OnUnusedOptions::Fail );
|
||||||
m_unusedTokens = m_cli.parseInto( argc, argv, m_configData );
|
m_unusedTokens = m_cli.parseInto( argc, argv, m_configData );
|
||||||
@ -6086,7 +6093,7 @@ namespace Catch {
|
|||||||
m_config.reset();
|
m_config.reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
int run( int argc, char* const argv[] ) {
|
int run( int argc, char const* const argv[] ) {
|
||||||
|
|
||||||
int returnCode = applyCommandLine( argc, argv );
|
int returnCode = applyCommandLine( argc, argv );
|
||||||
if( returnCode == 0 )
|
if( returnCode == 0 )
|
||||||
@ -6378,13 +6385,13 @@ namespace Catch {
|
|||||||
#ifdef __OBJC__
|
#ifdef __OBJC__
|
||||||
// In Objective-C try objective-c exceptions first
|
// In Objective-C try objective-c exceptions first
|
||||||
@try {
|
@try {
|
||||||
throw;
|
return tryTranslators();
|
||||||
}
|
}
|
||||||
@catch (NSException *exception) {
|
@catch (NSException *exception) {
|
||||||
return Catch::toString( [exception description] );
|
return Catch::toString( [exception description] );
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
throw;
|
return tryTranslators();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
catch( TestFailureException& ) {
|
catch( TestFailureException& ) {
|
||||||
@ -6400,20 +6407,15 @@ namespace Catch {
|
|||||||
return msg;
|
return msg;
|
||||||
}
|
}
|
||||||
catch(...) {
|
catch(...) {
|
||||||
return tryTranslators( m_translators.begin() );
|
return "Unknown exception";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string tryTranslators( std::vector<const IExceptionTranslator*>::const_iterator it ) const {
|
std::string tryTranslators() const {
|
||||||
if( it == m_translators.end() )
|
if( m_translators.empty() )
|
||||||
return "Unknown exception";
|
throw;
|
||||||
|
else
|
||||||
try {
|
return m_translators[0]->translate( m_translators.begin()+1, m_translators.end() );
|
||||||
return (*it)->translate();
|
|
||||||
}
|
|
||||||
catch(...) {
|
|
||||||
return tryTranslators( it+1 );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@ -7239,7 +7241,7 @@ namespace Catch {
|
|||||||
return os;
|
return os;
|
||||||
}
|
}
|
||||||
|
|
||||||
Version libraryVersion( 1, 3, 0, "develop", 2 );
|
Version libraryVersion( 1, 3, 0, "develop", 3 );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user