v1.7.1 build

This commit is contained in:
Martin Hořeňovský 2017-02-07 10:06:52 +01:00
parent 2b74613c54
commit 7b8a27eadb
4 changed files with 102 additions and 67 deletions

View File

@ -1,10 +1,10 @@
![catch logo](catch-logo-small.png) ![catch logo](catch-logo-small.png)
*v1.7.0* *v1.7.1*
Build status (on Travis CI) [![Build Status](https://travis-ci.org/philsquared/Catch.svg?branch=master)](https://travis-ci.org/philsquared/Catch) Build status (on Travis CI) [![Build Status](https://travis-ci.org/philsquared/Catch.svg?branch=master)](https://travis-ci.org/philsquared/Catch)
<a href="https://github.com/philsquared/Catch/releases/download/v1.7.0/catch.hpp">The latest, single header, version can be downloaded directly using this link</a> <a href="https://github.com/philsquared/Catch/releases/download/v1.7.1/catch.hpp">The latest, single header, version can be downloaded directly using this link</a>
## What's the Catch? ## What's the Catch?

View File

@ -1,4 +1,19 @@
# 1.7.0 # 1.7.1
### Fixes:
* Fixed inconsistency in defining `NOMINMAX` and `WIN32_LEAN_AND_MEAN` inside `catch.hpp`.
* Fixed SEH-related compilation error under older MinGW compilers, by making Windows SEH handling opt-in for compilers other than MSVC.
* For specifics, look into the [documentation](docs/configuration.md).
* Fixed compilation error under MinGW caused by improper compiler detection.
* Fixed XML reporter sometimes leaving an empty output file when a test ends with signal/structured exception.
* Fixed XML reporter not reporting captured stdout/stderr.
* Fixed possible infinite recursion in Windows SEH.
* Fixed possible compilation error caused by Catch's operator overloads being ambiguous in regards to user-defined templated operators.
# Older versions
Release notes were not maintained prior to v1.6.0, but you should be able to work them out from the Git history
## 1.7.0
### Features/ Changes: ### Features/ Changes:
* Catch now runs significantly faster for passing tests * Catch now runs significantly faster for passing tests
@ -25,12 +40,6 @@
* Catch's CMakeLists now generates projects with warnings enabled. * Catch's CMakeLists now generates projects with warnings enabled.
# Older versions
Release notes were not maintained prior to v1.6.0, but you should be able to work them out from the Git history
## 1.6.1 ## 1.6.1
### Features/ Changes: ### Features/ Changes:

View File

@ -37,7 +37,7 @@ namespace Catch {
return os; return os;
} }
Version libraryVersion( 1, 7, 0, "", 0 ); Version libraryVersion( 1, 7, 1, "", 0 );
} }

View File

