Skip to content

Commit 5adcaab

Browse files
committed
Update third_party libs
1 parent b7d2d23 commit 5adcaab

File tree

154 files changed

+6097
-877
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

154 files changed

+6097
-877
lines changed

third_party/Catch2/README.md

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,5 @@
11
<a id="top"></a>
2-
3-
<table width="100%">
4-
<tr>
5-
<td align="center" width="50%"><img src="/data/artwork/catch2-logo-full-with-background.svg" width="100%"></td>
6-
<td align="center" width="50%">
7-
<figure>
8-
<figcaption>Special thanks to:</figcaption>
9-
<a href="https://tuple.app/catch2"><img src="/data/sponsors/github_repo_sponsorship.png" width="100%"></a>
10-
</figure>
11-
</td>
12-
</tr>
13-
</table>
2+
![Catch2 logo](data/artwork/catch2-logo-full-with-background.svg)
143

154
[![Github Releases](https://img.shields.io/github/release/catchorg/catch2.svg)](https://github.com/catchorg/catch2/releases)
165
[![Linux build status](https://github.com/catchorg/Catch2/actions/workflows/linux-simple-builds.yml/badge.svg)](https://github.com/catchorg/Catch2/actions/workflows/linux-simple-builds.yml)
-264 KB
Binary file not shown.

third_party/Catch2/docs/command-line.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,10 +358,13 @@ There are currently two warnings implemented:
358358
// (e.g. `REQUIRE`) is encountered.
359359
UnmatchedTestSpec // Fail test run if any of the CLI test specs did
360360
// not match any tests.
361+
InfiniteGenerators // Fail if GENERATE would run infinitely
361362
```
362363

363364
> `UnmatchedTestSpec` was introduced in Catch2 3.0.1.
364365
366+
> `InfiniteGenerators` was introduced in Catch2 vX.Y.Z
367+
365368

366369
<a id="reporting-timings"></a>
367370
## Reporting timings

third_party/Catch2/docs/deprecations.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,21 @@ If you are mutating the fixture instance from within the test case, and
4848
want to keep doing so in the future, mark the mutated members as `mutable`.
4949

5050

51+
### Generator interfaces
52+
53+
#### Defaulted `UntypedGeneratorBase::isFinite()`
54+
55+
> Deprecated in Catch2 vX.Y.Z
56+
57+
The `UntypedGeneratorBase` currently provides a default implementation
58+
for `isFinite` that always returns `true`. This was done to keep backwards
59+
compatibility with pre-existing generators, as infinite generators can
60+
be diagnosed as errors in some cases.
61+
62+
In the future, all generators will be expected to override `isFinite`.
63+
64+
65+
5166
---
5267

5368
[Home](Readme.md#top)

third_party/Catch2/docs/generators.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,11 +276,22 @@ struct IGenerator : GeneratorUntypedBase {
276276
* Going backwards is not supported.
277277
*/
278278
virtual void skipToNthElementImpl( std::size_t n );
279+
280+
/**
281+
* Returns true if calls to `next` will eventually return false
282+
*
283+
* Note that for backwards compatibility this is currently defaulted
284+
* to return `true`, but in the future all generators will have to
285+
* provide their own implementation.
286+
*/
287+
virtual bool isFinite() const = 0;
279288
};
280289
```
281290

282291
> `skipToNthElementImpl` was added in Catch2 vX.Y.Z
283292
293+
> `isFinite` was added in Catch2 vX.Y.Z
294+
284295
However, to be able to use your custom generator inside `GENERATE`, it
285296
will need to be wrapped inside a `GeneratorWrapper<T>`.
286297
`GeneratorWrapper<T>` is a value wrapper around a

third_party/Catch2/examples/300-Gen-OwnGenerator.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ class RandomIntGenerator final : public Catch::Generators::IGenerator<int> {
4040
return true;
4141
}
4242

43+
bool isFinite() const override { return false; }
44+
4345
// Note: this improves the performance only a bit, but it is here
4446
// to show how you can override the skip functionality.
4547
void skipToNthElementImpl( std::size_t n ) override {

third_party/Catch2/examples/301-Gen-MapTypeConversion.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ class LineGenerator final : public Catch::Generators::IGenerator<std::string> {
4040
bool next() override {
4141
return !!std::getline(m_stream, m_line);
4242
}
43+
44+
bool isFinite() const override { return true; }
4345
};
4446

4547
std::string const& LineGenerator::get() const {

third_party/Catch2/src/catch2/catch_config.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,9 @@ namespace Catch {
197197
bool Config::warnAboutUnmatchedTestSpecs() const {
198198
return !!( m_data.warnings & WarnAbout::UnmatchedTestSpec );
199199
}
200+
bool Config::warnAboutInfiniteGenerators() const {
201+
return !!( m_data.warnings & WarnAbout::InfiniteGenerator );
202+
}
200203
bool Config::zeroTestsCountAsSuccess() const { return m_data.allowZeroTests; }
201204
ShowDurations Config::showDurations() const { return m_data.showDurations; }
202205
double Config::minDuration() const { return m_data.minDuration; }

third_party/Catch2/src/catch2/catch_config.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ namespace Catch {
124124
bool includeSuccessfulResults() const override;
125125
bool warnAboutMissingAssertions() const override;
126126
bool warnAboutUnmatchedTestSpecs() const override;
127+
bool warnAboutInfiniteGenerators() const override;
127128
bool zeroTestsCountAsSuccess() const override;
128129
ShowDurations showDurations() const override;
129130
double minDuration() const override;

third_party/Catch2/src/catch2/generators/catch_generators.hpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ namespace Detail {
6464
bool next() {
6565
return m_generator->countedNext();
6666
}
67+
68+
bool isFinite() const { return m_generator->isFinite(); }
6769
};
6870

6971

@@ -84,6 +86,8 @@ namespace Detail {
8486
bool next() override {
8587
return false;
8688
}
89+
90+
bool isFinite() const override { return true; }
8791
};
8892

8993
template<typename T>
@@ -112,6 +116,8 @@ namespace Detail {
112116
++m_idx;
113117
return m_idx < m_values.size();
114118
}
119+
120+
bool isFinite() const override { return true; }
115121
};
116122

117123
template <typename T, typename DecayedT = std::decay_t<T>>
@@ -176,6 +182,14 @@ namespace Detail {
176182
}
177183
return m_current < m_generators.size();
178184
}
185+
186+
bool isFinite() const override {
187+
for (auto const& gen : m_generators) {
188+
if (!gen.isFinite()) { return false;
189+
}
190+
}
191+
return true;
192+
}
179193
};
180194

181195

0 commit comments

Comments
 (0)