mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-22 05:16:10 +01:00
v3.1.0
This commit is contained in:
parent
9c9f35068e
commit
97c48e0c34
@ -37,7 +37,7 @@ endif()
|
||||
|
||||
|
||||
project(Catch2
|
||||
VERSION 3.0.1 # CML version placeholder, don't delete
|
||||
VERSION 3.1.0 # CML version placeholder, don't delete
|
||||
LANGUAGES CXX
|
||||
# HOMEPAGE_URL is not supported until CMake version 3.12, which
|
||||
# we do not target yet.
|
||||
|
@ -262,7 +262,7 @@ ParseAndAddCatchTests(bar)
|
||||
|
||||
### `CatchShardTests.cmake`
|
||||
|
||||
> `CatchShardTests.cmake` was introduced in Catch2 X.Y.Z.
|
||||
> `CatchShardTests.cmake` was introduced in Catch2 3.1.0.
|
||||
|
||||
`CatchShardTests.cmake` provides a function
|
||||
`catch_add_sharded_tests(TEST_BINARY)` that splits tests from `TEST_BINARY`
|
||||
|
@ -103,7 +103,7 @@ Catch2 will register a `JUnit` reporter writing to a path pointed by `XML_OUTPUT
|
||||
|
||||
> `CATCH_CONFIG_BAZEL_SUPPORT` was [introduced](https://github.com/catchorg/Catch2/pull/2399) in Catch2 3.0.1.
|
||||
|
||||
> `CATCH_CONFIG_BAZEL_SUPPORT` was [deprecated](https://github.com/catchorg/Catch2/pull/2459) in Catch2 X.Y.Z.
|
||||
> `CATCH_CONFIG_BAZEL_SUPPORT` was [deprecated](https://github.com/catchorg/Catch2/pull/2459) in Catch2 3.1.0.
|
||||
|
||||
## C++11 toggles
|
||||
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
# Release notes
|
||||
**Contents**<br>
|
||||
[3.1.0](#310)<br>
|
||||
[3.0.1](#301)<br>
|
||||
[2.13.7](#2137)<br>
|
||||
[2.13.6](#2136)<br>
|
||||
@ -49,6 +50,45 @@
|
||||
[Even Older versions](#even-older-versions)<br>
|
||||
|
||||
|
||||
## 3.1.0
|
||||
|
||||
### Improvements
|
||||
* Improved suppression of `-Wparentheses` for older GCCs
|
||||
* Turns out that even GCC 9 does not properly handle `_Pragma`s in the C++ frontend.
|
||||
* Added type constraints onto `random` generator (#2433)
|
||||
* These constraints copy what the standard says for the underlying `std::uniform_int_distribution`
|
||||
* Suppressed -Wunused-variable from nvcc (#2306, #2427)
|
||||
* Suppressed -Wunused-variable from MinGW (#2132)
|
||||
* Added All/Any/NoneTrue range matchers (#2319)
|
||||
* These check that all/any/none of boolean values in a range are true.
|
||||
* The JUnit reporter now normalizes classnames from C++ namespaces to Java-like namespaces (#2468)
|
||||
* This provides better support for other JUnit based tools.
|
||||
* The Bazel support now understands `BAZEL_TEST` environment variable (#2459)
|
||||
* The `CATCH_CONFIG_BAZEL_SUPPORT` configuration option is also still supported.
|
||||
* Returned support for compiling Catch2 with GCC 5 (#2448)
|
||||
* This required removing inherited constructors from Catch2's internals.
|
||||
* I recommend updating to a newer GCC anyway.
|
||||
* `catch_discover_tests` now has a new options for setting library load path(s) when running the Catch2 binary (#2467)
|
||||
|
||||
|
||||
### Fixes
|
||||
* Fixed crash when listing listeners without any registered listeners (#2442)
|
||||
* Fixed nvcc compilation error in constructor benchmarking helper (#2477)
|
||||
* Catch2's CMakeList supports pre-3.12 CMake again (#2428)
|
||||
* The gain from requiring CMake 3.12 was very minor, but y'all should really update to newer CMake
|
||||
|
||||
|
||||
### Miscellaneous
|
||||
* Fixed SelfTest build on MinGW (#2447)
|
||||
* The in-repo conan recipe exports the CMake helper (#2460)
|
||||
* Added experimental CMake script to showcase using test case sharding together with CTest
|
||||
* Compared to `catch_discover_tests`, it supports very limited number of options and customization
|
||||
* Added documentation page on best practices when running Catch2 tests
|
||||
* Catch2 can be built as a dynamic library (#2397, #2398)
|
||||
* Note that Catch2 does not have visibility annotations, and you are responsible for ensuring correct visibility built into the resulting library.
|
||||
|
||||
|
||||
|
||||
## 3.0.1
|
||||
|
||||
**Catch2 now uses statically compiled library as its distribution model.
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -5,8 +5,8 @@
|
||||
|
||||
// SPDX-License-Identifier: BSL-1.0
|
||||
|
||||
// Catch v3.0.1
|
||||
// Generated: 2022-05-17 22:08:46.674860
|
||||
// Catch v3.1.0
|
||||
// Generated: 2022-07-17 20:14:04.055157
|
||||
// ----------------------------------------------------------
|
||||
// This file is an amalgamation of multiple different files.
|
||||
// You probably shouldn't edit it directly.
|
||||
@ -360,11 +360,23 @@ namespace Catch {
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(__CUDACC__) && !defined(__clang__)
|
||||
# define CATCH_INTERNAL_START_WARNINGS_SUPPRESSION _Pragma( "nv_diagnostic push" )
|
||||
# define CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION _Pragma( "nv_diagnostic pop" )
|
||||
# define CATCH_INTERNAL_SUPPRESS_UNUSED_VARIABLE_WARNINGS _Pragma( "nv_diag_suppress 177" )
|
||||
#endif
|
||||
|
||||
// clang-cl defines _MSC_VER as well as __clang__, which could cause the
|
||||
// start/stop internal suppression macros to be double defined.
|
||||
#if defined(__clang__) && !defined(_MSC_VER)
|
||||
|
||||
# define CATCH_INTERNAL_START_WARNINGS_SUPPRESSION _Pragma( "clang diagnostic push" )
|
||||
# define CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION _Pragma( "clang diagnostic pop" )
|
||||
|
||||
#endif // __clang__ && !_MSC_VER
|
||||
|
||||
#if defined(__clang__)
|
||||
|
||||
// As of this writing, IBM XL's implementation of __builtin_constant_p has a bug
|
||||
// which results in calls to destructors being emitted for each temporary,
|
||||
// without a matching initialization. In practice, this can result in something
|
||||
@ -2320,7 +2332,7 @@ namespace Catch {
|
||||
double z1 = normal_quantile((1. - confidence_level) / 2.);
|
||||
|
||||
auto cumn = [n]( double x ) -> long {
|
||||
return std::lround( normal_cdf( x ) * n );
|
||||
return std::lround( normal_cdf( x ) * static_cast<double>(n) );
|
||||
};
|
||||
auto a = [bias, accel](double b) { return bias + b / (1. - accel * b); };
|
||||
double b1 = bias + z1;
|
||||
@ -2730,7 +2742,7 @@ namespace Catch {
|
||||
}
|
||||
|
||||
T const& stored_object() const {
|
||||
return *static_cast<T*>(static_cast<void*>(data));
|
||||
return *static_cast<T const*>(static_cast<void const*>(data));
|
||||
}
|
||||
|
||||
|
||||
@ -5568,9 +5580,9 @@ namespace Catch {
|
||||
|
||||
#endif // CATCH_ASSERTION_HANDLER_HPP_INCLUDED
|
||||
|
||||
// We need this suppression to leak, because it took until GCC 9
|
||||
// We need this suppression to leak, because it took until GCC 10
|
||||
// for the front end to handle local suppression via _Pragma properly
|
||||
#if defined(__GNUC__) && !defined(__clang__) && !defined(__ICC) && __GNUC__ < 9
|
||||
#if defined(__GNUC__) && !defined(__clang__) && !defined(__ICC) && __GNUC__ <= 9
|
||||
#pragma GCC diagnostic ignored "-Wparentheses"
|
||||
#endif
|
||||
|
||||
@ -5879,6 +5891,7 @@ struct AutoReg : Detail::NonCopyable {
|
||||
static void TestName(); \
|
||||
CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
|
||||
CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \
|
||||
CATCH_INTERNAL_SUPPRESS_UNUSED_VARIABLE_WARNINGS \
|
||||
namespace{ Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( Catch::makeTestInvoker( &TestName ), CATCH_INTERNAL_LINEINFO, Catch::StringRef(), Catch::NameAndTags{ __VA_ARGS__ } ); } /* NOLINT */ \
|
||||
CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \
|
||||
static void TestName()
|
||||
@ -5889,6 +5902,7 @@ struct AutoReg : Detail::NonCopyable {
|
||||
#define INTERNAL_CATCH_METHOD_AS_TEST_CASE( QualifiedMethod, ... ) \
|
||||
CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
|
||||
CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \
|
||||
CATCH_INTERNAL_SUPPRESS_UNUSED_VARIABLE_WARNINGS \
|
||||
namespace{ Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( Catch::makeTestInvoker( &QualifiedMethod ), CATCH_INTERNAL_LINEINFO, "&" #QualifiedMethod, Catch::NameAndTags{ __VA_ARGS__ } ); } /* NOLINT */ \
|
||||
CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION
|
||||
|
||||
@ -5896,6 +5910,7 @@ struct AutoReg : Detail::NonCopyable {
|
||||
#define INTERNAL_CATCH_TEST_CASE_METHOD2( TestName, ClassName, ... )\
|
||||
CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
|
||||
CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \
|
||||
CATCH_INTERNAL_SUPPRESS_UNUSED_VARIABLE_WARNINGS \
|
||||
namespace{ \
|
||||
struct TestName : INTERNAL_CATCH_REMOVE_PARENS(ClassName) { \
|
||||
void test(); \
|
||||
@ -5912,6 +5927,7 @@ struct AutoReg : Detail::NonCopyable {
|
||||
do { \
|
||||
CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
|
||||
CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \
|
||||
CATCH_INTERNAL_SUPPRESS_UNUSED_VARIABLE_WARNINGS \
|
||||
Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( Catch::makeTestInvoker( Function ), CATCH_INTERNAL_LINEINFO, Catch::StringRef(), Catch::NameAndTags{ __VA_ARGS__ } ); /* NOLINT */ \
|
||||
CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \
|
||||
} while(false)
|
||||
@ -7046,8 +7062,8 @@ namespace Catch {
|
||||
#define CATCH_VERSION_MACROS_HPP_INCLUDED
|
||||
|
||||
#define CATCH_VERSION_MAJOR 3
|
||||
#define CATCH_VERSION_MINOR 0
|
||||
#define CATCH_VERSION_PATCH 1
|
||||
#define CATCH_VERSION_MINOR 1
|
||||
#define CATCH_VERSION_PATCH 0
|
||||
|
||||
#endif // CATCH_VERSION_MACROS_HPP_INCLUDED
|
||||
|
||||
@ -7752,12 +7768,17 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
// TODO: Ideally this would be also constrained against the various char types,
|
||||
// but I don't expect users to run into that in practice.
|
||||
template <typename T>
|
||||
std::enable_if_t<std::is_integral<T>::value && !std::is_same<T, bool>::value,
|
||||
GeneratorWrapper<T>>
|
||||
std::enable_if_t<std::is_integral<T>::value, GeneratorWrapper<T>>
|
||||
random(T a, T b) {
|
||||
static_assert(
|
||||
!std::is_same<T, char>::value &&
|
||||
!std::is_same<T, int8_t>::value &&
|
||||
!std::is_same<T, uint8_t>::value &&
|
||||
!std::is_same<T, signed char>::value &&
|
||||
!std::is_same<T, unsigned char>::value &&
|
||||
!std::is_same<T, bool>::value,
|
||||
"The requested type is not supported by the underlying random distributions from std" );
|
||||
return GeneratorWrapper<T>(
|
||||
Catch::Detail::make_unique<RandomIntegerGenerator<T>>(a, b, Detail::getSeed())
|
||||
);
|
||||
@ -8097,6 +8118,9 @@ namespace Catch {
|
||||
#ifndef CATCH_CONSOLE_WIDTH_HPP_INCLUDED
|
||||
#define CATCH_CONSOLE_WIDTH_HPP_INCLUDED
|
||||
|
||||
// This include must be kept so that user's configured value for CONSOLE_WIDTH
|
||||
// is used before we attempt to provide a default value
|
||||
|
||||
#ifndef CATCH_CONFIG_CONSOLE_WIDTH
|
||||
#define CATCH_CONFIG_CONSOLE_WIDTH 80
|
||||
#endif
|
||||
@ -10455,7 +10479,6 @@ namespace Catch {
|
||||
|
||||
class IsEmptyMatcher final : public MatcherGenericBase {
|
||||
public:
|
||||
// todo: Use polyfills
|
||||
template <typename RangeLike>
|
||||
bool match(RangeLike&& rng) const {
|
||||
#if defined(CATCH_CONFIG_POLYFILL_NONMEMBER_CONTAINER_ACCESS)
|
||||
@ -10856,7 +10879,55 @@ namespace Catch {
|
||||
}
|
||||
};
|
||||
|
||||
// Creates a matcher that checks whether a range contains element matching a matcher
|
||||
// Matcher for checking that all elements in range are true.
|
||||
class AllTrueMatcher final : public MatcherGenericBase {
|
||||
public:
|
||||
std::string describe() const override;
|
||||
|
||||
template <typename RangeLike>
|
||||
bool match(RangeLike&& rng) const {
|
||||
for (auto&& elem : rng) {
|
||||
if (!elem) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
// Matcher for checking that no element in range is true.
|
||||
class NoneTrueMatcher final : public MatcherGenericBase {
|
||||
public:
|
||||
std::string describe() const override;
|
||||
|
||||
template <typename RangeLike>
|
||||
bool match(RangeLike&& rng) const {
|
||||
for (auto&& elem : rng) {
|
||||
if (elem) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
// Matcher for checking that any element in range is true.
|
||||
class AnyTrueMatcher final : public MatcherGenericBase {
|
||||
public:
|
||||
std::string describe() const override;
|
||||
|
||||
template <typename RangeLike>
|
||||
bool match(RangeLike&& rng) const {
|
||||
for (auto&& elem : rng) {
|
||||
if (elem) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
// Creates a matcher that checks whether all elements in a range match a matcher
|
||||
template <typename Matcher>
|
||||
AllMatchMatcher<Matcher> AllMatch(Matcher&& matcher) {
|
||||
return { CATCH_FORWARD(matcher) };
|
||||
@ -10873,6 +10944,15 @@ namespace Catch {
|
||||
AnyMatchMatcher<Matcher> AnyMatch(Matcher&& matcher) {
|
||||
return { CATCH_FORWARD(matcher) };
|
||||
}
|
||||
|
||||
// Creates a matcher that checks whether all elements in a range are true
|
||||
AllTrueMatcher AllTrue();
|
||||
|
||||
// Creates a matcher that checks whether no element in a range is true
|
||||
NoneTrueMatcher NoneTrue();
|
||||
|
||||
// Creates a matcher that checks whether any element in a range is true
|
||||
AnyTrueMatcher AnyTrue();
|
||||
}
|
||||
}
|
||||
|
||||
@ -11252,7 +11332,11 @@ namespace Catch {
|
||||
|
||||
class StreamingReporterBase : public ReporterBase {
|
||||
public:
|
||||
using ReporterBase::ReporterBase;
|
||||
// GCC5 compat: we cannot use inherited constructor, because it
|
||||
// doesn't implement backport of P0136
|
||||
StreamingReporterBase(ReporterConfig&& _config):
|
||||
ReporterBase(CATCH_MOVE(_config))
|
||||
{}
|
||||
~StreamingReporterBase() override;
|
||||
|
||||
void benchmarkPreparing( StringRef ) override {}
|
||||
@ -11309,7 +11393,11 @@ namespace Catch {
|
||||
|
||||
class AutomakeReporter final : public StreamingReporterBase {
|
||||
public:
|
||||
using StreamingReporterBase::StreamingReporterBase;
|
||||
// GCC5 compat: we cannot use inherited constructor, because it
|
||||
// doesn't implement backport of P0136
|
||||
AutomakeReporter(ReporterConfig&& _config):
|
||||
StreamingReporterBase(CATCH_MOVE(_config))
|
||||
{}
|
||||
~AutomakeReporter() override;
|
||||
|
||||
static std::string getDescription() {
|
||||
@ -11505,7 +11593,11 @@ namespace Catch {
|
||||
using TestCaseNode = Node<TestCaseStats, SectionNode>;
|
||||
using TestRunNode = Node<TestRunStats, TestCaseNode>;
|
||||
|
||||
using ReporterBase::ReporterBase;
|
||||
// GCC5 compat: we cannot use inherited constructor, because it
|
||||
// doesn't implement backport of P0136
|
||||
CumulativeReporterBase(ReporterConfig&& _config):
|
||||
ReporterBase(CATCH_MOVE(_config))
|
||||
{}
|
||||
~CumulativeReporterBase() override;
|
||||
|
||||
void benchmarkPreparing( StringRef ) override {}
|
||||
|
@ -36,7 +36,7 @@ namespace Catch {
|
||||
}
|
||||
|
||||
Version const& libraryVersion() {
|
||||
static Version version( 3, 0, 1, "", 0 );
|
||||
static Version version( 3, 1, 0, "", 0 );
|
||||
return version;
|
||||
}
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
#define CATCH_VERSION_MACROS_HPP_INCLUDED
|
||||
|
||||
#define CATCH_VERSION_MAJOR 3
|
||||
#define CATCH_VERSION_MINOR 0
|
||||
#define CATCH_VERSION_PATCH 1
|
||||
#define CATCH_VERSION_MINOR 1
|
||||
#define CATCH_VERSION_PATCH 0
|
||||
|
||||
#endif // CATCH_VERSION_MACROS_HPP_INCLUDED
|
||||
|
Loading…
Reference in New Issue
Block a user