Skip to content

Commit

Permalink
v1.7.1 build
Browse files Browse the repository at this point in the history
  • Loading branch information
horenmar committed Feb 7, 2017
1 parent 2b74613 commit 7b8a27e
Show file tree
Hide file tree
Showing 4 changed files with 102 additions and 67 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
![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)

<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?

Expand Down
23 changes: 16 additions & 7 deletions docs/release-notes.md
Original file line number Diff line number Diff line change
@@ -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:
* Catch now runs significantly faster for passing tests
Expand All @@ -25,12 +40,6 @@
* 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

### Features/ Changes:
Expand Down
2 changes: 1 addition & 1 deletion include/internal/catch_version.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ namespace Catch {
return os;
}

Version libraryVersion( 1, 7, 0, "", 0 );
Version libraryVersion( 1, 7, 1, "", 0 );

}

Expand Down
140 changes: 83 additions & 57 deletions single_include/catch.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Catch v1.7.0
* Generated: 2017-02-01 21:32:13.239291
* Catch v1.7.1
* Generated: 2017-02-07 09:44:56.263047
* ----------------------------------------------------------
* This file has been merged from multiple headers. Please don't edit it directly
* Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved.
Expand Down Expand Up @@ -81,6 +81,7 @@

// CATCH_CONFIG_VARIADIC_MACROS : are variadic macros 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
// in configuration.md, too
Expand Down Expand Up @@ -160,6 +161,8 @@
// Visual C++
#ifdef _MSC_VER

#define CATCH_INTERNAL_CONFIG_WINDOWS_SEH

