This commit is contained in:
Phil Nash 2015-05-19 18:40:00 +01:00
parent e86daf8bdd
commit 318c936712
3 changed files with 84 additions and 54 deletions

View File

@ -1,6 +1,6 @@
![catch logo](catch-logo-small.png) ![catch logo](catch-logo-small.png)
*v1.1 build 1 (master branch)* *v1.1 build 2 (master branch)*
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)

View File

@ -13,7 +13,7 @@
namespace Catch { namespace Catch {
// These numbers are maintained by a script // These numbers are maintained by a script
Version libraryVersion( 1, 1, 1, "master" ); Version libraryVersion( 1, 1, 2, "master" );
} }
#endif // TWOBLUECUBES_CATCH_VERSION_HPP_INCLUDED #endif // TWOBLUECUBES_CATCH_VERSION_HPP_INCLUDED

View File

@ -1,6 +1,6 @@
/* /*
* CATCH v1.1 build 1 (master branch) * CATCH v1.1 build 2 (master branch)
* Generated: 2015-03-27 18:00:16.346230 * Generated: 2015-05-19 22:28:31.909693
* ---------------------------------------------------------- * ----------------------------------------------------------
* 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.
@ -69,7 +69,21 @@
// #included from: catch_compiler_capabilities.h // #included from: catch_compiler_capabilities.h
#define TWOBLUECUBES_CATCH_COMPILER_CAPABILITIES_HPP_INCLUDED #define TWOBLUECUBES_CATCH_COMPILER_CAPABILITIES_HPP_INCLUDED
// Much of the following code is based on Boost (1.53) // Detect a number of compiler features - mostly C++11/14 conformance - by compiler
// The following features are defined:
//
// CATCH_CONFIG_CPP11_NULLPTR : is nullptr supported?
// CATCH_CONFIG_CPP11_NOEXCEPT : is noexcept supported?
// CATCH_CONFIG_CPP11_GENERATED_METHODS : The delete and default keywords for compiler generated methods
// CATCH_CONFIG_CPP11_IS_ENUM : std::is_enum is supported?
// CATCH_CONFIG_CPP11_TUPLE : std::tuple is supported
// CATCH_CONFIG_CPP11_OR_GREATER : Is C++11 supported?
// CATCH_CONFIG_SFINAE : is basic (C++03) SFINAE supported?
// CATCH_CONFIG_VARIADIC_MACROS : are variadic macros supported?
// A lot of this code is based on Boost (1.53)
#ifdef __clang__ #ifdef __clang__
@ -148,6 +162,13 @@
//#define CATCH_CONFIG_SFINAE // Not confirmed //#define CATCH_CONFIG_SFINAE // Not confirmed
#endif #endif
#if (_MSC_VER >= 1900 ) // (VC++ 13 (VS2015))
#define CATCH_CONFIG_CPP11_NOEXCEPT
#define CATCH_CONFIG_CPP11_GENERATED_METHODS
#define CATCH_CONFIG_CPP11_NULLPTR
//#define CATCH_CONFIG_SFINAE // Don't use, for now
#endif
#endif // _MSC_VER #endif // _MSC_VER
// Use variadic macros if the compiler supports them // Use variadic macros if the compiler supports them
@ -165,14 +186,41 @@
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// C++ language feature support // C++ language feature support
// detect language version: // catch all support for C++11
#if (__cplusplus == 201103L) #if (__cplusplus >= 201103L)
# define CATCH_CPP11
# define CATCH_CPP11_OR_GREATER
#elif (__cplusplus >= 201103L)
# define CATCH_CPP11_OR_GREATER # define CATCH_CPP11_OR_GREATER
# ifndef CATCH_CONFIG_CPP11_NULLPTR
# define CATCH_CONFIG_CPP11_NULLPTR
# endif # endif
# ifndef CATCH_CONFIG_CPP11_NOEXCEPT
# define CATCH_CONFIG_CPP11_NOEXCEPT
# endif
# ifndef CATCH_CONFIG_CPP11_GENERATED_METHODS
# define CATCH_CONFIG_CPP11_GENERATED_METHODS
# endif
# ifndef CATCH_CONFIG_CPP11_IS_ENUM
# define CATCH_CONFIG_CPP11_IS_ENUM
# endif
# ifndef CATCH_CONFIG_CPP11_TUPLE
# define CATCH_CONFIG_CPP11_TUPLE
# endif
# ifndef CATCH_CONFIG_SFINAE
//# define CATCH_CONFIG_SFINAE // Don't use, for now
# endif
# ifndef CATCH_CONFIG_VARIADIC_MACROS
# define CATCH_CONFIG_VARIADIC_MACROS
# endif
#endif // __cplusplus >= 201103L
// noexcept support: // noexcept support:
#if defined(CATCH_CONFIG_CPP11_NOEXCEPT) && !defined(CATCH_NOEXCEPT) #if defined(CATCH_CONFIG_CPP11_NOEXCEPT) && !defined(CATCH_NOEXCEPT)
# define CATCH_NOEXCEPT noexcept # define CATCH_NOEXCEPT noexcept
@ -185,7 +233,7 @@
namespace Catch { namespace Catch {
class NonCopyable { class NonCopyable {
#ifdef CATCH_CPP11_OR_GREATER #ifdef CATCH_CONFIG_CPP11_GENERATED_METHODS
NonCopyable( NonCopyable const& ) = delete; NonCopyable( NonCopyable const& ) = delete;
NonCopyable( NonCopyable && ) = delete; NonCopyable( NonCopyable && ) = delete;
NonCopyable& operator = ( NonCopyable const& ) = delete; NonCopyable& operator = ( NonCopyable const& ) = delete;
@ -248,7 +296,7 @@ namespace Catch {
SourceLineInfo(); SourceLineInfo();
SourceLineInfo( char const* _file, std::size_t _line ); SourceLineInfo( char const* _file, std::size_t _line );
SourceLineInfo( SourceLineInfo const& other ); SourceLineInfo( SourceLineInfo const& other );
# ifdef CATCH_CPP11_OR_GREATER # ifdef CATCH_CONFIG_CPP11_GENERATED_METHODS
SourceLineInfo( SourceLineInfo && ) = default; SourceLineInfo( SourceLineInfo && ) = default;
SourceLineInfo& operator = ( SourceLineInfo const& ) = default; SourceLineInfo& operator = ( SourceLineInfo const& ) = default;
SourceLineInfo& operator = ( SourceLineInfo && ) = default; SourceLineInfo& operator = ( SourceLineInfo && ) = default;
@ -637,11 +685,11 @@ namespace Catch {
// ResultDisposition::Flags enum // ResultDisposition::Flags enum
struct ResultDisposition { enum Flags { struct ResultDisposition { enum Flags {
Normal = 0x00, Normal = 0x01,
ContinueOnFailure = 0x01, // Failures fail test, but execution continues ContinueOnFailure = 0x02, // Failures fail test, but execution continues
FalseTest = 0x02, // Prefix expression with ! FalseTest = 0x04, // Prefix expression with !
SuppressFail = 0x04 // Failures are reported but do not fail the test SuppressFail = 0x08 // Failures are reported but do not fail the test
}; }; }; };
inline ResultDisposition::Flags operator | ( ResultDisposition::Flags lhs, ResultDisposition::Flags rhs ) { inline ResultDisposition::Flags operator | ( ResultDisposition::Flags lhs, ResultDisposition::Flags rhs ) {
@ -689,7 +737,7 @@ namespace Catch {
AssertionResult(); AssertionResult();
AssertionResult( AssertionInfo const& info, AssertionResultData const& data ); AssertionResult( AssertionInfo const& info, AssertionResultData const& data );
~AssertionResult(); ~AssertionResult();
# ifdef CATCH_CPP11_OR_GREATER # ifdef CATCH_CONFIG_CPP11_GENERATED_METHODS
AssertionResult( AssertionResult const& ) = default; AssertionResult( AssertionResult const& ) = default;
AssertionResult( AssertionResult && ) = default; AssertionResult( AssertionResult && ) = default;
AssertionResult& operator = ( AssertionResult const& ) = default; AssertionResult& operator = ( AssertionResult const& ) = default;
@ -1055,8 +1103,11 @@ inline id performOptionalSelector( id obj, SEL sel ) {
#endif #endif
#ifdef CATCH_CPP11_OR_GREATER #ifdef CATCH_CONFIG_CPP11_TUPLE
#include <tuple> #include <tuple>
#endif
#ifdef CATCH_CONFIG_CPP11_IS_ENUM
#include <type_traits> #include <type_traits>
#endif #endif
@ -1138,7 +1189,7 @@ namespace Detail {
#endif #endif
#if defined(CATCH_CPP11_OR_GREATER) #if defined(CATCH_CONFIG_CPP11_IS_ENUM)
template<typename T, template<typename T,
bool IsEnum = std::is_enum<T>::value bool IsEnum = std::is_enum<T>::value
> >
@ -1160,7 +1211,7 @@ namespace Detail {
#endif #endif
template<bool C> template<bool C>
struct StringMakerBase { struct StringMakerBase {
#if defined(CATCH_CPP11_OR_GREATER) #if defined(CATCH_CONFIG_CPP11_IS_ENUM)
template<typename T> template<typename T>
static std::string convert( T const& v ) static std::string convert( T const& v )
{ {
@ -1233,7 +1284,7 @@ std::string toString( std::vector<T,Allocator> const& v ) {
return Detail::rangeToString( v.begin(), v.end() ); return Detail::rangeToString( v.begin(), v.end() );
} }
#ifdef CATCH_CPP11_OR_GREATER #ifdef CATCH_CONFIG_CPP11_TUPLE
// toString for tuples // toString for tuples
namespace TupleDetail { namespace TupleDetail {
@ -1273,7 +1324,7 @@ struct StringMaker<std::tuple<Types...>> {
return os.str(); return os.str();
} }
}; };
#endif #endif // CATCH_CONFIG_CPP11_TUPLE
namespace Detail { namespace Detail {
template<typename T> template<typename T>
@ -1318,13 +1369,13 @@ namespace Catch {
template<typename T> template<typename T>
class ExpressionLhs { class ExpressionLhs {
ExpressionLhs& operator = ( ExpressionLhs const& ); ExpressionLhs& operator = ( ExpressionLhs const& );
# ifdef CATCH_CPP11_OR_GREATER # ifdef CATCH_CONFIG_CPP11_GENERATED_METHODS
ExpressionLhs& operator = ( ExpressionLhs && ) = delete; ExpressionLhs& operator = ( ExpressionLhs && ) = delete;
# endif # endif
public: public:
ExpressionLhs( ResultBuilder& rb, T lhs ) : m_rb( rb ), m_lhs( lhs ) {} ExpressionLhs( ResultBuilder& rb, T lhs ) : m_rb( rb ), m_lhs( lhs ) {}
# ifdef CATCH_CPP11_OR_GREATER # ifdef CATCH_CONFIG_CPP11_GENERATED_METHODS
ExpressionLhs( ExpressionLhs const& ) = default; ExpressionLhs( ExpressionLhs const& ) = default;
ExpressionLhs( ExpressionLhs && ) = default; ExpressionLhs( ExpressionLhs && ) = default;
# endif # endif
@ -3514,7 +3565,7 @@ namespace Clara {
template<typename ConfigT> template<typename ConfigT>
struct IArgFunction { struct IArgFunction {
virtual ~IArgFunction() {} virtual ~IArgFunction() {}
# ifdef CATCH_CPP11_OR_GREATER # ifdef CATCH_CONFIG_CPP11_GENERATED_METHODS
IArgFunction() = default; IArgFunction() = default;
IArgFunction( IArgFunction const& ) = default; IArgFunction( IArgFunction const& ) = default;
# endif # endif
@ -4605,7 +4656,7 @@ namespace Catch
} }
virtual ~AssertionStats(); virtual ~AssertionStats();
# ifdef CATCH_CPP11_OR_GREATER # ifdef CATCH_CONFIG_CPP11_GENERATED_METHODS
AssertionStats( AssertionStats const& ) = default; AssertionStats( AssertionStats const& ) = default;
AssertionStats( AssertionStats && ) = default; AssertionStats( AssertionStats && ) = default;
AssertionStats& operator = ( AssertionStats const& ) = default; AssertionStats& operator = ( AssertionStats const& ) = default;
@ -4628,7 +4679,7 @@ namespace Catch
missingAssertions( _missingAssertions ) missingAssertions( _missingAssertions )
{} {}
virtual ~SectionStats(); virtual ~SectionStats();
# ifdef CATCH_CPP11_OR_GREATER # ifdef CATCH_CONFIG_CPP11_GENERATED_METHODS
SectionStats( SectionStats const& ) = default; SectionStats( SectionStats const& ) = default;
SectionStats( SectionStats && ) = default; SectionStats( SectionStats && ) = default;
SectionStats& operator = ( SectionStats const& ) = default; SectionStats& operator = ( SectionStats const& ) = default;
@ -4655,7 +4706,7 @@ namespace Catch
{} {}
virtual ~TestCaseStats(); virtual ~TestCaseStats();
# ifdef CATCH_CPP11_OR_GREATER # ifdef CATCH_CONFIG_CPP11_GENERATED_METHODS
TestCaseStats( TestCaseStats const& ) = default; TestCaseStats( TestCaseStats const& ) = default;
TestCaseStats( TestCaseStats && ) = default; TestCaseStats( TestCaseStats && ) = default;
TestCaseStats& operator = ( TestCaseStats const& ) = default; TestCaseStats& operator = ( TestCaseStats const& ) = default;
@ -4683,7 +4734,7 @@ namespace Catch
{} {}
virtual ~TestGroupStats(); virtual ~TestGroupStats();
# ifdef CATCH_CPP11_OR_GREATER # ifdef CATCH_CONFIG_CPP11_GENERATED_METHODS
TestGroupStats( TestGroupStats const& ) = default; TestGroupStats( TestGroupStats const& ) = default;
TestGroupStats( TestGroupStats && ) = default; TestGroupStats( TestGroupStats && ) = default;
TestGroupStats& operator = ( TestGroupStats const& ) = default; TestGroupStats& operator = ( TestGroupStats const& ) = default;
@ -4705,7 +4756,7 @@ namespace Catch
{} {}
virtual ~TestRunStats(); virtual ~TestRunStats();
# ifndef CATCH_CPP11_OR_GREATER # ifndef CATCH_CONFIG_CPP11_GENERATED_METHODS
TestRunStats( TestRunStats const& _other ) TestRunStats( TestRunStats const& _other )
: runInfo( _other.runInfo ), : runInfo( _other.runInfo ),
totals( _other.totals ), totals( _other.totals ),
@ -6751,7 +6802,7 @@ namespace Catch {
namespace Catch { namespace Catch {
// These numbers are maintained by a script // These numbers are maintained by a script
Version libraryVersion( 1, 1, 1, "master" ); Version libraryVersion( 1, 1, 2, "master" );
} }
// #included from: catch_message.hpp // #included from: catch_message.hpp
@ -7414,7 +7465,7 @@ namespace Catch {
if( !result.isOk() ) { if( !result.isOk() ) {
if( getCurrentContext().getConfig()->shouldDebugBreak() ) if( getCurrentContext().getConfig()->shouldDebugBreak() )
m_shouldDebugBreak = true; m_shouldDebugBreak = true;
if( getCurrentContext().getRunner()->aborting() || m_assertionInfo.resultDisposition == ResultDisposition::Normal ) if( getCurrentContext().getRunner()->aborting() || (m_assertionInfo.resultDisposition & ResultDisposition::Normal) )
m_shouldThrow = true; m_shouldThrow = true;
} }
} }
@ -7897,27 +7948,6 @@ namespace Catch {
endElement(); endElement();
} }
//# ifndef CATCH_CPP11_OR_GREATER
// XmlWriter& operator = ( XmlWriter const& other ) {
// XmlWriter temp( other );
// swap( temp );
// return *this;
// }
//# else
// XmlWriter( XmlWriter const& ) = default;
// XmlWriter( XmlWriter && ) = default;
// XmlWriter& operator = ( XmlWriter const& ) = default;
// XmlWriter& operator = ( XmlWriter && ) = default;
//# endif
//
// void swap( XmlWriter& other ) {
// std::swap( m_tagIsOpen, other.m_tagIsOpen );
// std::swap( m_needsNewline, other.m_needsNewline );
// std::swap( m_tags, other.m_tags );
// std::swap( m_indent, other.m_indent );
// std::swap( m_os, other.m_os );
// }
XmlWriter& startElement( std::string const& name ) { XmlWriter& startElement( std::string const& name ) {
ensureTagClosed(); ensureTagClosed();
newlineIfNecessary(); newlineIfNecessary();