@ -1,6 +1,6 @@
/* /*
* Catch v1.7.0 * Catch v1.7.1
* Generated: 2017-02-01 21:32:13.239291 * Generated: 2017-02-07 09:44:56.263047
* ---------------------------------------------------------- * ----------------------------------------------------------
* 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.
@ -81,6 +81,7 @@
// CATCH_CONFIG_VARIADIC_MACROS : are variadic macros supported? // CATCH_CONFIG_VARIADIC_MACROS : are variadic macros supported?
// CATCH_CONFIG_COUNTER : is the __COUNTER__ macro supported? // CATCH_CONFIG_COUNTER : is the __COUNTER__ macro supported?
// CATCH_CONFIG_WINDOWS_SEH : is Windows SEH supported?
// **************** // ****************
// Note to maintainers: if new toggles are added please document them // Note to maintainers: if new toggles are added please document them
// in configuration.md, too // in configuration.md, too
@ -160,6 +161,8 @@
// Visual C++ // Visual C++
#ifdef _MSC_VER #ifdef _MSC_VER
#define CATCH_INTERNAL_CONFIG_WINDOWS_SEH
#if (_MSC_VER >= 1600) #if (_MSC_VER >= 1600)
# define CATCH_INTERNAL_CONFIG_CPP11_NULLPTR # define CATCH_INTERNAL_CONFIG_CPP11_NULLPTR
# define CATCH_INTERNAL_CONFIG_CPP11_UNIQUE_PTR # define CATCH_INTERNAL_CONFIG_CPP11_UNIQUE_PTR
@ -284,6 +287,9 @@
# if defined(CATCH_INTERNAL_CONFIG_CPP11_TYPE_TRAITS) && !defined(CATCH_CONFIG_CPP11_NO_TYPE_TRAITS) && !defined(CATCH_CONFIG_CPP11_TYPE_TRAITS) && !defined(CATCH_CONFIG_NO_CPP11) # if defined(CATCH_INTERNAL_CONFIG_CPP11_TYPE_TRAITS) && !defined(CATCH_CONFIG_CPP11_NO_TYPE_TRAITS) && !defined(CATCH_CONFIG_CPP11_TYPE_TRAITS) && !defined(CATCH_CONFIG_NO_CPP11)
# define CATCH_CONFIG_CPP11_TYPE_TRAITS # define CATCH_CONFIG_CPP11_TYPE_TRAITS
# endif # endif
#if defined(CATCH_INTERNAL_CONFIG_WINDOWS_SEH) && !defined(CATCH_CONFIG_NO_WINDOWS_SEH) && !defined(CATCH_CONFIG_WINDOWS_SEH)
# define CATCH_CONFIG_WINDOWS_SEH
#endif
#if !defined(CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS) #if !defined(CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS)
# define CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS # define CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS
@ -1878,45 +1884,45 @@ public:
template<typename RhsT> template<typename RhsT>
BinaryExpression<T, Internal::IsEqualTo, RhsT const&> BinaryExpression<T, Internal::IsEqualTo, RhsT const&>
operator == ( RhsT const& rhs ) const { operator == ( RhsT const& rhs ) {
return captureExpression<Internal::IsEqualTo>( rhs ); return captureExpression<Internal::IsEqualTo>( rhs );
} }
template<typename RhsT> template<typename RhsT>
BinaryExpression<T, Internal::IsNotEqualTo, RhsT const&> BinaryExpression<T, Internal::IsNotEqualTo, RhsT const&>
operator != ( RhsT const& rhs ) const { operator != ( RhsT const& rhs ) {
return captureExpression<Internal::IsNotEqualTo>( rhs ); return captureExpression<Internal::IsNotEqualTo>( rhs );
} }
template<typename RhsT> template<typename RhsT>
BinaryExpression<T, Internal::IsLessThan, RhsT const&> BinaryExpression<T, Internal::IsLessThan, RhsT const&>
operator < ( RhsT const& rhs ) const { operator < ( RhsT const& rhs ) {
return captureExpression<Internal::IsLessThan>( rhs ); return captureExpression<Internal::IsLessThan>( rhs );
} }
template<typename RhsT> template<typename RhsT>
BinaryExpression<T, Internal::IsGreaterThan, RhsT const&> BinaryExpression<T, Internal::IsGreaterThan, RhsT const&>
operator > ( RhsT const& rhs ) const { operator > ( RhsT const& rhs ) {
return captureExpression<Internal::IsGreaterThan>( rhs ); return captureExpression<Internal::IsGreaterThan>( rhs );
} }
template<typename RhsT> template<typename RhsT>
BinaryExpression<T, Internal::IsLessThanOrEqualTo, RhsT const&> BinaryExpression<T, Internal::IsLessThanOrEqualTo, RhsT const&>
operator <= ( RhsT const& rhs ) const { operator <= ( RhsT const& rhs ) {
return captureExpression<Internal::IsLessThanOrEqualTo>( rhs ); return captureExpression<Internal::IsLessThanOrEqualTo>( rhs );
} }
template<typename RhsT> template<typename RhsT>
BinaryExpression<T, Internal::IsGreaterThanOrEqualTo, RhsT const&> BinaryExpression<T, Internal::IsGreaterThanOrEqualTo, RhsT const&>
operator >= ( RhsT const& rhs ) const { operator >= ( RhsT const& rhs ) {
return captureExpression<Internal::IsGreaterThanOrEqualTo>( rhs ); return captureExpression<Internal::IsGreaterThanOrEqualTo>( rhs );
} }
BinaryExpression<T, Internal::IsEqualTo, bool> operator == ( bool rhs ) const { BinaryExpression<T, Internal::IsEqualTo, bool> operator == ( bool rhs ) {
return captureExpression<Internal::IsEqualTo>( rhs ); return captureExpression<Internal::IsEqualTo>( rhs );
} }
BinaryExpression<T, Internal::IsNotEqualTo, bool> operator != ( bool rhs ) const { BinaryExpression<T, Internal::IsNotEqualTo, bool> operator != ( bool rhs ) {
return captureExpression<Internal::IsNotEqualTo>( rhs ); return captureExpression<Internal::IsNotEqualTo>( rhs );
} }
@ -6117,12 +6123,40 @@ namespace Catch {
} // namespace Catch } // namespace Catch
#if defined ( CATCH_PLATFORM_WINDOWS ) ///////////////////////////////////////// #if defined ( CATCH_PLATFORM_WINDOWS ) /////////////////////////////////////////
// #included from: catch_windows_h_proxy.h
#define NOMINMAX #define TWOBLUECUBES_CATCH_WINDOWS_H_PROXY_H_INCLUDED
#define WIN32_LEAN_AND_MEAN
#ifdef CATCH_DEFINES_NOMINMAX
# define NOMINMAX
#endif
#ifdef CATCH_DEFINES_WIN32_LEAN_AND_MEAN
# define WIN32_LEAN_AND_MEAN
#endif
#ifdef __AFXDLL
#include <AfxWin.h>
#else
#include <windows.h> #include <windows.h>
#undef WIN32_LEAN_AND_MEAN #endif
#undef NOMINMAX
#ifdef CATCH_DEFINES_NOMINMAX
# undef NOMINMAX
#endif
#ifdef CATCH_DEFINES_WIN32_LEAN_AND_MEAN
# undef WIN32_LEAN_AND_MEAN
#endif
# if !defined ( CATCH_CONFIG_WINDOWS_SEH )
namespace Catch {
struct FatalConditionHandler {
void reset() {}
};
}
# else // CATCH_CONFIG_WINDOWS_SEH is defined
namespace Catch { namespace Catch {
@ -6143,6 +6177,7 @@ namespace Catch {
static LONG CALLBACK handleVectoredException(PEXCEPTION_POINTERS ExceptionInfo) { static LONG CALLBACK handleVectoredException(PEXCEPTION_POINTERS ExceptionInfo) {
for (int i = 0; i < sizeof(signalDefs) / sizeof(SignalDefs); ++i) { for (int i = 0; i < sizeof(signalDefs) / sizeof(SignalDefs); ++i) {
if (ExceptionInfo->ExceptionRecord->ExceptionCode == signalDefs[i].id) { if (ExceptionInfo->ExceptionRecord->ExceptionCode == signalDefs[i].id) {
reset();
reportFatal(signalDefs[i].name); reportFatal(signalDefs[i].name);
} }
} }
@ -6151,22 +6186,25 @@ namespace Catch {
return EXCEPTION_CONTINUE_SEARCH; return EXCEPTION_CONTINUE_SEARCH;
} }
// 32k seems enough for Catch to handle stack overflow, FatalConditionHandler() {
// but the value was found experimentally, so there is no strong guarantee isSet = true;
FatalConditionHandler():m_isSet(true), m_guaranteeSize(32 * 1024), m_exceptionHandlerHandle(CATCH_NULL) { // 32k seems enough for Catch to handle stack overflow,
// but the value was found experimentally, so there is no strong guarantee
guaranteeSize = 32 * 1024;
exceptionHandlerHandle = CATCH_NULL;
// Register as first handler in current chain // Register as first handler in current chain
m_exceptionHandlerHandle = AddVectoredExceptionHandler(1, handleVectoredException); exceptionHandlerHandle = AddVectoredExceptionHandler(1, handleVectoredException);
// Pass in guarantee size to be filled // Pass in guarantee size to be filled
SetThreadStackGuarantee(&m_guaranteeSize); SetThreadStackGuarantee(&guaranteeSize);
} }
void reset() { static void reset() {
if (m_isSet) { if (isSet) {
// Unregister handler and restore the old guarantee // Unregister handler and restore the old guarantee
RemoveVectoredExceptionHandler(m_exceptionHandlerHandle); RemoveVectoredExceptionHandler(exceptionHandlerHandle);
SetThreadStackGuarantee(&m_guaranteeSize); SetThreadStackGuarantee(&guaranteeSize);
m_exceptionHandlerHandle = CATCH_NULL; exceptionHandlerHandle = CATCH_NULL;
m_isSet = false; isSet = false;
} }
} }
@ -6174,13 +6212,19 @@ namespace Catch {
reset(); reset();
} }
private: private:
bool m_isSet; static bool isSet;
ULONG m_guaranteeSize; static ULONG guaranteeSize;
PVOID m_exceptionHandlerHandle; static PVOID exceptionHandlerHandle;
}; };
bool FatalConditionHandler::isSet = false;
ULONG FatalConditionHandler::guaranteeSize = 0;
PVOID FatalConditionHandler::exceptionHandlerHandle = CATCH_NULL;
} // namespace Catch } // namespace Catch
# endif // CATCH_CONFIG_WINDOWS_SEH
#else // Not Windows - assumed to be POSIX compatible ////////////////////////// #else // Not Windows - assumed to be POSIX compatible //////////////////////////
#include <signal.h> #include <signal.h>
@ -7440,30 +7484,6 @@ namespace Catch {
#if defined ( CATCH_CONFIG_COLOUR_WINDOWS ) ///////////////////////////////////////// #if defined ( CATCH_CONFIG_COLOUR_WINDOWS ) /////////////////////////////////////////
// #included from: catch_windows_h_proxy.h
#define TWOBLUECUBES_CATCH_WINDOWS_H_PROXY_H_INCLUDED
#ifdef CATCH_DEFINES_NOMINMAX
# define NOMINMAX
#endif
#ifdef CATCH_DEFINES_WIN32_LEAN_AND_MEAN
# define WIN32_LEAN_AND_MEAN
#endif
#ifdef __AFXDLL
#include <AfxWin.h>
#else
#include <windows.h>
#endif
#ifdef CATCH_DEFINES_NOMINMAX
# undef NOMINMAX
#endif
#ifdef CATCH_DEFINES_WIN32_LEAN_AND_MEAN
# undef WIN32_LEAN_AND_MEAN
#endif
namespace Catch { namespace Catch {
namespace { namespace {
@ -7989,7 +8009,7 @@ namespace Catch {
return os; return os;
} }
Version libraryVersion( 1, 7, 0, "", 0 ); Version libraryVersion( 1, 7, 1, "", 0 );
} }
@ -9506,12 +9526,13 @@ namespace Catch {
newlineIfNecessary(); newlineIfNecessary();
m_indent = m_indent.substr( 0, m_indent.size()-2 ); m_indent = m_indent.substr( 0, m_indent.size()-2 );
if( m_tagIsOpen ) { if( m_tagIsOpen ) {
stream() << "/>\n"; stream() << "/>";
m_tagIsOpen = false; m_tagIsOpen = false;
} }
else { else {
stream() << m_indent << "</" << m_tags.back() << ">\n"; stream() << m_indent << "</" << m_tags.back() << ">";
} }
stream() << std::endl;
m_tags.pop_back(); m_tags.pop_back();
return *this; return *this;
} }
@ -9757,6 +9778,11 @@ namespace Catch {
if ( m_config->showDurations() == ShowDurations::Always ) if ( m_config->showDurations() == ShowDurations::Always )
e.writeAttribute( "durationInSeconds", m_testCaseTimer.getElapsedSeconds() ); e.writeAttribute( "durationInSeconds", m_testCaseTimer.getElapsedSeconds() );
if( !testCaseStats.stdOut.empty() )
m_xml.scopedElement( "StdOut" ).writeText( trim( testCaseStats.stdOut ), false );
if( !testCaseStats.stdErr.empty() )
m_xml.scopedElement( "StdErr" ).writeText( trim( testCaseStats.stdErr ), false );
m_xml.endElement(); m_xml.endElement();
} }
@ -9804,7 +9830,7 @@ namespace Catch {
std::time(&rawtime); std::time(&rawtime);
const size_t timeStampSize = sizeof("2017-01-16T17:06:45Z"); const size_t timeStampSize = sizeof("2017-01-16T17:06:45Z");
#ifdef CATCH_PLATFORM_WINDOWS #ifdef _MSC_VER
std::tm timeInfo = {}; std::tm timeInfo = {};
gmtime_s(&timeInfo, &rawtime); gmtime_s(&timeInfo, &rawtime);
#else #else
@ -9815,7 +9841,7 @@ namespace Catch {
char timeStamp[timeStampSize]; char timeStamp[timeStampSize];
const char * const fmt = "%Y-%m-%dT%H:%M:%SZ"; const char * const fmt = "%Y-%m-%dT%H:%M:%SZ";
#ifdef CATCH_PLATFORM_WINDOWS #ifdef _MSC_VER
std::strftime(timeStamp, timeStampSize, fmt, &timeInfo); std::strftime(timeStamp, timeStampSize, fmt, &timeInfo);
#else #else
std::strftime(timeStamp, timeStampSize, fmt, timeInfo); std::strftime(timeStamp, timeStampSize, fmt, timeInfo);