Skip to content

Commit 191fa38

Browse files
committed
v3.15.2
1 parent dd94b9a commit 191fa38

7 files changed

Lines changed: 82 additions & 26 deletions

File tree

CMakeLists.txt

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

3737
project(Catch2
38-
VERSION 3.15.1 # CML version placeholder, don't delete
38+
VERSION 3.15.2 # CML version placeholder, don't delete
3939
LANGUAGES CXX
4040
HOMEPAGE_URL "https://github.com/catchorg/Catch2"
4141
DESCRIPTION "A modern, C++-native, unit test framework."

docs/release-notes.md

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

33
# Release notes
44
**Contents**<br>
5+
[3.15.2](#3152)<br>
56
[3.15.1](#3151)<br>
67
[3.15.0](#3150)<br>
78
[3.14.0](#3140)<br>
@@ -76,6 +77,16 @@
7677
[Even Older versions](#even-older-versions)<br>
7778

7879

80+
## 3.15.2
81+
82+
### Fixes
83+
* Fixed `--warn InfiniteGenerators` triggering even if the generator was limited to specific element via path filtering.
84+
* Fixed `-Wunused-parameter` triggering in `-fnoexceptions` builds.
85+
86+
### Improvements
87+
* `catch_discover_tests` can handle cases where the binary prints out non-Catch2 output due to global constructors (#3162)
88+
89+
7990
## 3.15.1
8091

8192
### Fixes

extras/catch_amalgamated.cpp

Lines changed: 43 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66

77
// SPDX-License-Identifier: BSL-1.0
88

9-
// Catch v3.15.1
10-
// Generated: 2026-06-14 10:51:56.053498
9+
// Catch v3.15.2
10+
// Generated: 2026-07-07 20:39:49.445081
1111
// ----------------------------------------------------------
1212
// This file is an amalgamation of multiple different files.
1313
// You probably shouldn't edit it directly.
@@ -2394,7 +2394,7 @@ namespace Catch {
23942394
}
23952395

23962396
Version const& libraryVersion() {
2397-
static Version version( 3, 15, 1, "", 0 );
2397+
static Version version( 3, 15, 2, "", 0 );
23982398
return version;
23992399
}
24002400

@@ -6016,6 +6016,8 @@ namespace Catch {
60166016
auto getGenerator() const -> GeneratorBasePtr const& override {
60176017
return m_generator;
60186018
}
6019+
6020+
bool isFilteredImpl() const override { return m_isFiltered; }
60196021
};
60206022
} // namespace
60216023
}
@@ -6360,17 +6362,6 @@ namespace Catch {
63606362
SourceLineInfo lineInfo,
63616363
Generators::GeneratorBasePtr&& generator ) {
63626364

6363-
// TBD: Do we want to avoid the warning if the generator is filtered?
6364-
if ( m_config->warnAboutInfiniteGenerators() &&
6365-
!generator->isFinite() ) {
6366-
// We want the semantics of `FAIL()`, but we inline it
6367-
// to avoid issues with conditionally prefixed macros
6368-
INTERNAL_CATCH_MSG( "FAIL",
6369-
Catch::ResultWas::ExplicitFailure,
6370-
Catch::ResultDisposition::Normal,
6371-
"GENERATE() would run infinitely" );
6372-
}
6373-
63746365
auto nameAndLoc = TestCaseTracking::NameAndLocation( static_cast<std::string>( generatorName ), lineInfo );
63756366
auto& currentTracker = m_trackerContext.currentTracker();
63766367
assert(
@@ -6383,11 +6374,24 @@ namespace Catch {
63836374
m_trackerContext,
63846375
&currentTracker,
63856376
CATCH_MOVE( generator ) );
6386-
auto ret = newTracker.get();
6377+
6378+
// The warning shouldn't fire if the generator is infinite, **but** filtered down.
6379+
if ( m_config->warnAboutInfiniteGenerators() &&
6380+
!newTracker->m_generator->isFinite() &&
6381+
!newTracker->isFiltered() ) {
6382+
// We want the semantics of `FAIL()`, but we inline it
6383+
// to avoid issues with conditionally prefixed macros
6384+
INTERNAL_CATCH_MSG( "FAIL",
6385+
Catch::ResultWas::ExplicitFailure,
6386+
Catch::ResultDisposition::Normal,
6387+
"GENERATE() would run infinitely" );
6388+
}
6389+
6390+
auto returnPtr = newTracker.get();
63876391
currentTracker.addChild( CATCH_MOVE( newTracker ) );
63886392

6389-
ret->open();
6390-
return ret;
6393+
returnPtr->open();
6394+
return returnPtr;
63916395
}
63926396

63936397
bool RunContext::testForMissingAssertions(Counts& assertions) {
@@ -7470,6 +7474,28 @@ namespace TestCaseTracking {
74707474
m_ctx.setCurrentTracker( this );
74717475
}
74727476

7477+
bool SectionTracker::isFilteredImpl() const {
7478+
// TBD: This is currently _very_ similar to the block in `isComplete`.
7479+
// Is this neccessarily that way, or just accident of current semantics?
7480+
const size_t filterIndex =
7481+
m_newStyleFilters ? m_allTrackerDepth : m_sectionOnlyDepth;
7482+
7483+
if ( filterIndex < m_filterRef->size() ) {
7484+
// 1) New style filter must explicitly target section
7485+
if ( m_newStyleFilters && ( *m_filterRef )[filterIndex].type !=
7486+
PathFilter::For::Section ) {
7487+
return true;
7488+
}
7489+
// 2) Both style filters must match the trimmed name exactly
7490+
if ( m_trimmed_name !=
7491+
StringRef( ( *m_filterRef )[filterIndex].filter ) ) {
7492+
return true;
7493+
}
7494+
}
7495+
7496+
return false;
7497+
}
7498+
74737499
SectionTracker::SectionTracker( NameAndLocation&& nameAndLocation, TrackerContext& ctx, ITracker* parent )
74747500
: TrackerBase( CATCH_MOVE(nameAndLocation), ctx, parent ),
74757501
m_trimmed_name(trim(StringRef(ITracker::nameAndLocation().name)))

extras/catch_amalgamated.hpp

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66

77
// SPDX-License-Identifier: BSL-1.0
88

9-
// Catch v3.15.1
10-
// Generated: 2026-06-14 10:51:55.600632
9+
// Catch v3.15.2
10+
// Generated: 2026-07-07 20:39:49.020441
1111
// ----------------------------------------------------------
1212
// This file is an amalgamation of multiple different files.
1313
// You probably shouldn't edit it directly.
@@ -7484,6 +7484,8 @@ namespace Catch {
74847484
return m_translateFunction( ex );
74857485
}
74867486
#else
7487+
(void)it;
7488+
(void)itEnd;
74877489
return "You should never get here!";
74887490
#endif
74897491
}
@@ -7570,7 +7572,7 @@ namespace Catch {
75707572

75717573
#define CATCH_VERSION_MAJOR 3
75727574
#define CATCH_VERSION_MINOR 15
7573-
#define CATCH_VERSION_PATCH 1
7575+
#define CATCH_VERSION_PATCH 2
75747576

75757577
#endif // CATCH_VERSION_MACROS_HPP_INCLUDED
75767578

@@ -7910,8 +7912,7 @@ namespace Generators {
79107912

79117913
bool isFinite() const override {
79127914
for (auto const& gen : m_generators) {
7913-
if (!gen.isFinite()) { return false;
7914-
}
7915+
if (!gen.isFinite()) { return false; }
79157916
}
79167917
return true;
79177918
}
@@ -10657,6 +10658,8 @@ namespace TestCaseTracking {
1065710658

1065810659
using Children = std::vector<ITrackerPtr>;
1065910660

10661+
virtual bool isFilteredImpl() const = 0;
10662+
1066010663
protected:
1066110664
enum CycleState {
1066210665
NotStarted,
@@ -10754,6 +10757,20 @@ namespace TestCaseTracking {
1075410757
* for internal debug checks.
1075510758
*/
1075610759
virtual bool isGeneratorTracker() const;
10760+
10761+
/**
10762+
* Returns true if the concrete tracker instance has a filter that applies to it.
10763+
*/
10764+
bool isFiltered() const {
10765+
// Fast path: are there even filters for tracker in this position?
10766+
const size_t filter_depth =
10767+
m_newStyleFilters ? m_allTrackerDepth : m_sectionOnlyDepth;
10768+
if ( m_filterRef->size() <= filter_depth ) { return false; }
10769+
10770+
// Slow path: If there are filters, ask the concrete tracker.
10771+
// This handles things like match-all filters for that tracker.
10772+
return isFilteredImpl();
10773+
}
1075710774
};
1075810775

1075910776
class TrackerContext {
@@ -10809,6 +10826,8 @@ namespace TestCaseTracking {
1080910826
// to not own the name, the name still has to outlive the `ITracker` parent, so
1081010827
// this should still be safe.
1081110828
StringRef m_trimmed_name;
10829+
10830+
bool isFilteredImpl() const override;
1081210831
public:
1081310832
SectionTracker( NameAndLocation&& nameAndLocation, TrackerContext& ctx, ITracker* parent );
1081410833

meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
project(
99
'catch2',
1010
'cpp',
11-
version: '3.15.1', # CML version placeholder, don't delete
11+
version: '3.15.2', # CML version placeholder, don't delete
1212
license: 'BSL-1.0',
1313
meson_version: '>=0.54.1',
1414
)

src/catch2/catch_version.cpp

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

3838
Version const& libraryVersion() {
39-
static Version version( 3, 15, 1, "", 0 );
39+
static Version version( 3, 15, 2, "", 0 );
4040
return version;
4141
}
4242

src/catch2/catch_version_macros.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@
1010

1111
#define CATCH_VERSION_MAJOR 3
1212
#define CATCH_VERSION_MINOR 15
13-
#define CATCH_VERSION_PATCH 1
13+
#define CATCH_VERSION_PATCH 2
1414

1515
#endif // CATCH_VERSION_MACROS_HPP_INCLUDED

0 commit comments

Comments
 (0)