Skip to content

Commit 2a3606f

Browse files
committed
v1.11.0
1 parent a6cf19a commit 2a3606f

File tree

6 files changed

+40
-22
lines changed

6 files changed

+40
-22
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
[![Github Releases](https://img.shields.io/github/release/philsquared/catch.svg)](https://github.com/philsquared/catch/releases)
44
[![Build Status](https://travis-ci.org/philsquared/Catch.svg?branch=master)](https://travis-ci.org/philsquared/Catch)
55
[![Build status](https://ci.appveyor.com/api/projects/status/hrtk60hv6tw6fght/branch/master?svg=true)](https://ci.appveyor.com/project/philsquared/catch/branch/master)
6-
[![Try online](https://img.shields.io/badge/try-online-blue.svg)](https://wandbox.org/permlink/UahInEdRRiojprDp)
6+
[![Try online](https://img.shields.io/badge/try-online-blue.svg)](https://wandbox.org/permlink/EyEbEIfp8CnnjguW)
77

8-
<a href="https://github.com/philsquared/Catch/releases/download/v1.10.0/catch.hpp">The latest, single header, version can be downloaded directly using this link</a>
8+
<a href="https://github.com/philsquared/Catch/releases/download/v1.11.0/catch.hpp">The latest, single header, version can be downloaded directly using this link</a>
99

1010
## What's the Catch?
1111

conanfile.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
class CatchConan(ConanFile):
66
name = "Catch"
7-
version = "1.10.0"
7+
version = "1.11.0"
88
description = "A modern, C++-native, header-only, framework for unit-tests, TDD and BDD"
99
author = "philsquared"
1010
generators = "cmake"
@@ -14,6 +14,6 @@ class CatchConan(ConanFile):
1414

1515
def package(self):
1616
self.copy(pattern="catch.hpp", src="single_include", dst="include")
17-
17+
1818
def package_id(self):
1919
self.info.header_only()

docs/release-notes.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1+
# 1.11.0
2+
3+
### Fixes
4+
* The original expression in `REQUIRE_FALSE( expr )` is now reporter properly as `!( expr )` (#1051)
5+
* Previously the parentheses were missing and `x != y` would be expanded as `!x != x`
6+
* `Approx::Margin` is now inclusive (#952)
7+
* Previously it was meant and documented as inclusive, but the check itself wasn't
8+
* This means that `REQUIRE( 0.25f == Approx( 0.0f ).margin( 0.25f ) )` passes, instead of fails
9+
* `RandomNumberGenerator::result_type` is now unsigned (#1050)
10+
11+
### Improvements
12+
* `__JETBRAINS_IDE__` macro handling is now CLion version specific (#1017)
13+
* When CLion 2017.3 or newer is detected, `__COUNTER__` is used instead of
14+
* TeamCity reporter now explicitly flushes output stream after each report (#1057)
15+
* On some platforms, output from redirected streams would show up only after the tests finished running
16+
* `ParseAndAddCatchTests` now can add test files as dependency to CMake configuration
17+
* This means you do not have to manually rerun CMake configuration step to detect new tests
18+
19+
120
# 1.10.0
221

322
### Fixes

include/internal/catch_version.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ namespace Catch {
3838
}
3939

4040
inline Version libraryVersion() {
41-
static Version version( 1, 10, 0, "", 0 );
41+
static Version version( 1, 11, 0, "", 0 );
4242
return version;
4343
}
4444

single_include/catch.hpp

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
2-
* Catch v1.10.0
3-
* Generated: 2017-08-26 15:16:46.676990
2+
* Catch v1.11.0
3+
* Generated: 2017-10-31 13:42:42.914833
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.
@@ -228,7 +228,12 @@
228228
( defined __GNUC__ && ( __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3 )) ) || \
229229
( defined __clang__ && __clang_major__ >= 3 )
230230

231-
#define CATCH_INTERNAL_CONFIG_COUNTER
231+
// Use of __COUNTER__ is suppressed during code analysis in CLion/AppCode 2017.2.x and former,
232+
// because __COUNTER__ is not properly handled by it.
233+
// This does not affect compilation
234+
#if ( !defined __JETBRAINS_IDE__ || __JETBRAINS_IDE__ >= 20170300L )
235+
#define CATCH_INTERNAL_CONFIG_COUNTER
236+
#endif
232237

233238
#endif
234239

@@ -309,10 +314,7 @@
309314
#if defined(CATCH_INTERNAL_CONFIG_CPP11_UNIQUE_PTR) && !defined(CATCH_CONFIG_CPP11_NO_UNIQUE_PTR) && !defined(CATCH_CONFIG_CPP11_UNIQUE_PTR) && !defined(CATCH_CONFIG_NO_CPP11)
310315
# define CATCH_CONFIG_CPP11_UNIQUE_PTR
311316
#endif
312-
// Use of __COUNTER__ is suppressed if __JETBRAINS_IDE__ is #defined (meaning we're being parsed by a JetBrains IDE for
313-
// analytics) because, at time of writing, __COUNTER__ is not properly handled by it.
314-
// This does not affect compilation
315-
#if defined(CATCH_INTERNAL_CONFIG_COUNTER) && !defined(CATCH_CONFIG_NO_COUNTER) && !defined(CATCH_CONFIG_COUNTER) && !defined(__JETBRAINS_IDE__)
317+
#if defined(CATCH_INTERNAL_CONFIG_COUNTER) && !defined(CATCH_CONFIG_NO_COUNTER) && !defined(CATCH_CONFIG_COUNTER)
316318
# define CATCH_CONFIG_COUNTER
317319
#endif
318320
#if defined(CATCH_INTERNAL_CONFIG_CPP11_SHUFFLE) && !defined(CATCH_CONFIG_CPP11_NO_SHUFFLE) && !defined(CATCH_CONFIG_CPP11_SHUFFLE) && !defined(CATCH_CONFIG_NO_CPP11)
@@ -2756,7 +2758,8 @@ namespace Detail {
27562758
if (relativeOK) {
27572759
return true;
27582760
}
2759-
return std::fabs(lhs_v - rhs.m_value) < rhs.m_margin;
2761+
2762+
return std::fabs(lhs_v - rhs.m_value) <= rhs.m_margin;
27602763
}
27612764

27622765
template <typename T, typename = typename std::enable_if<std::is_constructible<double, T>::value>::type>
@@ -2828,7 +2831,7 @@ namespace Detail {
28282831
if (relativeOK) {
28292832
return true;
28302833
}
2831-
return std::fabs(lhs - rhs.m_value) < rhs.m_margin;
2834+
return std::fabs(lhs - rhs.m_value) <= rhs.m_margin;
28322835
}
28332836

28342837
friend bool operator == ( Approx const& lhs, double rhs ) {
@@ -5279,10 +5282,6 @@ namespace Catch {
52795282
.describe( "should output be colourised" )
52805283
.bind( &setUseColour, "yes|no" );
52815284

5282-
cli["--use-colour"]
5283-
.describe( "should output be colourised" )
5284-
.bind( &setUseColour, "yes|no" );
5285-
52865285
cli["--libidentify"]
52875286
.describe( "report name and version according to libidentify standard" )
52885287
.bind( &ConfigData::libIdentify );
@@ -7215,7 +7214,7 @@ namespace Catch {
72157214
namespace Catch {
72167215

72177216
struct RandomNumberGenerator {
7218-
typedef std::ptrdiff_t result_type;
7217+
typedef unsigned int result_type;
72197218

72207219
result_type operator()( result_type n ) const { return std::rand() % n; }
72217220

@@ -8136,7 +8135,7 @@ namespace Catch {
81368135

81378136
std::string AssertionResult::getExpression() const {
81388137
if( isFalseTest( m_info.resultDisposition ) )
8139-
return '!' + capturedExpressionWithSecondArgument(m_info.capturedExpression, m_info.secondArg);
8138+
return "!(" + capturedExpressionWithSecondArgument(m_info.capturedExpression, m_info.secondArg) + ")";
81408139
else
81418140
return capturedExpressionWithSecondArgument(m_info.capturedExpression, m_info.secondArg);
81428141
}
@@ -8394,7 +8393,7 @@ namespace Catch {
83948393
}
83958394

83968395
inline Version libraryVersion() {
8397-
static Version version( 1, 10, 0, "", 0 );
8396+
static Version version( 1, 11, 0, "", 0 );
83988397
return version;
83998398
}
84008399

test_package/conanfile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class CatchConanTest(ConanFile):
1010
settings = "os", "compiler", "arch", "build_type"
1111
username = getenv("CONAN_USERNAME", "philsquared")
1212
channel = getenv("CONAN_CHANNEL", "testing")
13-
requires = "Catch/1.10.0@%s/%s" % (username, channel)
13+
requires = "Catch/1.11.0@%s/%s" % (username, channel)
1414

1515
def build(self):
1616
cmake = CMake(self)

0 commit comments

Comments
 (0)