#if (_MSC_VER >= 1600)
# define CATCH_INTERNAL_CONFIG_CPP11_NULLPTR
# define CATCH_INTERNAL_CONFIG_CPP11_UNIQUE_PTR
Expand Down Expand Up @@ -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)
# define CATCH_CONFIG_CPP11_TYPE_TRAITS
# 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)
# define CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS
Expand Down Expand Up @@ -1878,45 +1884,45 @@ class ExpressionLhs : public DecomposedExpression {

template<typename RhsT>
BinaryExpression<T, Internal::IsEqualTo, RhsT const&>
operator == ( RhsT const& rhs ) const {
operator == ( RhsT const& rhs ) {
return captureExpression<Internal::IsEqualTo>( rhs );
}

template<typename RhsT>
BinaryExpression<T, Internal::IsNotEqualTo, RhsT const&>
operator != ( RhsT const& rhs ) const {
operator != ( RhsT const& rhs ) {
return captureExpression<Internal::IsNotEqualTo>( rhs );
}

template<typename RhsT>
BinaryExpression<T, Internal::IsLessThan, RhsT const&>
operator < ( RhsT const& rhs ) const {
operator < ( RhsT const& rhs ) {
return captureExpression<Internal::IsLessThan>( rhs );
}

template<typename RhsT>
BinaryExpression<T, Internal::IsGreaterThan, RhsT const&>
operator > ( RhsT const& rhs ) const {
operator > ( RhsT const& rhs ) {
return captureExpression<Internal::IsGreaterThan>( rhs );
}

template<typename RhsT>
BinaryExpression<T, Internal::IsLessThanOrEqualTo, RhsT const&>
operator <= ( RhsT const& rhs ) const {
operator <= ( RhsT const& rhs ) {
return captureExpression<Internal::IsLessThanOrEqualTo>( rhs );
}

template<typename RhsT>
BinaryExpression<T, Internal::IsGreaterThanOrEqualTo, RhsT const&>
operator >= ( RhsT const& rhs ) const {
operator >= ( RhsT const& 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 );
}

BinaryExpression<T, Internal::IsNotEqualTo, bool> operator != ( bool rhs ) const {
BinaryExpression<T, Internal::IsNotEqualTo, bool> operator != ( bool rhs ) {
return captureExpression<Internal::IsNotEqualTo>( rhs );
}

Expand Down Expand Up @@ -6117,12 +6123,40 @@ namespace Catch {
} // namespace Catch

#if defined ( CATCH_PLATFORM_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

#define NOMINMAX
#define WIN32_LEAN_AND_MEAN
#ifdef __AFXDLL
#include <AfxWin.h>
#else
#include <windows.h>
#undef WIN32_LEAN_AND_MEAN
#undef NOMINMAX
#endif

#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 {

Expand All @@ -6143,6 +6177,7 @@ namespace Catch {
static LONG CALLBACK handleVectoredException(PEXCEPTION_POINTERS ExceptionInfo) {
for (int i = 0; i < sizeof(signalDefs) / sizeof(SignalDefs); ++i) {
if (ExceptionInfo->ExceptionRecord->ExceptionCode == signalDefs[i].id) {
reset();
reportFatal(signalDefs[i].name);
}
}
Expand All @@ -6151,36 +6186,45 @@ namespace Catch {
return EXCEPTION_CONTINUE_SEARCH;
}

// 32k seems enough for Catch to handle stack overflow,
// but the value was found experimentally, so there is no strong guarantee
FatalConditionHandler():m_isSet(true), m_guaranteeSize(32 * 1024), m_exceptionHandlerHandle(CATCH_NULL) {
FatalConditionHandler() {
isSet = true;
// 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
m_exceptionHandlerHandle = AddVectoredExceptionHandler(1, handleVectoredException);
exceptionHandlerHandle = AddVectoredExceptionHandler(1, handleVectoredException);
// Pass in guarantee size to be filled
SetThreadStackGuarantee(&m_guaranteeSize);
SetThreadStackGuarantee(&guaranteeSize);
}

void reset() {
if (m_isSet) {
static void reset() {
if (isSet) {
// Unregister handler and restore the old guarantee
RemoveVectoredExceptionHandler(m_exceptionHandlerHandle);
SetThreadStackGuarantee(&m_guaranteeSize);
m_exceptionHandlerHandle = CATCH_NULL;
m_isSet = false;
RemoveVectoredExceptionHandler(exceptionHandlerHandle);
SetThreadStackGuarantee(&guaranteeSize);
exceptionHandlerHandle = CATCH_NULL;
isSet = false;
}
}

~FatalConditionHandler() {
reset();
}
private:
bool m_isSet;
ULONG m_guaranteeSize;
PVOID m_exceptionHandlerHandle;
static bool isSet;
static ULONG guaranteeSize;
static PVOID exceptionHandlerHandle;
};

bool FatalConditionHandler::isSet = false;
ULONG FatalConditionHandler::guaranteeSize = 0;
PVOID FatalConditionHandler::exceptionHandlerHandle = CATCH_NULL;

} // namespace Catch

# endif // CATCH_CONFIG_WINDOWS_SEH

#else // Not Windows - assumed to be POSIX compatible //////////////////////////

#include <signal.h>
Expand Down Expand Up @@ -7440,30 +7484,6 @@ namespace Catch {

#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 {

Expand Down Expand Up @@ -7989,7 +8009,7 @@ namespace Catch {
return os;
}

Version libraryVersion( 1, 7, 0, "", 0 );
Version libraryVersion( 1, 7, 1, "", 0 );

}

Expand Down Expand Up @@ -9506,12 +9526,13 @@ namespace Catch {
newlineIfNecessary();
m_indent = m_indent.substr( 0, m_indent.size()-2 );
if( m_tagIsOpen ) {
stream() << "/>\n";
stream() << "/>";
m_tagIsOpen = false;
}
else {
stream() << m_indent << "</" << m_tags.back() << ">\n";
stream() << m_indent << "</" << m_tags.back() << ">";
}
stream() << std::endl;
m_tags.pop_back();
return *this;
}
Expand Down Expand Up @@ -9757,6 +9778,11 @@ namespace Catch {
if ( m_config->showDurations() == ShowDurations::Always )
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();
}

Expand Down Expand Up @@ -9804,7 +9830,7 @@ namespace Catch {
std::time(&rawtime);
const size_t timeStampSize = sizeof("2017-01-16T17:06:45Z");

#ifdef CATCH_PLATFORM_WINDOWS
#ifdef _MSC_VER
std::tm timeInfo = {};
gmtime_s(&timeInfo, &rawtime);
#else
Expand All @@ -9815,7 +9841,7 @@ namespace Catch {
char timeStamp[timeStampSize];
const char * const fmt = "%Y-%m-%dT%H:%M:%SZ";

#ifdef CATCH_PLATFORM_WINDOWS
#ifdef _MSC_VER
std::strftime(timeStamp, timeStampSize, fmt, &timeInfo);
#else
std::strftime(timeStamp, timeStampSize, fmt, timeInfo);
Expand Down

0 comments on commit 7b8a27e

Please sign in to comment.