Compare commits

...

4 Commits

Author SHA1 Message Date
Martin Hořeňovský
62fd660583 v2.13.9 2022-04-12 22:38:17 +02:00
Martin Mekota
0aa4dbae2e Fix filename as tag bug
When a test file isn't provided with "/" in the path,
the filename isn't registered as a tag.
Fixing by providing a conditon for this edge case.

Closes #2328
2022-03-18 22:32:54 +01:00
John Beard
ff151d2833 Fix: CAPTURE not variadic when disabled (#2378)
Closes: #2316
2022-03-04 15:29:22 +01:00
Mikhail Matrosov
958944d27a Allow to specify CATCH_CONFIG_DEFAULT_REPORTER for static library with main() (#2346) 2022-01-25 21:54:19 +01:00
9 changed files with 35 additions and 10 deletions

View File

@@ -16,7 +16,7 @@ if (CMAKE_BINARY_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
endif()
project(Catch2 LANGUAGES CXX VERSION 2.13.8)
project(Catch2 LANGUAGES CXX VERSION 2.13.9)
# Provide path for scripts
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/CMake")
@@ -116,6 +116,10 @@ if (CATCH_BUILD_STATIC_LIBRARY)
("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" AND NOT ${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS 10))
target_compile_options(Catch2WithMain PRIVATE "-ffile-prefix-map=${CMAKE_SOURCE_DIR}=.")
endif()
if (CATCH_CONFIG_DEFAULT_REPORTER)
target_compile_definitions(Catch2WithMain PRIVATE CATCH_CONFIG_DEFAULT_REPORTER=${CATCH_CONFIG_DEFAULT_REPORTER})
endif()
endif(CATCH_BUILD_STATIC_LIBRARY)
# Only perform the installation steps when Catch is not being used as

View File

@@ -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)
<a href="https://github.com/catchorg/Catch2/releases/download/v2.13.8/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.9/catch.hpp">The latest version of the single header can be downloaded directly using this link</a>
## Catch2 is released!

View File

@@ -2,6 +2,7 @@
# Release notes
**Contents**<br>
[2.13.9](#2139)<br>
[2.13.8](#2138)<br>
[2.13.7](#2137)<br>
[2.13.6](#2136)<br>
@@ -49,6 +50,13 @@
[Even Older versions](#even-older-versions)<br>
## 2.13.9
### Fixes
* Fixed issue with `-#` (filename-as-tag) flag when `__FILE__` expands into filename without directories (#2328, #2393)
* Fixed `CAPTURE` macro not being variadic when disabled through `CATCH_CONFIG_DISABLE` (#2316, #2378)
## 2.13.8
### Fixes

View File

@@ -11,7 +11,7 @@
#define CATCH_VERSION_MAJOR 2
#define CATCH_VERSION_MINOR 13
#define CATCH_VERSION_PATCH 8
#define CATCH_VERSION_PATCH 9
#ifdef __clang__
# pragma clang system_header
@@ -433,7 +433,7 @@ using Catch::Detail::Approx;
#define INFO( msg ) (void)(0)
#define UNSCOPED_INFO( msg ) (void)(0)
#define WARN( msg ) (void)(0)
#define CAPTURE( msg ) (void)(0)
#define CAPTURE( ... ) (void)(0)
#define TEST_CASE( ... ) INTERNAL_CATCH_TESTCASE_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( C_A_T_C_H_T_E_S_T_ ))
#define TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TESTCASE_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( C_A_T_C_H_T_E_S_T_ ))

View File

@@ -127,6 +127,10 @@ namespace Catch {
filename.erase(0, lastSlash);
filename[0] = '#';
}
else
{
filename.insert(0, "#");
}
auto lastDot = filename.find_last_of('.');
if (lastDot != std::string::npos) {

View File

@@ -37,7 +37,7 @@ namespace Catch {
}
Version const& libraryVersion() {
static Version version( 2, 13, 8, "", 0 );
static Version version( 2, 13, 9, "", 0 );
return version;
}

View File

@@ -53,6 +53,7 @@ CATCH_TEST_CASE("PrefixedMacros") {
CATCH_SECTION("some section") {
int i = 1;
CATCH_CAPTURE( i );
CATCH_CAPTURE( i, i + 1 );
CATCH_DYNAMIC_SECTION("Dynamic section: " << i) {
CATCH_FAIL_CHECK( "failure" );
}

View File

@@ -26,6 +26,10 @@ foo f;
// This test should not be run, because it won't be registered
TEST_CASE( "Disabled Macros" ) {
CAPTURE( 1 );
CAPTURE( 1, "captured" );
std::cout << "This should not happen\n";
FAIL();
}

View File

@@ -1,6 +1,6 @@
/*
* Catch v2.13.8
* Generated: 2022-01-03 21:20:09.589503
* Catch v2.13.9
* Generated: 2022-04-12 22:37:23.260201
* ----------------------------------------------------------
* This file has been merged from multiple headers. Please don't edit it directly
* Copyright (c) 2022 Two Blue Cubes Ltd. All rights reserved.
@@ -15,7 +15,7 @@
#define CATCH_VERSION_MAJOR 2
#define CATCH_VERSION_MINOR 13
#define CATCH_VERSION_PATCH 8
#define CATCH_VERSION_PATCH 9
#ifdef __clang__
# pragma clang system_header
@@ -13392,6 +13392,10 @@ namespace Catch {
filename.erase(0, lastSlash);
filename[0] = '#';
}
else
{
filename.insert(0, "#");
}
auto lastDot = filename.find_last_of('.');
if (lastDot != std::string::npos) {
@@ -15387,7 +15391,7 @@ namespace Catch {
}
Version const& libraryVersion() {
static Version version( 2, 13, 8, "", 0 );
static Version version( 2, 13, 9, "", 0 );
return version;
}
@@ -17890,7 +17894,7 @@ using Catch::Detail::Approx;
#define INFO( msg ) (void)(0)
#define UNSCOPED_INFO( msg ) (void)(0)
#define WARN( msg ) (void)(0)
#define CAPTURE( msg ) (void)(0)
#define CAPTURE( ... ) (void)(0)
#define TEST_CASE( ... ) INTERNAL_CATCH_TESTCASE_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( C_A_T_C_H_T_E_S_T_ ))
#define TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TESTCASE_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( C_A_T_C_H_T_E_S_T_ ))