mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-16 10:42:25 +01:00
Merge branch 'v2.x' into patch-1
This commit is contained in:
commit
40d1268878
@ -16,7 +16,7 @@ if (CMAKE_BINARY_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
project(Catch2 LANGUAGES CXX VERSION 2.13.9)
|
project(Catch2 LANGUAGES CXX VERSION 2.13.10)
|
||||||
|
|
||||||
# Provide path for scripts
|
# Provide path for scripts
|
||||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/CMake")
|
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/CMake")
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
[![Join the chat in Discord: https://discord.gg/4CWS9zD](https://img.shields.io/badge/Discord-Chat!-brightgreen.svg)](https://discord.gg/4CWS9zD)
|
[![Join the chat in Discord: https://discord.gg/4CWS9zD](https://img.shields.io/badge/Discord-Chat!-brightgreen.svg)](https://discord.gg/4CWS9zD)
|
||||||
|
|
||||||
|
|
||||||
<a href="https://github.com/catchorg/Catch2/releases/download/v2.13.9/catch.hpp">The latest version of the single header can be downloaded directly using this link</a>
|
<a href="https://github.com/catchorg/Catch2/releases/download/v2.13.10/catch.hpp">The latest version of the single header can be downloaded directly using this link</a>
|
||||||
|
|
||||||
## Catch2 is released!
|
## Catch2 is released!
|
||||||
|
|
||||||
|
@ -87,7 +87,7 @@ int main( int argc, char* argv[] )
|
|||||||
int height = 0; // Some user variable you want to be able to set
|
int height = 0; // Some user variable you want to be able to set
|
||||||
|
|
||||||
// Build a new parser on top of Catch's
|
// Build a new parser on top of Catch's
|
||||||
using namespace Catch::clara;
|
using namespace Catch::Clara;
|
||||||
auto cli
|
auto cli
|
||||||
= session.cli() // Get Catch's composite command line parser
|
= session.cli() // Get Catch's composite command line parser
|
||||||
| Opt( height, "height" ) // bind variable to a new option, with a hint string
|
| Opt( height, "height" ) // bind variable to a new option, with a hint string
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
# Release notes
|
# Release notes
|
||||||
**Contents**<br>
|
**Contents**<br>
|
||||||
|
[2.13.10](#21310)<br>
|
||||||
[2.13.9](#2139)<br>
|
[2.13.9](#2139)<br>
|
||||||
[2.13.8](#2138)<br>
|
[2.13.8](#2138)<br>
|
||||||
[2.13.7](#2137)<br>
|
[2.13.7](#2137)<br>
|
||||||
@ -50,6 +51,15 @@
|
|||||||
[Even Older versions](#even-older-versions)<br>
|
[Even Older versions](#even-older-versions)<br>
|
||||||
|
|
||||||
|
|
||||||
|
## 2.13.10
|
||||||
|
|
||||||
|
### Fixes
|
||||||
|
* Fixed issue with `catch_discover_tests` when there is multiple of 256 tests (#2401, #2503)
|
||||||
|
* Catch2-provided `main` and `wmain` are explicitly marked as `__cdecl` when compiled with MSVC (#2486, #2487)
|
||||||
|
* Improved break-into-debugger behaviour for ARM Macs. It should now be possible to step execution after the break (#2422)
|
||||||
|
* Replaced deprecated `std::aligned_storage` (#2419, #2420)
|
||||||
|
|
||||||
|
|
||||||
## 2.13.9
|
## 2.13.9
|
||||||
|
|
||||||
### Fixes
|
### Fixes
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
#define CATCH_VERSION_MAJOR 2
|
#define CATCH_VERSION_MAJOR 2
|
||||||
#define CATCH_VERSION_MINOR 13
|
#define CATCH_VERSION_MINOR 13
|
||||||
#define CATCH_VERSION_PATCH 9
|
#define CATCH_VERSION_PATCH 10
|
||||||
|
|
||||||
#ifdef __clang__
|
#ifdef __clang__
|
||||||
# pragma clang system_header
|
# pragma clang system_header
|
||||||
|
@ -121,7 +121,10 @@ namespace {
|
|||||||
|
|
||||||
#elif defined( CATCH_CONFIG_COLOUR_ANSI ) //////////////////////////////////////
|
#elif defined( CATCH_CONFIG_COLOUR_ANSI ) //////////////////////////////////////
|
||||||
|
|
||||||
#include <unistd.h>
|
#if defined( CATCH_PLATFORM_LINUX ) || defined( CATCH_PLATFORM_MAC )
|
||||||
|
# define CATCH_INTERNAL_HAS_ISATTY
|
||||||
|
# include <unistd.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace Catch {
|
namespace Catch {
|
||||||
namespace {
|
namespace {
|
||||||
@ -170,7 +173,8 @@ namespace {
|
|||||||
#if defined(CATCH_PLATFORM_MAC) || defined(CATCH_PLATFORM_IPHONE)
|
#if defined(CATCH_PLATFORM_MAC) || defined(CATCH_PLATFORM_IPHONE)
|
||||||
!isDebuggerActive() &&
|
!isDebuggerActive() &&
|
||||||
#endif
|
#endif
|
||||||
#if !(defined(__DJGPP__) && defined(__STRICT_ANSI__))
|
#if defined( CATCH_INTERNAL_HAS_ISATTY ) && \
|
||||||
|
!( defined( __DJGPP__ ) && defined( __STRICT_ANSI__ ) )
|
||||||
isatty(STDOUT_FILENO)
|
isatty(STDOUT_FILENO)
|
||||||
#else
|
#else
|
||||||
false
|
false
|
||||||
|
@ -13,12 +13,20 @@
|
|||||||
|
|
||||||
#ifndef __OBJC__
|
#ifndef __OBJC__
|
||||||
|
|
||||||
|
#ifndef CATCH_INTERNAL_CDECL
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#define CATCH_INTERNAL_CDECL __cdecl
|
||||||
|
#else
|
||||||
|
#define CATCH_INTERNAL_CDECL
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(CATCH_CONFIG_WCHAR) && defined(CATCH_PLATFORM_WINDOWS) && !defined(__MINGW32__) && defined(_UNICODE) && !defined(DO_NOT_USE_WMAIN)
|
#if defined(CATCH_CONFIG_WCHAR) && defined(CATCH_PLATFORM_WINDOWS) && !defined(__MINGW32__) && defined(_UNICODE) && !defined(DO_NOT_USE_WMAIN)
|
||||||
// Standard C/C++ Win32 Unicode wmain entry point
|
// Standard C/C++ Win32 Unicode wmain entry point
|
||||||
extern "C" int wmain (int argc, wchar_t * argv[], wchar_t * []) {
|
extern "C" int CATCH_INTERNAL_CDECL wmain (int argc, wchar_t * argv[], wchar_t * []) {
|
||||||
#else
|
#else
|
||||||
// Standard C/C++ main entry point
|
// Standard C/C++ main entry point
|
||||||
int main (int argc, char * argv[]) {
|
int CATCH_INTERNAL_CDECL main (int argc, char * argv[]) {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return Catch::Session().run( argc, argv );
|
return Catch::Session().run( argc, argv );
|
||||||
|
@ -12,6 +12,9 @@
|
|||||||
// See e.g.:
|
// See e.g.:
|
||||||
// https://opensource.apple.com/source/CarbonHeaders/CarbonHeaders-18.1/TargetConditionals.h.auto.html
|
// https://opensource.apple.com/source/CarbonHeaders/CarbonHeaders-18.1/TargetConditionals.h.auto.html
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
|
# ifndef __has_extension
|
||||||
|
# define __has_extension(x) 0
|
||||||
|
# endif
|
||||||
# include <TargetConditionals.h>
|
# include <TargetConditionals.h>
|
||||||
# if (defined(TARGET_OS_OSX) && TARGET_OS_OSX == 1) || \
|
# if (defined(TARGET_OS_OSX) && TARGET_OS_OSX == 1) || \
|
||||||
(defined(TARGET_OS_MAC) && TARGET_OS_MAC == 1)
|
(defined(TARGET_OS_MAC) && TARGET_OS_MAC == 1)
|
||||||
|
@ -9,6 +9,7 @@
|
|||||||
#include "catch_interfaces_registry_hub.h"
|
#include "catch_interfaces_registry_hub.h"
|
||||||
|
|
||||||
#include "catch_context.h"
|
#include "catch_context.h"
|
||||||
|
#include "catch_enforce.h"
|
||||||
#include "catch_test_case_registry_impl.h"
|
#include "catch_test_case_registry_impl.h"
|
||||||
#include "catch_reporter_registry.h"
|
#include "catch_reporter_registry.h"
|
||||||
#include "catch_exception_translator_registry.h"
|
#include "catch_exception_translator_registry.h"
|
||||||
|
@ -293,7 +293,7 @@ namespace Catch {
|
|||||||
|
|
||||||
// Handle list request
|
// Handle list request
|
||||||
if( Option<std::size_t> listed = list( m_config ) )
|
if( Option<std::size_t> listed = list( m_config ) )
|
||||||
return static_cast<int>( *listed );
|
return (std::min) (MaxExitCode, static_cast<int>(*listed));
|
||||||
|
|
||||||
TestGroup tests { m_config };
|
TestGroup tests { m_config };
|
||||||
auto const totals = tests.execute();
|
auto const totals = tests.execute();
|
||||||
|
@ -37,7 +37,7 @@ namespace Catch {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Version const& libraryVersion() {
|
Version const& libraryVersion() {
|
||||||
static Version version( 2, 13, 9, "", 0 );
|
static Version version( 2, 13, 10, "", 0 );
|
||||||
return version;
|
return version;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -241,17 +241,19 @@ std::ostream& operator<<(std::ostream& out, helper_1436<T1, T2> const& helper) {
|
|||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// clang can handle GCC's diagnostic pragma
|
||||||
|
#if defined( __GNUG__ ) || defined(__clang__)
|
||||||
|
# pragma GCC diagnostic push
|
||||||
|
#endif
|
||||||
// Clang and gcc have different names for this warning, and clang also
|
// Clang and gcc have different names for this warning, and clang also
|
||||||
// warns about an unused value
|
// warns about an unused value
|
||||||
#if defined(__GNUG__) && !defined(__clang__)
|
#if defined( __GNUG__ ) && !defined( __clang__ ) && \
|
||||||
#pragma GCC diagnostic push
|
( __GNUG__ > 10 || ( __GNUG__ == 10 && __GNUC_MINOR__ >= 1 ) )
|
||||||
#pragma GCC diagnostic ignored "-Wcomma-subscript"
|
#pragma GCC diagnostic ignored "-Wcomma-subscript"
|
||||||
#elif defined(__clang__)
|
#elif defined(__clang__)
|
||||||
#pragma clang diagnostic push
|
|
||||||
#pragma clang diagnostic ignored "-Wdeprecated-comma-subscript"
|
#pragma clang diagnostic ignored "-Wdeprecated-comma-subscript"
|
||||||
#pragma clang diagnostic ignored "-Wunused-value"
|
#pragma clang diagnostic ignored "-Wunused-value"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
TEST_CASE("CAPTURE can deal with complex expressions involving commas", "[messages][capture]") {
|
TEST_CASE("CAPTURE can deal with complex expressions involving commas", "[messages][capture]") {
|
||||||
CAPTURE(std::vector<int>{1, 2, 3}[0, 1, 2],
|
CAPTURE(std::vector<int>{1, 2, 3}[0, 1, 2],
|
||||||
std::vector<int>{1, 2, 3}[(0, 1)],
|
std::vector<int>{1, 2, 3}[(0, 1)],
|
||||||
@ -261,9 +263,8 @@ TEST_CASE("CAPTURE can deal with complex expressions involving commas", "[messag
|
|||||||
CAPTURE( (1, 2), (2, 3) );
|
CAPTURE( (1, 2), (2, 3) );
|
||||||
SUCCEED();
|
SUCCEED();
|
||||||
}
|
}
|
||||||
|
#if defined( __GNUG__ ) || defined(__clang__)
|
||||||
#ifdef __GNUG__
|
# pragma GCC diagnostic pop
|
||||||
#pragma GCC diagnostic pop
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
TEST_CASE("CAPTURE parses string and character constants", "[messages][capture]") {
|
TEST_CASE("CAPTURE parses string and character constants", "[messages][capture]") {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Catch v2.13.9
|
* Catch v2.13.10
|
||||||
* Generated: 2022-04-12 22:37:23.260201
|
* Generated: 2022-10-16 11:01:23.452308
|
||||||
* ----------------------------------------------------------
|
* ----------------------------------------------------------
|
||||||
* This file has been merged from multiple headers. Please don't edit it directly
|
* This file has been merged from multiple headers. Please don't edit it directly
|
||||||
* Copyright (c) 2022 Two Blue Cubes Ltd. All rights reserved.
|
* Copyright (c) 2022 Two Blue Cubes Ltd. All rights reserved.
|
||||||
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
#define CATCH_VERSION_MAJOR 2
|
#define CATCH_VERSION_MAJOR 2
|
||||||
#define CATCH_VERSION_MINOR 13
|
#define CATCH_VERSION_MINOR 13
|
||||||
#define CATCH_VERSION_PATCH 9
|
#define CATCH_VERSION_PATCH 10
|
||||||
|
|
||||||
#ifdef __clang__
|
#ifdef __clang__
|
||||||
# pragma clang system_header
|
# pragma clang system_header
|
||||||
@ -7395,8 +7395,6 @@ namespace Catch {
|
|||||||
template <typename T, bool Destruct>
|
template <typename T, bool Destruct>
|
||||||
struct ObjectStorage
|
struct ObjectStorage
|
||||||
{
|
{
|
||||||
using TStorage = typename std::aligned_storage<sizeof(T), std::alignment_of<T>::value>::type;
|
|
||||||
|
|
||||||
ObjectStorage() : data() {}
|
ObjectStorage() : data() {}
|
||||||
|
|
||||||
ObjectStorage(const ObjectStorage& other)
|
ObjectStorage(const ObjectStorage& other)
|
||||||
@ -7439,7 +7437,7 @@ namespace Catch {
|
|||||||
return *static_cast<T*>(static_cast<void*>(&data));
|
return *static_cast<T*>(static_cast<void*>(&data));
|
||||||
}
|
}
|
||||||
|
|
||||||
TStorage data;
|
struct { alignas(T) unsigned char data[sizeof(T)]; } data;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -7949,7 +7947,7 @@ namespace Catch {
|
|||||||
#if defined(__i386__) || defined(__x86_64__)
|
#if defined(__i386__) || defined(__x86_64__)
|
||||||
#define CATCH_TRAP() __asm__("int $3\n" : : ) /* NOLINT */
|
#define CATCH_TRAP() __asm__("int $3\n" : : ) /* NOLINT */
|
||||||
#elif defined(__aarch64__)
|
#elif defined(__aarch64__)
|
||||||
#define CATCH_TRAP() __asm__(".inst 0xd4200000")
|
#define CATCH_TRAP() __asm__(".inst 0xd43e0000")
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#elif defined(CATCH_PLATFORM_IPHONE)
|
#elif defined(CATCH_PLATFORM_IPHONE)
|
||||||
@ -13558,7 +13556,7 @@ namespace Catch {
|
|||||||
|
|
||||||
// Handle list request
|
// Handle list request
|
||||||
if( Option<std::size_t> listed = list( m_config ) )
|
if( Option<std::size_t> listed = list( m_config ) )
|
||||||
return static_cast<int>( *listed );
|
return (std::min) (MaxExitCode, static_cast<int>(*listed));
|
||||||
|
|
||||||
TestGroup tests { m_config };
|
TestGroup tests { m_config };
|
||||||
auto const totals = tests.execute();
|
auto const totals = tests.execute();
|
||||||
@ -15391,7 +15389,7 @@ namespace Catch {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Version const& libraryVersion() {
|
Version const& libraryVersion() {
|
||||||
static Version version( 2, 13, 9, "", 0 );
|
static Version version( 2, 13, 10, "", 0 );
|
||||||
return version;
|
return version;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -17526,12 +17524,20 @@ namespace Catch {
|
|||||||
|
|
||||||
#ifndef __OBJC__
|
#ifndef __OBJC__
|
||||||
|
|
||||||
|
#ifndef CATCH_INTERNAL_CDECL
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#define CATCH_INTERNAL_CDECL __cdecl
|
||||||
|
#else
|
||||||
|
#define CATCH_INTERNAL_CDECL
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(CATCH_CONFIG_WCHAR) && defined(CATCH_PLATFORM_WINDOWS) && defined(_UNICODE) && !defined(DO_NOT_USE_WMAIN)
|
#if defined(CATCH_CONFIG_WCHAR) && defined(CATCH_PLATFORM_WINDOWS) && defined(_UNICODE) && !defined(DO_NOT_USE_WMAIN)
|
||||||
// Standard C/C++ Win32 Unicode wmain entry point
|
// Standard C/C++ Win32 Unicode wmain entry point
|
||||||
extern "C" int wmain (int argc, wchar_t * argv[], wchar_t * []) {
|
extern "C" int CATCH_INTERNAL_CDECL wmain (int argc, wchar_t * argv[], wchar_t * []) {
|
||||||
#else
|
#else
|
||||||
// Standard C/C++ main entry point
|
// Standard C/C++ main entry point
|
||||||
int main (int argc, char * argv[]) {
|
int CATCH_INTERNAL_CDECL main (int argc, char * argv[]) {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return Catch::Session().run( argc, argv );
|
return Catch::Session().run( argc, argv );
|
||||||
|
Loading…
Reference in New Issue
Block a user