From 2a3606f8e30c50c236107b6513ce57c6d609b7ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Ho=C5=99e=C5=88ovsk=C3=BD?= Date: Tue, 31 Oct 2017 13:55:48 +0100 Subject: [PATCH] v1.11.0 --- README.md | 4 ++-- conanfile.py | 4 ++-- docs/release-notes.md | 19 ++++++++++++++++++ include/internal/catch_version.hpp | 2 +- single_include/catch.hpp | 31 +++++++++++++++--------------- test_package/conanfile.py | 2 +- 6 files changed, 40 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index 83acdb22..b1eaf22c 100644 --- a/README.md +++ b/README.md @@ -3,9 +3,9 @@ [![Github Releases](https://img.shields.io/github/release/philsquared/catch.svg)](https://github.com/philsquared/catch/releases) [![Build Status](https://travis-ci.org/philsquared/Catch.svg?branch=master)](https://travis-ci.org/philsquared/Catch) [![Build status](https://ci.appveyor.com/api/projects/status/hrtk60hv6tw6fght/branch/master?svg=true)](https://ci.appveyor.com/project/philsquared/catch/branch/master) -[![Try online](https://img.shields.io/badge/try-online-blue.svg)](https://wandbox.org/permlink/UahInEdRRiojprDp) +[![Try online](https://img.shields.io/badge/try-online-blue.svg)](https://wandbox.org/permlink/EyEbEIfp8CnnjguW) -The latest, single header, version can be downloaded directly using this link +The latest, single header, version can be downloaded directly using this link ## What's the Catch? diff --git a/conanfile.py b/conanfile.py index ce02ecc4..02699974 100644 --- a/conanfile.py +++ b/conanfile.py @@ -4,7 +4,7 @@ from conans import ConanFile class CatchConan(ConanFile): name = "Catch" - version = "1.10.0" + version = "1.11.0" description = "A modern, C++-native, header-only, framework for unit-tests, TDD and BDD" author = "philsquared" generators = "cmake" @@ -14,6 +14,6 @@ class CatchConan(ConanFile): def package(self): self.copy(pattern="catch.hpp", src="single_include", dst="include") - + def package_id(self): self.info.header_only() diff --git a/docs/release-notes.md b/docs/release-notes.md index bd47d814..3661c6f6 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -1,3 +1,22 @@ +# 1.11.0 + +### Fixes +* The original expression in `REQUIRE_FALSE( expr )` is now reporter properly as `!( expr )` (#1051) + * Previously the parentheses were missing and `x != y` would be expanded as `!x != x` +* `Approx::Margin` is now inclusive (#952) + * Previously it was meant and documented as inclusive, but the check itself wasn't + * This means that `REQUIRE( 0.25f == Approx( 0.0f ).margin( 0.25f ) )` passes, instead of fails +* `RandomNumberGenerator::result_type` is now unsigned (#1050) + +### Improvements +* `__JETBRAINS_IDE__` macro handling is now CLion version specific (#1017) + * When CLion 2017.3 or newer is detected, `__COUNTER__` is used instead of +* TeamCity reporter now explicitly flushes output stream after each report (#1057) + * On some platforms, output from redirected streams would show up only after the tests finished running +* `ParseAndAddCatchTests` now can add test files as dependency to CMake configuration + * This means you do not have to manually rerun CMake configuration step to detect new tests + + # 1.10.0 ### Fixes diff --git a/include/internal/catch_version.hpp b/include/internal/catch_version.hpp index e9c81849..8049e3fb 100644 --- a/include/internal/catch_version.hpp +++ b/include/internal/catch_version.hpp @@ -38,7 +38,7 @@ namespace Catch { } inline Version libraryVersion() { - static Version version( 1, 10, 0, "", 0 ); + static Version version( 1, 11, 0, "", 0 ); return version; } diff --git a/single_include/catch.hpp b/single_include/catch.hpp index 4d1fc334..849c53c1 100644 --- a/single_include/catch.hpp +++ b/single_include/catch.hpp @@ -1,6 +1,6 @@ /* - * Catch v1.10.0 - * Generated: 2017-08-26 15:16:46.676990 + * Catch v1.11.0 + * Generated: 2017-10-31 13:42:42.914833 * ---------------------------------------------------------- * This file has been merged from multiple headers. Please don't edit it directly * Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved. @@ -228,7 +228,12 @@ ( defined __GNUC__ && ( __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3 )) ) || \ ( defined __clang__ && __clang_major__ >= 3 ) -#define CATCH_INTERNAL_CONFIG_COUNTER +// Use of __COUNTER__ is suppressed during code analysis in CLion/AppCode 2017.2.x and former, +// because __COUNTER__ is not properly handled by it. +// This does not affect compilation +#if ( !defined __JETBRAINS_IDE__ || __JETBRAINS_IDE__ >= 20170300L ) + #define CATCH_INTERNAL_CONFIG_COUNTER +#endif #endif @@ -309,10 +314,7 @@ #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) # define CATCH_CONFIG_CPP11_UNIQUE_PTR #endif -// Use of __COUNTER__ is suppressed if __JETBRAINS_IDE__ is #defined (meaning we're being parsed by a JetBrains IDE for -// analytics) because, at time of writing, __COUNTER__ is not properly handled by it. -// This does not affect compilation -#if defined(CATCH_INTERNAL_CONFIG_COUNTER) && !defined(CATCH_CONFIG_NO_COUNTER) && !defined(CATCH_CONFIG_COUNTER) && !defined(__JETBRAINS_IDE__) +#if defined(CATCH_INTERNAL_CONFIG_COUNTER) && !defined(CATCH_CONFIG_NO_COUNTER) && !defined(CATCH_CONFIG_COUNTER) # define CATCH_CONFIG_COUNTER #endif #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 { if (relativeOK) { return true; } - return std::fabs(lhs_v - rhs.m_value) < rhs.m_margin; + + return std::fabs(lhs_v - rhs.m_value) <= rhs.m_margin; } template ::value>::type> @@ -2828,7 +2831,7 @@ namespace Detail { if (relativeOK) { return true; } - return std::fabs(lhs - rhs.m_value) < rhs.m_margin; + return std::fabs(lhs - rhs.m_value) <= rhs.m_margin; } friend bool operator == ( Approx const& lhs, double rhs ) { @@ -5279,10 +5282,6 @@ namespace Catch { .describe( "should output be colourised" ) .bind( &setUseColour, "yes|no" ); - cli["--use-colour"] - .describe( "should output be colourised" ) - .bind( &setUseColour, "yes|no" ); - cli["--libidentify"] .describe( "report name and version according to libidentify standard" ) .bind( &ConfigData::libIdentify ); @@ -7215,7 +7214,7 @@ namespace Catch { namespace Catch { struct RandomNumberGenerator { - typedef std::ptrdiff_t result_type; + typedef unsigned int result_type; result_type operator()( result_type n ) const { return std::rand() % n; } @@ -8136,7 +8135,7 @@ namespace Catch { std::string AssertionResult::getExpression() const { if( isFalseTest( m_info.resultDisposition ) ) - return '!' + capturedExpressionWithSecondArgument(m_info.capturedExpression, m_info.secondArg); + return "!(" + capturedExpressionWithSecondArgument(m_info.capturedExpression, m_info.secondArg) + ")"; else return capturedExpressionWithSecondArgument(m_info.capturedExpression, m_info.secondArg); } @@ -8394,7 +8393,7 @@ namespace Catch { } inline Version libraryVersion() { - static Version version( 1, 10, 0, "", 0 ); + static Version version( 1, 11, 0, "", 0 ); return version; } diff --git a/test_package/conanfile.py b/test_package/conanfile.py index 1e45e421..a864b9da 100644 --- a/test_package/conanfile.py +++ b/test_package/conanfile.py @@ -10,7 +10,7 @@ class CatchConanTest(ConanFile): settings = "os", "compiler", "arch", "build_type" username = getenv("CONAN_USERNAME", "philsquared") channel = getenv("CONAN_CHANNEL", "testing") - requires = "Catch/1.10.0@%s/%s" % (username, channel) + requires = "Catch/1.11.0@%s/%s" % (username, channel) def build(self): cmake = CMake(self)