Skip to content

Commit ff349a5

Browse files
committed
v2.13.3
1 parent aca2472 commit ff349a5

File tree

6 files changed

+79
-15
lines changed

6 files changed

+79
-15
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ if (CMAKE_BINARY_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
1414
endif()
1515

1616

17-
project(Catch2 LANGUAGES CXX VERSION 2.13.2)
17+
project(Catch2 LANGUAGES CXX VERSION 2.13.3)
1818

1919
# Provide path for scripts
2020
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/CMake")

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
[![Join the chat in Discord: https://discord.gg/4CWS9zD](https://img.shields.io/badge/Discord-Chat!-brightgreen.svg)](https://discord.gg/4CWS9zD)
1010

1111

12-
<a href="https://github.com/catchorg/Catch2/releases/download/v2.13.2/catch.hpp">The latest version of the single header can be downloaded directly using this link</a>
12+
<a href="https://github.com/catchorg/Catch2/releases/download/v2.13.3/catch.hpp">The latest version of the single header can be downloaded directly using this link</a>
1313

1414
## Catch2 is released!
1515

docs/release-notes.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
# Release notes
44
**Contents**<br>
5+
[2.13.3](#2133)<br>
56
[2.13.2](#2132)<br>
67
[2.13.1](#2131)<br>
78
[2.13.0](#2130)<br>
@@ -43,6 +44,17 @@
4344
[Even Older versions](#even-older-versions)<br>
4445

4546

47+
## 2.13.3
48+
49+
### Fixes
50+
* Fixed possible infinite loop when combining generators with section filter (`-c` option) (#2025)
51+
52+
### Miscellaneous
53+
* Fixed `ParseAndAddCatchTests` not finding `TEST_CASE`s without tags (#2055, #2056)
54+
* `ParseAndAddCatchTests` supports `CMP0110` policy for changing behaviour of `add_test` (#2057)
55+
* This was the shortlived change in CMake 3.18.0 that temporarily broke `ParseAndAddCatchTests`
56+
57+
4658
## 2.13.2
4759

4860
### Improvements

include/catch.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
#define CATCH_VERSION_MAJOR 2
1313
#define CATCH_VERSION_MINOR 13
14-
#define CATCH_VERSION_PATCH 2
14+
#define CATCH_VERSION_PATCH 3
1515

1616
#ifdef __clang__
1717
# pragma clang system_header

include/internal/catch_version.cpp

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

3939
Version const& libraryVersion() {
40-
static Version version( 2, 13, 2, "", 0 );
40+
static Version version( 2, 13, 3, "", 0 );
4141
return version;
4242
}
4343

single_include/catch2/catch.hpp

Lines changed: 63 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
2-
* Catch v2.13.2
3-
* Generated: 2020-10-07 11:32:53.302017
2+
* Catch v2.13.3
3+
* Generated: 2020-10-31 18:20:31.045274
44
* ----------------------------------------------------------
55
* This file has been merged from multiple headers. Please don't edit it directly
66
* Copyright (c) 2020 Two Blue Cubes Ltd. All rights reserved.
@@ -15,7 +15,7 @@
1515

1616
#define CATCH_VERSION_MAJOR 2
1717
#define CATCH_VERSION_MINOR 13
18-
#define CATCH_VERSION_PATCH 2
18+
#define CATCH_VERSION_PATCH 3
1919

2020
#ifdef __clang__
2121
# pragma clang system_header
@@ -7602,6 +7602,10 @@ namespace TestCaseTracking {
76027602

76037603
void addInitialFilters( std::vector<std::string> const& filters );
76047604
void addNextFilters( std::vector<std::string> const& filters );
7605+
//! Returns filters active in this tracker
7606+
std::vector<std::string> const& getFilters() const;
7607+
//! Returns whitespace-trimmed name of the tracked section
7608+
std::string const& trimmedName() const;
76057609
};
76067610

76077611
} // namespace TestCaseTracking
@@ -12571,13 +12575,53 @@ namespace Catch {
1257112575
// `SECTION`s.
1257212576
// **The check for m_children.empty cannot be removed**.
1257312577
// doing so would break `GENERATE` _not_ followed by `SECTION`s.
12574-
const bool should_wait_for_child =
12575-
!m_children.empty() &&
12576-
std::find_if( m_children.begin(),
12577-
m_children.end(),
12578-
[]( TestCaseTracking::ITrackerPtr tracker ) {
12579-
return tracker->hasStarted();
12580-
} ) == m_children.end();
12578+
const bool should_wait_for_child = [&]() {
12579+
// No children -> nobody to wait for
12580+
if ( m_children.empty() ) {
12581+
return false;
12582+
}
12583+
// If at least one child started executing, don't wait
12584+
if ( std::find_if(
12585+
m_children.begin(),
12586+
m_children.end(),
12587+
[]( TestCaseTracking::ITrackerPtr tracker ) {
12588+
return tracker->hasStarted();
12589+
} ) != m_children.end() ) {
12590+
return false;
12591+
}
12592+
12593+
// No children have started. We need to check if they _can_
12594+
// start, and thus we should wait for them, or they cannot
12595+
// start (due to filters), and we shouldn't wait for them
12596+
auto* parent = m_parent;
12597+
// This is safe: there is always at least one section
12598+
// tracker in a test case tracking tree
12599+
while ( !parent->isSectionTracker() ) {
12600+
parent = &( parent->parent() );
12601+
}
12602+
assert( parent &&
12603+
"Missing root (test case) level section" );
12604+
12605+
auto const& parentSection =
12606+
static_cast<SectionTracker&>( *parent );
12607+
auto const& filters = parentSection.getFilters();
12608+
// No filters -> no restrictions on running sections
12609+
if ( filters.empty() ) {
12610+
return true;
12611+
}
12612+
12613+
for ( auto const& child : m_children ) {
12614+
if ( child->isSectionTracker() &&
12615+
std::find( filters.begin(),
12616+
filters.end(),
12617+
static_cast<SectionTracker&>( *child )
12618+
.trimmedName() ) !=
12619+
filters.end() ) {
12620+
return true;
12621+
}
12622+
}
12623+
return false;
12624+
}();
1258112625

1258212626
// This check is a bit tricky, because m_generator->next()
1258312627
// has a side-effect, where it consumes generator's current
@@ -14449,6 +14493,14 @@ namespace TestCaseTracking {
1444914493
m_filters.insert( m_filters.end(), filters.begin()+1, filters.end() );
1445014494
}
1445114495

14496+
std::vector<std::string> const& SectionTracker::getFilters() const {
14497+
return m_filters;
14498+
}
14499+
14500+
std::string const& SectionTracker::trimmedName() const {
14501+
return m_trimmed_name;
14502+
}
14503+
1445214504
} // namespace TestCaseTracking
1445314505

1445414506
using TestCaseTracking::ITracker;
@@ -15264,7 +15316,7 @@ namespace Catch {
1526415316
}
1526515317

1526615318
Version const& libraryVersion() {
15267-
static Version version( 2, 13, 2, "", 0 );
15319+
static Version version( 2, 13, 3, "", 0 );
1526815320
return version;
1526915321
}
1527015322

0 commit comments

Comments
 (0)