mirror of
https://github.com/catchorg/Catch2.git
synced 2025-08-01 21:05:39 +02:00
merge from upstream
This commit is contained in:
@@ -193,11 +193,19 @@ namespace Catch {
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
#define INTERNAL_CATCH_MSG( log, messageType, resultDisposition, macroName ) \
|
||||
do { \
|
||||
INTERNAL_CATCH_ACCEPT_INFO( "", macroName, resultDisposition ); \
|
||||
INTERNAL_CATCH_ACCEPT_EXPR( Catch::ExpressionResultBuilder( messageType ) << log, resultDisposition, true ) \
|
||||
} while( Catch::isTrue( false ) )
|
||||
#ifdef CATCH_CONFIG_VARIADIC_MACROS
|
||||
#define INTERNAL_CATCH_MSG( messageType, resultDisposition, macroName, ... ) \
|
||||
do { \
|
||||
INTERNAL_CATCH_ACCEPT_INFO( "", macroName, resultDisposition ); \
|
||||
INTERNAL_CATCH_ACCEPT_EXPR( Catch::ExpressionResultBuilder( messageType ) << __VA_ARGS__ +::Catch::StreamEndStop(), resultDisposition, true ) \
|
||||
} while( Catch::isTrue( false ) )
|
||||
#else
|
||||
#define INTERNAL_CATCH_MSG( messageType, resultDisposition, macroName, log ) \
|
||||
do { \
|
||||
INTERNAL_CATCH_ACCEPT_INFO( "", macroName, resultDisposition ); \
|
||||
INTERNAL_CATCH_ACCEPT_EXPR( Catch::ExpressionResultBuilder( messageType ) << log, resultDisposition, true ) \
|
||||
} while( Catch::isTrue( false ) )
|
||||
#endif
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
#define INTERNAL_CATCH_INFO( log, macroName ) \
|
||||
|
@@ -91,6 +91,20 @@ namespace Catch {
|
||||
inline bool isTrue( bool value ){ return value; }
|
||||
|
||||
void throwLogicError( std::string const& message, SourceLineInfo const& locationInfo );
|
||||
|
||||
// Use this in variadic streaming macros to allow
|
||||
// >> +StreamEndStop
|
||||
// as well as
|
||||
// >> stuff +StreamEndStop
|
||||
struct StreamEndStop {
|
||||
std::string operator+() {
|
||||
return std::string();
|
||||
}
|
||||
};
|
||||
template<typename T>
|
||||
T const& operator + ( T const& value, StreamEndStop ) {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
|
||||
#define CATCH_INTERNAL_LINEINFO ::Catch::SourceLineInfo( __FILE__, static_cast<std::size_t>( __LINE__ ) )
|
||||
|
@@ -10,6 +10,16 @@
|
||||
|
||||
// Much of the following code is based on Boost (1.53)
|
||||
|
||||
#ifdef __clang__
|
||||
|
||||
#if __has_feature(cxx_nullptr)
|
||||
|
||||
#define CATCH_CONFIG_CPP11_NULLPTR
|
||||
|
||||
#endif
|
||||
|
||||
#endif // __clang__
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Borland
|
||||
#ifdef __BORLANDC__
|
||||
@@ -56,6 +66,11 @@
|
||||
|
||||
#endif // __GNUC__ < 3
|
||||
|
||||
#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6 && defined(__GXX_EXPERIMENTAL_CXX0X__) )
|
||||
|
||||
#define CATCH_CONFIG_CPP11_NULLPTR
|
||||
#endif
|
||||
|
||||
|
||||
#endif // __GNUC__
|
||||
|
||||
|
@@ -14,7 +14,7 @@ namespace Catch {
|
||||
|
||||
// These numbers are maintained by a script
|
||||
template <typename T>
|
||||
const T LibraryVersionInfo<T>::value( 1, 0, 17, "master" );
|
||||
const T LibraryVersionInfo<T>::value( 1, 0, 19, "master" );
|
||||
}
|
||||
|
||||
#endif // TWOBLUECUBES_CATCH_VERSION_HPP_INCLUDED
|
||||
|
Reference in New Issue
Block a user