Skip to content

Commit 7b8a27e

Browse files
committed
v1.7.1 build
1 parent 2b74613 commit 7b8a27e

File tree

4 files changed

+102
-67
lines changed

4 files changed

+102
-67
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
![catch logo](catch-logo-small.png)
22

3-
*v1.7.0*
3+
*v1.7.1*
44

55
Build status (on Travis CI) [![Build Status](https://travis-ci.org/philsquared/Catch.svg?branch=master)](https://travis-ci.org/philsquared/Catch)
66

7-
<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>
7+
<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>
88

99
## What's the Catch?
1010

docs/release-notes.md

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,19 @@
1-
# 1.7.0
1+
# 1.7.1
2+
3+
### Fixes:
4+
* Fixed inconsistency in defining `NOMINMAX` and `WIN32_LEAN_AND_MEAN` inside `catch.hpp`.
5+
* Fixed SEH-related compilation error under older MinGW compilers, by making Windows SEH handling opt-in for compilers other than MSVC.
6+
* For specifics, look into the [documentation](docs/configuration.md).
7+
* Fixed compilation error under MinGW caused by improper compiler detection.
8+
* Fixed XML reporter sometimes leaving an empty output file when a test ends with signal/structured exception.
9+
* Fixed XML reporter not reporting captured stdout/stderr.
10+
* Fixed possible infinite recursion in Windows SEH.
11+
* Fixed possible compilation error caused by Catch's operator overloads being ambiguous in regards to user-defined templated operators.
12+
13+
# Older versions
14+
Release notes were not maintained prior to v1.6.0, but you should be able to work them out from the Git history
15+
16+
## 1.7.0
217

318
### Features/ Changes:
419
* Catch now runs significantly faster for passing tests
@@ -25,12 +40,6 @@
2540
* Catch's CMakeLists now generates projects with warnings enabled.
2641

2742

28-
29-
30-
31-
# Older versions
32-
Release notes were not maintained prior to v1.6.0, but you should be able to work them out from the Git history
33-
3443
## 1.6.1
3544

3645
### Features/ Changes:

include/internal/catch_version.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ namespace Catch {
3737
return os;
3838
}
3939

40-
Version libraryVersion( 1, 7, 0, "", 0 );
40+
Version libraryVersion( 1, 7, 1, "", 0 );
4141

4242
}
4343

single_include/catch.hpp

Lines changed: 83 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
2-
* Catch v1.7.0
3-
* Generated: 2017-02-01 21:32:13.239291
2+
* Catch v1.7.1
3+
* Generated: 2017-02-07 09:44:56.263047
44
* ----------------------------------------------------------
55
* This file has been merged from multiple headers. Please don't edit it directly
66
* Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved.
@@ -81,6 +81,7 @@
8181

8282
// CATCH_CONFIG_VARIADIC_MACROS : are variadic macros supported?
8383
// CATCH_CONFIG_COUNTER : is the __COUNTER__ macro supported?
84+
// CATCH_CONFIG_WINDOWS_SEH : is Windows SEH supported?
8485
// ****************
8586
// Note to maintainers: if new toggles are added please document them
8687
// in configuration.md, too
@@ -160,6 +161,8 @@
160161
// Visual C++
161162
#ifdef _MSC_VER
162163

164+
#define CATCH_INTERNAL_CONFIG_WINDOWS_SEH
165+
163166
#if (_MSC_VER >= 1600)
164167
# define CATCH_INTERNAL_CONFIG_CPP11_NULLPTR
165168
# define CATCH_INTERNAL_CONFIG_CPP11_UNIQUE_PTR
@@ -284,6 +287,9 @@
284287
# 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)
285288
# define CATCH_CONFIG_CPP11_TYPE_TRAITS
286289
# endif
290+
#if defined(CATCH_INTERNAL_CONFIG_WINDOWS_SEH) && !defined(CATCH_CONFIG_NO_WINDOWS_SEH) && !defined(CATCH_CONFIG_WINDOWS_SEH)
291+
# define CATCH_CONFIG_WINDOWS_SEH
292+
#endif
287293

288294
#if !defined(CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS)
289295
# define CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS
@@ -1878,45 +1884,45 @@ class ExpressionLhs : public DecomposedExpression {
18781884

18791885
template<typename RhsT>
18801886
BinaryExpression<T, Internal::IsEqualTo, RhsT const&>
1881-
operator == ( RhsT const& rhs ) const {
1887+
operator == ( RhsT const& rhs ) {
18821888
return captureExpression<Internal::IsEqualTo>( rhs );
18831889
}
18841890

18851891
template<typename RhsT>
18861892
BinaryExpression<T, Internal::IsNotEqualTo, RhsT const&>
1887-
operator != ( RhsT const& rhs ) const {
1893+
operator != ( RhsT const& rhs ) {
18881894
return captureExpression<Internal::IsNotEqualTo>( rhs );
18891895
}
18901896

18911897
template<typename RhsT>
18921898
BinaryExpression<T, Internal::IsLessThan, RhsT const&>
1893-
operator < ( RhsT const& rhs ) const {
1899+
operator < ( RhsT const& rhs ) {
18941900
return captureExpression<Internal::IsLessThan>( rhs );
18951901
}
18961902

18971903
template<typename RhsT>
18981904
BinaryExpression<T, Internal::IsGreaterThan, RhsT const&>
1899-
operator > ( RhsT const& rhs ) const {
1905+
operator > ( RhsT const& rhs ) {
19001906
return captureExpression<Internal::IsGreaterThan>( rhs );
19011907
}
19021908

19031909
template<typename RhsT>
19041910
BinaryExpression<T, Internal::IsLessThanOrEqualTo, RhsT const&>
1905-
operator <= ( RhsT const& rhs ) const {
1911+
operator <= ( RhsT const& rhs ) {
19061912
return captureExpression<Internal::IsLessThanOrEqualTo>( rhs );
19071913
}
19081914

19091915
template<typename RhsT>
19101916
BinaryExpression<T, Internal::IsGreaterThanOrEqualTo, RhsT const&>
1911-
operator >= ( RhsT const& rhs ) const {
1917+
operator >= ( RhsT const& rhs ) {
19121918
return captureExpression<Internal::IsGreaterThanOrEqualTo>( rhs );
19131919
}
19141920

1915-
BinaryExpression<T, Internal::IsEqualTo, bool> operator == ( bool rhs ) const {
1921+
BinaryExpression<T, Internal::IsEqualTo, bool> operator == ( bool rhs ) {
19161922
return captureExpression<Internal::IsEqualTo>( rhs );
19171923
}
19181924

1919-
BinaryExpression<T, Internal::IsNotEqualTo, bool> operator != ( bool rhs ) const {
1925+
BinaryExpression<T, Internal::IsNotEqualTo, bool> operator != ( bool rhs ) {
19201926
return captureExpression<Internal::IsNotEqualTo>( rhs );
19211927
}
19221928

@@ -6117,12 +6123,40 @@ namespace Catch {
61176123
} // namespace Catch
61186124

61196125
#if defined ( CATCH_PLATFORM_WINDOWS ) /////////////////////////////////////////
6126+
// #included from: catch_windows_h_proxy.h
6127+
6128+
#define TWOBLUECUBES_CATCH_WINDOWS_H_PROXY_H_INCLUDED
6129+
6130+
#ifdef CATCH_DEFINES_NOMINMAX
6131+
# define NOMINMAX
6132+
#endif
6133+
#ifdef CATCH_DEFINES_WIN32_LEAN_AND_MEAN
6134+
# define WIN32_LEAN_AND_MEAN
6135+
#endif
61206136

6121-
#define NOMINMAX
6122-
#define WIN32_LEAN_AND_MEAN
6137+
#ifdef __AFXDLL
6138+
#include <AfxWin.h>
6139+
#else
61236140
#include <windows.h>
6124-
#undef WIN32_LEAN_AND_MEAN
6125-
#undef NOMINMAX
6141+
#endif
6142+
6143+
#ifdef CATCH_DEFINES_NOMINMAX
6144+
# undef NOMINMAX
6145+
#endif
6146+
#ifdef CATCH_DEFINES_WIN32_LEAN_AND_MEAN
6147+
# undef WIN32_LEAN_AND_MEAN
6148+
#endif
6149+
6150+
6151+
# if !defined ( CATCH_CONFIG_WINDOWS_SEH )
6152+
6153+
namespace Catch {
6154+
struct FatalConditionHandler {
6155+
void reset() {}
6156+
};
6157+
}
6158+
6159+
# else // CATCH_CONFIG_WINDOWS_SEH is defined
61266160

61276161
namespace Catch {
61286162

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

6154-
// 32k seems enough for Catch to handle stack overflow,
6155-
// but the value was found experimentally, so there is no strong guarantee
6156-
FatalConditionHandler():m_isSet(true), m_guaranteeSize(32 * 1024), m_exceptionHandlerHandle(CATCH_NULL) {
6189+
FatalConditionHandler() {
6190+
isSet = true;
6191+
// 32k seems enough for Catch to handle stack overflow,
6192+
// but the value was found experimentally, so there is no strong guarantee
6193+
guaranteeSize = 32 * 1024;
6194+
exceptionHandlerHandle = CATCH_NULL;
61576195
// Register as first handler in current chain
6158-
m_exceptionHandlerHandle = AddVectoredExceptionHandler(1, handleVectoredException);
6196+
exceptionHandlerHandle = AddVectoredExceptionHandler(1, handleVectoredException);
61596197
// Pass in guarantee size to be filled
6160-
SetThreadStackGuarantee(&m_guaranteeSize);
6198+
SetThreadStackGuarantee(&guaranteeSize);
61616199
}
61626200

6163-
void reset() {
6164-
if (m_isSet) {
6201+
static void reset() {
6202+
if (isSet) {
61656203
// Unregister handler and restore the old guarantee
6166-
RemoveVectoredExceptionHandler(m_exceptionHandlerHandle);
6167-
SetThreadStackGuarantee(&m_guaranteeSize);
6168-
m_exceptionHandlerHandle = CATCH_NULL;
6169-
m_isSet = false;
6204+
RemoveVectoredExceptionHandler(exceptionHandlerHandle);
6205+
SetThreadStackGuarantee(&guaranteeSize);
6206+
exceptionHandlerHandle = CATCH_NULL;
6207+
isSet = false;
61706208
}
61716209
}
61726210

61736211
~FatalConditionHandler() {
61746212
reset();
61756213
}
61766214
private:
6177-
bool m_isSet;
6178-
ULONG m_guaranteeSize;
6179-
PVOID m_exceptionHandlerHandle;
6215+
static bool isSet;
6216+
static ULONG guaranteeSize;
6217+
static PVOID exceptionHandlerHandle;
61806218
};
61816219

6220+
bool FatalConditionHandler::isSet = false;
6221+
ULONG FatalConditionHandler::guaranteeSize = 0;
6222+
PVOID FatalConditionHandler::exceptionHandlerHandle = CATCH_NULL;
6223+
61826224
} // namespace Catch
61836225

6226+
# endif // CATCH_CONFIG_WINDOWS_SEH
6227+
61846228
#else // Not Windows - assumed to be POSIX compatible //////////////////////////
61856229

61866230
#include <signal.h>
@@ -7440,30 +7484,6 @@ namespace Catch {
74407484

74417485
#if defined ( CATCH_CONFIG_COLOUR_WINDOWS ) /////////////////////////////////////////
74427486

7443-
// #included from: catch_windows_h_proxy.h
7444-
7445-
#define TWOBLUECUBES_CATCH_WINDOWS_H_PROXY_H_INCLUDED
7446-
7447-
#ifdef CATCH_DEFINES_NOMINMAX
7448-
# define NOMINMAX
7449-
#endif
7450-
#ifdef CATCH_DEFINES_WIN32_LEAN_AND_MEAN
7451-
# define WIN32_LEAN_AND_MEAN
7452-
#endif
7453-
7454-
#ifdef __AFXDLL
7455-
#include <AfxWin.h>
7456-
#else
7457-
#include <windows.h>
7458-
#endif
7459-
7460-
#ifdef CATCH_DEFINES_NOMINMAX
7461-
# undef NOMINMAX
7462-
#endif
7463-
#ifdef CATCH_DEFINES_WIN32_LEAN_AND_MEAN
7464-
# undef WIN32_LEAN_AND_MEAN
7465-
#endif
7466-
74677487
namespace Catch {
74687488
namespace {
74697489

@@ -7989,7 +8009,7 @@ namespace Catch {
79898009
return os;
79908010
}
79918011

7992-
Version libraryVersion( 1, 7, 0, "", 0 );
8012+
Version libraryVersion( 1, 7, 1, "", 0 );
79938013

79948014
}
79958015

@@ -9506,12 +9526,13 @@ namespace Catch {
95069526
newlineIfNecessary();
95079527
m_indent = m_indent.substr( 0, m_indent.size()-2 );
95089528
if( m_tagIsOpen ) {
9509-
stream() << "/>\n";
9529+
stream() << "/>";
95109530
m_tagIsOpen = false;
95119531
}
95129532
else {
9513-
stream() << m_indent << "</" << m_tags.back() << ">\n";
9533+
stream() << m_indent << "</" << m_tags.back() << ">";
95149534
}
9535+
stream() << std::endl;
95159536
m_tags.pop_back();
95169537
return *this;
95179538
}
@@ -9757,6 +9778,11 @@ namespace Catch {
97579778
if ( m_config->showDurations() == ShowDurations::Always )
97589779
e.writeAttribute( "durationInSeconds", m_testCaseTimer.getElapsedSeconds() );
97599780

9781+
if( !testCaseStats.stdOut.empty() )
9782+
m_xml.scopedElement( "StdOut" ).writeText( trim( testCaseStats.stdOut ), false );
9783+
if( !testCaseStats.stdErr.empty() )
9784+
m_xml.scopedElement( "StdErr" ).writeText( trim( testCaseStats.stdErr ), false );
9785+
97609786
m_xml.endElement();
97619787
}
97629788

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

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

9818-
#ifdef CATCH_PLATFORM_WINDOWS
9844+
#ifdef _MSC_VER
98199845
std::strftime(timeStamp, timeStampSize, fmt, &timeInfo);
98209846
#else
98219847
std::strftime(timeStamp, timeStampSize, fmt, timeInfo);

0 commit comments

Comments
 (0)