mirror of
				https://github.com/catchorg/Catch2.git
				synced 2025-10-31 20:27:11 +01:00 
			
		
		
		
	Merge branch 'master' of https://github.com/gnzlbg/Catch
# By gnzlbg # Via gnzlbg * 'master' of https://github.com/gnzlbg/Catch: Conditionally removes usage of deprecated features Conflicts (resolved): include/internal/catch_common.h include/internal/catch_section.hpp
This commit is contained in:
		| @@ -41,6 +41,12 @@ namespace Catch { | ||||
|         AssertionResult(); | ||||
|         AssertionResult( AssertionInfo const& info, AssertionResultData const& data ); | ||||
|         ~AssertionResult(); | ||||
| #  ifdef CATCH_CPP11_OR_GREATER | ||||
|          AssertionResult( AssertionResult const& )              = default; | ||||
|          AssertionResult( AssertionResult && )                  = default; | ||||
|          AssertionResult& operator = ( AssertionResult const& ) = default; | ||||
|          AssertionResult& operator = ( AssertionResult && )     = default; | ||||
| #  endif | ||||
|  | ||||
|         bool isOk() const; | ||||
|         bool succeeded() const; | ||||
|   | ||||
| @@ -78,6 +78,11 @@ namespace Catch { | ||||
|         SourceLineInfo(); | ||||
|         SourceLineInfo( char const* _file, std::size_t _line ); | ||||
|         SourceLineInfo( SourceLineInfo const& other ); | ||||
| #  ifdef CATCH_CPP11_OR_GREATER | ||||
|         SourceLineInfo( SourceLineInfo && )                  = default; | ||||
|         SourceLineInfo& operator = ( SourceLineInfo const& ) = default; | ||||
|         SourceLineInfo& operator = ( SourceLineInfo && )     = default; | ||||
| #  endif | ||||
|         bool empty() const; | ||||
|         bool operator == ( SourceLineInfo const& other ) const; | ||||
|  | ||||
|   | ||||
| @@ -96,5 +96,28 @@ | ||||
|  | ||||
| #endif | ||||
|  | ||||
| //////////////////////////////////////////////////////////////////////////////// | ||||
| // C++ language feature support | ||||
|  | ||||
| // detect language version: | ||||
| #if (__cplusplus == 201103L) | ||||
| #  define CATCH_CPP11 | ||||
| #  define CATCH_CPP11_OR_GREATER | ||||
| #elif (__cplusplus >= 201103L) | ||||
| #  define CATCH_CPP11_OR_GREATER | ||||
| #endif | ||||
|  | ||||
| // noexcept support: | ||||
| #ifdef CATCH_CPP11_OR_GREATER | ||||
| #  if (__has_feature(cxx_noexcept)) | ||||
| #    define CATCH_NOEXCEPT noexcept | ||||
| #    define CATCH_NOEXCEPT_IS(x) noexcept(x) | ||||
| #  endif | ||||
| #endif | ||||
| #ifndef CATCH_NO_EXCEPT | ||||
| #  define CATCH_NOEXCEPT throw() | ||||
| #  define CATCH_NOEXCEPT_IS(x) | ||||
| #endif | ||||
|  | ||||
| #endif // TWOBLUECUBES_CATCH_COMPILER_CAPABILITIES_HPP_INCLUDED | ||||
|  | ||||
|   | ||||
| @@ -14,14 +14,21 @@ | ||||
|  | ||||
| namespace Catch { | ||||
|  | ||||
| // Wraps the LHS of an expression and captures the operator and RHS (if any) - wrapping them all | ||||
| // in an ExpressionResultBuilder object | ||||
| // Wraps the LHS of an expression and captures the operator and RHS (if any) - | ||||
| // wrapping them all in an ExpressionResultBuilder object | ||||
| template<typename T> | ||||
| class ExpressionLhs { | ||||
|     void operator = ( ExpressionLhs const& ); | ||||
|     ExpressionLhs& operator = ( ExpressionLhs const& ); | ||||
| #  ifdef CATCH_CPP11_OR_GREATER | ||||
|     ExpressionLhs& operator = ( ExpressionLhs && ) = delete; | ||||
| #  endif | ||||
|  | ||||
| public: | ||||
|     ExpressionLhs( T lhs ) : m_lhs( lhs ) {} | ||||
| #  ifdef CATCH_CPP11_OR_GREATER | ||||
|     ExpressionLhs( ExpressionLhs const& ) = default; | ||||
|     ExpressionLhs( ExpressionLhs && )     = default; | ||||
| #  endif | ||||
|  | ||||
|     template<typename RhsT> | ||||
|     ExpressionResultBuilder& operator == ( RhsT const& rhs ) { | ||||
|   | ||||
| @@ -42,7 +42,7 @@ | ||||
| namespace Catch { | ||||
|     NonCopyable::~NonCopyable() {} | ||||
|     IShared::~IShared() {} | ||||
|     StreamBufBase::~StreamBufBase() throw() {} | ||||
|     StreamBufBase::~StreamBufBase() CATCH_NOEXCEPT {} | ||||
|     IContext::~IContext() {} | ||||
|     IResultCapture::~IResultCapture() {} | ||||
|     ITestCase::~ITestCase() {} | ||||
|   | ||||
| @@ -101,6 +101,13 @@ namespace Catch | ||||
|         } | ||||
|         virtual ~AssertionStats(); | ||||
|  | ||||
| #  ifdef CATCH_CPP11_OR_GREATER | ||||
|         AssertionStats( AssertionStats const& )              = default; | ||||
|         AssertionStats( AssertionStats && )                  = default; | ||||
|         AssertionStats& operator = ( AssertionStats const& ) = default; | ||||
|         AssertionStats& operator = ( AssertionStats && )     = default; | ||||
| #  endif | ||||
|  | ||||
|         AssertionResult assertionResult; | ||||
|         std::vector<MessageInfo> infoMessages; | ||||
|         Totals totals; | ||||
| @@ -117,6 +124,12 @@ namespace Catch | ||||
|             missingAssertions( _missingAssertions ) | ||||
|         {} | ||||
|         virtual ~SectionStats(); | ||||
| #  ifdef CATCH_CPP11_OR_GREATER | ||||
|         SectionStats( SectionStats const& )              = default; | ||||
|         SectionStats( SectionStats && )                  = default; | ||||
|         SectionStats& operator = ( SectionStats const& ) = default; | ||||
|         SectionStats& operator = ( SectionStats && )     = default; | ||||
| #  endif | ||||
|  | ||||
|         SectionInfo sectionInfo; | ||||
|         Counts assertions; | ||||
| @@ -138,6 +151,13 @@ namespace Catch | ||||
|         {} | ||||
|         virtual ~TestCaseStats(); | ||||
|  | ||||
| #  ifdef CATCH_CPP11_OR_GREATER | ||||
|         TestCaseStats( TestCaseStats const& )              = default; | ||||
|         TestCaseStats( TestCaseStats && )                  = default; | ||||
|         TestCaseStats& operator = ( TestCaseStats const& ) = default; | ||||
|         TestCaseStats& operator = ( TestCaseStats && )     = default; | ||||
| #  endif | ||||
|  | ||||
|         TestCaseInfo testInfo; | ||||
|         Totals totals; | ||||
|         std::string stdOut; | ||||
| @@ -159,6 +179,13 @@ namespace Catch | ||||
|         {} | ||||
|         virtual ~TestGroupStats(); | ||||
|  | ||||
| #  ifdef CATCH_CPP11_OR_GREATER | ||||
|         TestGroupStats( TestGroupStats const& )              = default; | ||||
|         TestGroupStats( TestGroupStats && )                  = default; | ||||
|         TestGroupStats& operator = ( TestGroupStats const& ) = default; | ||||
|         TestGroupStats& operator = ( TestGroupStats && )     = default; | ||||
| #  endif | ||||
|  | ||||
|         GroupInfo groupInfo; | ||||
|         Totals totals; | ||||
|         bool aborting; | ||||
| @@ -172,12 +199,20 @@ namespace Catch | ||||
|             totals( _totals ), | ||||
|             aborting( _aborting ) | ||||
|         {} | ||||
|         virtual ~TestRunStats(); | ||||
|  | ||||
| #  ifndef CATCH_CPP11_OR_GREATER | ||||
|         TestRunStats( TestRunStats const& _other ) | ||||
|         :   runInfo( _other.runInfo ), | ||||
|             totals( _other.totals ), | ||||
|             aborting( _other.aborting ) | ||||
|         {} | ||||
|         virtual ~TestRunStats(); | ||||
| #  else | ||||
|         TestRunStats( TestRunStats const& )              = default; | ||||
|         TestRunStats( TestRunStats && )                  = default; | ||||
|         TestRunStats& operator = ( TestRunStats const& ) = default; | ||||
|         TestRunStats& operator = ( TestRunStats && )     = default; | ||||
| #  endif | ||||
|  | ||||
|         TestRunInfo runInfo; | ||||
|         Totals totals; | ||||
|   | ||||
| @@ -18,9 +18,9 @@ namespace Catch { | ||||
|     public: | ||||
|         NotImplementedException( SourceLineInfo const& lineInfo ); | ||||
|  | ||||
|         virtual ~NotImplementedException() throw() {} | ||||
|         virtual ~NotImplementedException() CATCH_NOEXCEPT {} | ||||
|  | ||||
|         virtual const char* what() const throw(); | ||||
|         virtual const char* what() const CATCH_NOEXCEPT; | ||||
|  | ||||
|     private: | ||||
|         std::string m_what; | ||||
|   | ||||
| @@ -21,7 +21,7 @@ namespace Catch { | ||||
|         m_what = oss.str(); | ||||
|     } | ||||
|  | ||||
|     const char* NotImplementedException::what() const throw() { | ||||
|     const char* NotImplementedException::what() const CATCH_NOEXCEPT { | ||||
|         return m_what.c_str(); | ||||
|     } | ||||
|  | ||||
|   | ||||
| @@ -22,6 +22,12 @@ namespace Catch { | ||||
|                     std::string const& name, | ||||
|                     std::string const& description = "" ); | ||||
|         ~Section(); | ||||
| #  ifdef CATCH_CPP11_OR_GREATER | ||||
|         Section( Section const& )              = default; | ||||
|         Section( Section && )                  = default; | ||||
|         Section& operator = ( Section const& ) = default; | ||||
|         Section& operator = ( Section && )     = default; | ||||
| #  endif | ||||
|  | ||||
|         // This indicates whether the section should be executed or not | ||||
|         operator bool(); | ||||
|   | ||||
| @@ -28,7 +28,7 @@ namespace Catch { | ||||
|             setp( data, data + sizeof(data) ); | ||||
|         } | ||||
|  | ||||
|         ~StreamBufImpl() throw() { | ||||
|         ~StreamBufImpl() CATCH_NOEXCEPT { | ||||
|             sync(); | ||||
|         } | ||||
|  | ||||
|   | ||||
| @@ -8,13 +8,15 @@ | ||||
| #ifndef TWOBLUECUBES_CATCH_STREAMBUF_H_INCLUDED | ||||
| #define TWOBLUECUBES_CATCH_STREAMBUF_H_INCLUDED | ||||
|  | ||||
| #include "catch_compiler_capabilities.h" | ||||
|  | ||||
| #include <streambuf> | ||||
|  | ||||
| namespace Catch { | ||||
|  | ||||
|     class StreamBufBase : public std::streambuf { | ||||
|     public: | ||||
|         virtual ~StreamBufBase() throw(); | ||||
|         virtual ~StreamBufBase() CATCH_NOEXCEPT; | ||||
|     }; | ||||
| } | ||||
|  | ||||
|   | ||||
| @@ -13,7 +13,7 @@ | ||||
| namespace Catch { | ||||
|  | ||||
|     // These numbers are maintained by a script | ||||
|     Version libraryVersion( 1, 0, 37, "master" ); | ||||
|     Version libraryVersion( 1, 0, 38, "master" ); | ||||
| } | ||||
|  | ||||
| #endif // TWOBLUECUBES_CATCH_VERSION_HPP_INCLUDED | ||||
|   | ||||
| @@ -66,11 +66,18 @@ namespace Catch { | ||||
|                 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 ); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Phil Nash
					Phil Nash