Progmasoft Git

catch3

Progmasoft Catch3: an independently maintained C++17 test framework with a parallel runner, property checks, snapshots and structured results.

Clonegit clone https://git.progmasoft.com/catch3

Allow generators to declare themselves (infinite)

This will be useful later to implement warning on infinitely
running `GENERATE` expressions.
Commit
d079ee13ab137547ab26bd1ed5ca2858d7fbd847
Author
Martin Hořeňovský ·
Parents
0056cd4efb01

Files · Download .tar.gz

Changes

 docs/deprecations.md                               |  15 +++
 docs/generators.md                                 |  11 ++
 examples/300-Gen-OwnGenerator.cpp                  |   2 +
 examples/301-Gen-MapTypeConversion.cpp             |   2 +
 src/catch2/generators/catch_generators.hpp         |  14 ++
 .../generators/catch_generators_adapters.hpp       |  20 +++
 src/catch2/generators/catch_generators_random.cpp  |   5 +
 src/catch2/generators/catch_generators_random.hpp  |   3 +
 src/catch2/generators/catch_generators_range.hpp   |   4 +
 .../catch_interfaces_generatortracker.cpp          |   2 +
 .../catch_interfaces_generatortracker.hpp          |   9 ++
 tests/SelfTest/Baselines/automake.sw.approved.txt  |   5 +
 .../Baselines/automake.sw.multi.approved.txt       |   5 +
 tests/SelfTest/Baselines/compact.sw.approved.txt   |  18 ++-
 .../Baselines/compact.sw.multi.approved.txt        |  18 ++-
 tests/SelfTest/Baselines/console.std.approved.txt  |   4 +-
 tests/SelfTest/Baselines/console.sw.approved.txt   | 131 +++++++++++++++++-
 .../Baselines/console.sw.multi.approved.txt        | 131 +++++++++++++++++-
 tests/SelfTest/Baselines/junit.sw.approved.txt     |  12 +-
 .../SelfTest/Baselines/junit.sw.multi.approved.txt |  12 +-
 tests/SelfTest/Baselines/sonarqube.sw.approved.txt |  10 ++
 .../Baselines/sonarqube.sw.multi.approved.txt      |  10 ++
 tests/SelfTest/Baselines/tap.sw.approved.txt       |  30 ++++-
 tests/SelfTest/Baselines/tap.sw.multi.approved.txt |  30 ++++-
 tests/SelfTest/Baselines/teamcity.sw.approved.txt  |  10 ++
 .../Baselines/teamcity.sw.multi.approved.txt       |  10 ++
 tests/SelfTest/Baselines/xml.sw.approved.txt       | 146 ++++++++++++++++++++-
 tests/SelfTest/Baselines/xml.sw.multi.approved.txt | 146 ++++++++++++++++++++-
 .../IntrospectiveTests/GeneratorsImpl.tests.cpp    |  69 ++++++++++
 tests/SelfTest/UsageTests/Generators.tests.cpp     |   1 +
 tests/SelfTest/UsageTests/Skip.tests.cpp           |   2 +
 31 files changed, 869 insertions(+), 18 deletions(-)

diff --git a/docs/deprecations.md b/docs/deprecations.md
index 20312cd5..b7efa862 100644
--- a/docs/deprecations.md
+++ b/docs/deprecations.md
@@ -48,6 +48,21 @@ If you are mutating the fixture instance from within the test case, and
 want to keep doing so in the future, mark the mutated members as `mutable`.
 
 
+### Generator interfaces
+
+#### Defaulted `UntypedGeneratorBase::isFinite()`
+
+> Deprecated in Catch2 vX.Y.Z
+
+The `UntypedGeneratorBase` currently provides a default implementation
+for `isFinite` that always returns `true`. This was done to keep backwards
+compatibility with pre-existing generators, as infinite generators can
+be diagnosed as errors in some cases.
+
+In the future, all generators will be expected to override `isFinite`.
+
+
+
 ---
 
 [Home](Readme.md#top)
diff --git a/docs/generators.md b/docs/generators.md
index f45eac06..5db2941b 100644
--- a/docs/generators.md
+++ b/docs/generators.md
@@ -276,11 +276,22 @@ struct IGenerator : GeneratorUntypedBase {
      * Going backwards is not supported.
      */
     virtual void skipToNthElementImpl( std::size_t n );
+
+    /**
+     * Returns true if calls to `next` will eventually return false
+     *
+     * Note that for backwards compatibility this is currently defaulted
+     * to return `true`, but in the future all generators will have to
+     * provide their own implementation.
+     */
+    virtual bool isFinite() const = 0;
 };
 ```
 
 > `skipToNthElementImpl` was added in Catch2 vX.Y.Z
 
+> `isFinite` was added in Catch2 vX.Y.Z
+
 However, to be able to use your custom generator inside `GENERATE`, it
 will need to be wrapped inside a `GeneratorWrapper<T>`.
 `GeneratorWrapper<T>` is a value wrapper around a
diff --git a/examples/300-Gen-OwnGenerator.cpp b/examples/300-Gen-OwnGenerator.cpp
index b7f9d5da..ff28ad73 100644
--- a/examples/300-Gen-OwnGenerator.cpp
+++ b/examples/300-Gen-OwnGenerator.cpp
@@ -40,6 +40,8 @@ public:
         return true;
     }
 
+    bool isFinite() const override { return false; }
+
     // Note: this improves the performance only a bit, but it is here
     //       to show how you can override the skip functionality.
     void skipToNthElementImpl( std::size_t n ) override {
diff --git a/examples/301-Gen-MapTypeConversion.cpp b/examples/301-Gen-MapTypeConversion.cpp
index 0a284483..26f7538c 100644
--- a/examples/301-Gen-MapTypeConversion.cpp
+++ b/examples/301-Gen-MapTypeConversion.cpp
@@ -40,6 +40,8 @@ public:
     bool next() override {
         return !!std::getline(m_stream, m_line);
     }
+
+    bool isFinite() const override { return true; }
 };
 
 std::string const& LineGenerator::get() const {
diff --git a/src/catch2/generators/catch_generators.hpp b/src/catch2/generators/catch_generators.hpp
index e64f9b5f..719775fb 100644
--- a/src/catch2/generators/catch_generators.hpp
+++ b/src/catch2/generators/catch_generators.hpp
@@ -64,6 +64,8 @@ namespace Detail {
         bool next() {
             return m_generator->countedNext();
         }
+
+        bool isFinite() const { return m_generator->isFinite(); }
     };
 
 
@@ -84,6 +86,8 @@ namespace Detail {
         bool next() override {
             return false;
         }
+
+        bool isFinite() const override { return true; }
     };
 
     template<typename T>
@@ -112,6 +116,8 @@ namespace Detail {
             ++m_idx;
             return m_idx < m_values.size();
         }
+
+        bool isFinite() const override { return true; }
     };
 
     template <typename T, typename DecayedT = std::decay_t<T>>
@@ -176,6 +182,14 @@ namespace Detail {
             }
             return m_current < m_generators.size();
         }
+
+        bool isFinite() const override {
+            for (auto const& gen : m_generators) {
+                if (!gen.isFinite()) { return false;
+                }
+            }
+            return true;
+        }
     };
 
 
diff --git a/src/catch2/generators/catch_generators_adapters.hpp b/src/catch2/generators/catch_generators_adapters.hpp
index 35c103ce..2f6d8ed3 100644
--- a/src/catch2/generators/catch_generators_adapters.hpp
+++ b/src/catch2/generators/catch_generators_adapters.hpp
@@ -62,6 +62,8 @@ namespace Generators {
             }
             return success;
         }
+
+        bool isFinite() const override { return true; }
     };
 
     template <typename T>
@@ -103,6 +105,8 @@ namespace Generators {
             while (!m_predicate(m_generator.get()) && (success = m_generator.next()) == true);
             return success;
         }
+
+        bool isFinite() const override { return m_generator.isFinite(); }
     };
 
 
@@ -127,6 +131,9 @@ namespace Generators {
             m_target_repeats(repeats)
         {
             assert(m_target_repeats > 0 && "Repeat generator must repeat at least once");
+            if (!m_generator.isFinite()) {
+                Detail::throw_generator_exception( "Cannot repeat infinite generator" );
+            }
         }
 
         T const& get() const override {
@@ -160,6 +167,8 @@ namespace Generators {
             }
             return m_current_repeat < m_target_repeats;
         }
+
+        bool isFinite() const override { return m_generator.isFinite(); }
     };
 
     template <typename T>
@@ -207,6 +216,8 @@ namespace Generators {
             }
             return success;
         }
+
+        bool isFinite() const override { return m_generator.isFinite(); }
     };
 
     template <typename Func, typename U, typename T = FunctionReturnType<Func, U>>
@@ -256,6 +267,8 @@ namespace Generators {
             }
             return true;
         }
+
+        bool isFinite() const override { return m_generator.isFinite(); }
     };
 
     template <typename T>
@@ -297,6 +310,13 @@ namespace Generators {
             ++m_current_generator;
             return m_current_generator < m_generators.size();
         }
+
+        bool isFinite() const override {
+            for ( auto const& gen : m_generators ) {
+                if ( !gen.isFinite() ) { return false; }
+            }
+            return true;
+        }
     };
 
     template <typename T, typename... Generators>
diff --git a/src/catch2/generators/catch_generators_random.cpp b/src/catch2/generators/catch_generators_random.cpp
index 00a8e634..d5163c16 100644
--- a/src/catch2/generators/catch_generators_random.cpp
+++ b/src/catch2/generators/catch_generators_random.cpp
@@ -37,5 +37,10 @@ namespace Catch {
             m_current_number = m_pimpl->dist( m_pimpl->rng );
             return true;
         }
+
+        bool RandomFloatingGenerator<long double>::isFinite() const {
+            return false;
+        }
+
     } // namespace Generators
 } // namespace Catch
diff --git a/src/catch2/generators/catch_generators_random.hpp b/src/catch2/generators/catch_generators_random.hpp
index 71283561..e0287360 100644
--- a/src/catch2/generators/catch_generators_random.hpp
+++ b/src/catch2/generators/catch_generators_random.hpp
@@ -42,6 +42,7 @@ public:
         m_current_number = m_dist(m_rng);
         return true;
     }
+    bool isFinite() const override { return false; }
 };
 
 template <>
@@ -59,6 +60,7 @@ public:
     bool next() override;
 
     ~RandomFloatingGenerator() override; // = default
+    bool isFinite() const override;
 };
 
 template <typename Integer>
@@ -80,6 +82,7 @@ public:
         m_current_number = m_dist(m_rng);
         return true;
     }
+    bool isFinite() const override { return false; }
 };
 
 template <typename T>
diff --git a/src/catch2/generators/catch_generators_range.hpp b/src/catch2/generators/catch_generators_range.hpp
index 55d673c2..62739b23 100644
--- a/src/catch2/generators/catch_generators_range.hpp
+++ b/src/catch2/generators/catch_generators_range.hpp
@@ -48,6 +48,8 @@ public:
         m_current += m_step;
         return (m_positive) ? (m_current < m_end) : (m_current > m_end);
     }
+
+    bool isFinite() const override { return true; }
 };
 
 template <typename T>
@@ -87,6 +89,8 @@ public:
         ++m_current;
         return m_current != m_elems.size();
     }
+
+    bool isFinite() const override { return true; }
 };
 
 template <typename InputIterator,
diff --git a/src/catch2/interfaces/catch_interfaces_generatortracker.cpp b/src/catch2/interfaces/catch_interfaces_generatortracker.cpp
index 4ac23ddb..8442be4e 100644
--- a/src/catch2/interfaces/catch_interfaces_generatortracker.cpp
+++ b/src/catch2/interfaces/catch_interfaces_generatortracker.cpp
@@ -55,5 +55,7 @@ namespace Catch {
             return m_stringReprCache;
         }
 
+        bool GeneratorUntypedBase::isFinite() const { return true; }
+
     } // namespace Generators
 } // namespace Catch
diff --git a/src/catch2/interfaces/catch_interfaces_generatortracker.hpp b/src/catch2/interfaces/catch_interfaces_generatortracker.hpp
index eb3871bc..12cb9d79 100644
--- a/src/catch2/interfaces/catch_interfaces_generatortracker.hpp
+++ b/src/catch2/interfaces/catch_interfaces_generatortracker.hpp
@@ -88,6 +88,15 @@ namespace Catch {
              * comes first.
              */
             StringRef currentElementAsString() const;
+
+            /**
+             * Returns true if calls to `next` will eventually return false
+             *
+             * Note that for backwards compatibility this is currently defaulted
+             * to return `true`, but in the future all generators will have to
+             * provide their own implementation.
+             */
+            virtual bool isFinite() const;
         };
         using GeneratorBasePtr = Catch::Detail::unique_ptr<GeneratorUntypedBase>;
 
diff --git a/tests/SelfTest/Baselines/automake.sw.approved.txt b/tests/SelfTest/Baselines/automake.sw.approved.txt
index 314feb2f..bc019b38 100644
--- a/tests/SelfTest/Baselines/automake.sw.approved.txt
+++ b/tests/SelfTest/Baselines/automake.sw.approved.txt
@@ -169,6 +169,7 @@ Nor would this
 :test-result: PASS Floating point matchers: double
 :test-result: PASS Floating point matchers: float
 :test-result: PASS GENERATE can combine literals and generators
+:test-result: PASS Generator adapters properly handle isFinite
 :test-result: PASS Generators -- adapters
 :test-result: PASS Generators -- simple
 :test-result: PASS Generators can be skipped forward
@@ -226,11 +227,15 @@ Nor would this
 :test-result: PASS Product with differing arities - std::tuple<int>
 :test-result: PASS Random seed generation accepts known methods
 :test-result: PASS Random seed generation reports unknown methods
+:test-result: PASS RandomGenerator reports itself as infinite - float
+:test-result: PASS RandomGenerator reports itself as infinite - int
+:test-result: PASS RandomGenerator reports itself as infinite - long double
 :test-result: PASS Range type with sentinel
 :test-result: FAIL Reconstruction should be based on stringification: #914
 :test-result: FAIL Regex string matcher
 :test-result: PASS Registering reporter with '::' in name fails
 :test-result: PASS Regression test #1
+:test-result: PASS RepeatGenerator refuses infinite generators
 :test-result: PASS Reporter's write listings to provided stream
 :test-result: PASS Reproducer for #2309 - a very long description past 80 chars (default console width) with a late colon : blablabla
 :test-result: PASS SUCCEED counts as a test pass
diff --git a/tests/SelfTest/Baselines/automake.sw.multi.approved.txt b/tests/SelfTest/Baselines/automake.sw.multi.approved.txt
index e646593d..3079c349 100644
--- a/tests/SelfTest/Baselines/automake.sw.multi.approved.txt
+++ b/tests/SelfTest/Baselines/automake.sw.multi.approved.txt
@@ -167,6 +167,7 @@
 :test-result: PASS Floating point matchers: double
 :test-result: PASS Floating point matchers: float
 :test-result: PASS GENERATE can combine literals and generators
+:test-result: PASS Generator adapters properly handle isFinite
 :test-result: PASS Generators -- adapters
 :test-result: PASS Generators -- simple
 :test-result: PASS Generators can be skipped forward
@@ -224,11 +225,15 @@
 :test-result: PASS Product with differing arities - std::tuple<int>
 :test-result: PASS Random seed generation accepts known methods
 :test-result: PASS Random seed generation reports unknown methods
+:test-result: PASS RandomGenerator reports itself as infinite - float
+:test-result: PASS RandomGenerator reports itself as infinite - int
+:test-result: PASS RandomGenerator reports itself as infinite - long double
 :test-result: PASS Range type with sentinel
 :test-result: FAIL Reconstruction should be based on stringification: #914
 :test-result: FAIL Regex string matcher
 :test-result: PASS Registering reporter with '::' in name fails
 :test-result: PASS Regression test #1
+:test-result: PASS RepeatGenerator refuses infinite generators
 :test-result: PASS Reporter's write listings to provided stream
 :test-result: PASS Reproducer for #2309 - a very long description past 80 chars (default console width) with a late colon : blablabla
 :test-result: PASS SUCCEED counts as a test pass
diff --git a/tests/SelfTest/Baselines/compact.sw.approved.txt b/tests/SelfTest/Baselines/compact.sw.approved.txt
index 94123b41..f4da808e 100644
--- a/tests/SelfTest/Baselines/compact.sw.approved.txt
+++ b/tests/SelfTest/Baselines/compact.sw.approved.txt
@@ -751,6 +751,16 @@ Generators.tests.cpp:<line number>: passed: i % 2 == 0 for: 0 == 0
 Generators.tests.cpp:<line number>: passed: i % 2 == 0 for: 0 == 0
 Generators.tests.cpp:<line number>: passed: i % 2 == 0 for: 0 == 0
 Generators.tests.cpp:<line number>: passed: i % 2 == 0 for: 0 == 0
+GeneratorsImpl.tests.cpp:<line number>: passed: finite_cat.isFinite() for: true
+GeneratorsImpl.tests.cpp:<line number>: passed: !(infinite_cat.isFinite()) for: !false
+GeneratorsImpl.tests.cpp:<line number>: passed: take_1.isFinite() for: true
+GeneratorsImpl.tests.cpp:<line number>: passed: take_2.isFinite() for: true
+GeneratorsImpl.tests.cpp:<line number>: passed: finite_chunk.isFinite() for: true
+GeneratorsImpl.tests.cpp:<line number>: passed: !(infinite_chunk.isFinite()) for: !false
+GeneratorsImpl.tests.cpp:<line number>: passed: finite_map.isFinite() for: true
+GeneratorsImpl.tests.cpp:<line number>: passed: !(infinite_map.isFinite()) for: !false
+GeneratorsImpl.tests.cpp:<line number>: passed: finite_filter.isFinite() for: true
+GeneratorsImpl.tests.cpp:<line number>: passed: !(infinite_filter.isFinite()) for: !false
 Generators.tests.cpp:<line number>: passed: i % 2 == 0 for: 0 == 0
 Generators.tests.cpp:<line number>: passed: i % 2 == 0 for: 0 == 0
 Generators.tests.cpp:<line number>: passed: i % 2 == 0 for: 0 == 0
@@ -1559,6 +1569,9 @@ RandomNumberGeneration.tests.cpp:<line number>: passed: Catch::generateRandomSee
 RandomNumberGeneration.tests.cpp:<line number>: passed: Catch::generateRandomSeed(method)
 RandomNumberGeneration.tests.cpp:<line number>: passed: Catch::generateRandomSeed(method)
 RandomNumberGeneration.tests.cpp:<line number>: passed: Catch::generateRandomSeed(static_cast<Catch::GenerateFrom>(77))
+GeneratorsImpl.tests.cpp:<line number>: passed: !(Catch::Generators::random( TestType{ 0 }, TestType{ 100 } ).isFinite()) for: !false
+GeneratorsImpl.tests.cpp:<line number>: passed: !(Catch::Generators::random( TestType{ 0 }, TestType{ 100 } ).isFinite()) for: !false
+GeneratorsImpl.tests.cpp:<line number>: passed: !(Catch::Generators::random( TestType{ 0 }, TestType{ 100 } ).isFinite()) for: !false
 ToString.tests.cpp:<line number>: passed: Catch::Detail::stringify(UsesSentinel{}) == "{  }" for: "{  }" == "{  }"
 Decomposition.tests.cpp:<line number>: failed: truthy(false) for: Hey, its truthy!
 Matchers.tests.cpp:<line number>: failed: testStringForMatching(), Matches( "this STRING contains 'abc' as a substring" ) for: "this string contains 'abc' as a substring" matches "this STRING contains 'abc' as a substring" case sensitively
@@ -1566,6 +1579,7 @@ Matchers.tests.cpp:<line number>: failed: testStringForMatching(), Matches( "con
 Matchers.tests.cpp:<line number>: failed: testStringForMatching(), Matches( "this string contains 'abc' as a" ) for: "this string contains 'abc' as a substring" matches "this string contains 'abc' as a" case sensitively
 Reporters.tests.cpp:<line number>: passed: registry.registerReporter( "with::doublecolons", Catch::Detail::make_unique<TestReporterFactory>() ), "'::' is not allowed in reporter name: 'with::doublecolons'" for: "'::' is not allowed in reporter name: 'with::doublecolons'" equals: "'::' is not allowed in reporter name: 'with::doublecolons'"
 Matchers.tests.cpp:<line number>: passed: actual, !UnorderedEquals( expected ) for: { 'a', 'b' } not UnorderedEquals: { 'c', 'b' }
+GeneratorsImpl.tests.cpp:<line number>: passed: RepeatGenerator<int>( 2, random( 1, 100 ) )
 Reporters.tests.cpp:<line number>: passed: !(factories.empty()) for: !false
 Reporters.tests.cpp:<line number>: passed: listingString, ContainsSubstring("fakeTag"s) for: "All available tags:
    1  [fakeTag]
@@ -2946,7 +2960,7 @@ InternalBenchmark.tests.cpp:<line number>: passed: med == 18. for: 18.0 == 18.0
 InternalBenchmark.tests.cpp:<line number>: passed: q3 == 23. for: 23.0 == 23.0
 Misc.tests.cpp:<line number>: passed:
 Misc.tests.cpp:<line number>: passed:
-test cases:  443 |  323 passed |  96 failed | 6 skipped | 18 failed as expected
-assertions: 2362 | 2161 passed | 158 failed | 43 failed as expected
+test cases:  448 |  328 passed |  96 failed | 6 skipped | 18 failed as expected
+assertions: 2376 | 2175 passed | 158 failed | 43 failed as expected
 
 
diff --git a/tests/SelfTest/Baselines/compact.sw.multi.approved.txt b/tests/SelfTest/Baselines/compact.sw.multi.approved.txt
index e44e771d..d6348ab0 100644
--- a/tests/SelfTest/Baselines/compact.sw.multi.approved.txt
+++ b/tests/SelfTest/Baselines/compact.sw.multi.approved.txt
@@ -749,6 +749,16 @@ Generators.tests.cpp:<line number>: passed: i % 2 == 0 for: 0 == 0
 Generators.tests.cpp:<line number>: passed: i % 2 == 0 for: 0 == 0
 Generators.tests.cpp:<line number>: passed: i % 2 == 0 for: 0 == 0
 Generators.tests.cpp:<line number>: passed: i % 2 == 0 for: 0 == 0
+GeneratorsImpl.tests.cpp:<line number>: passed: finite_cat.isFinite() for: true
+GeneratorsImpl.tests.cpp:<line number>: passed: !(infinite_cat.isFinite()) for: !false
+GeneratorsImpl.tests.cpp:<line number>: passed: take_1.isFinite() for: true
+GeneratorsImpl.tests.cpp:<line number>: passed: take_2.isFinite() for: true
+GeneratorsImpl.tests.cpp:<line number>: passed: finite_chunk.isFinite() for: true
+GeneratorsImpl.tests.cpp:<line number>: passed: !(infinite_chunk.isFinite()) for: !false
+GeneratorsImpl.tests.cpp:<line number>: passed: finite_map.isFinite() for: true
+GeneratorsImpl.tests.cpp:<line number>: passed: !(infinite_map.isFinite()) for: !false
+GeneratorsImpl.tests.cpp:<line number>: passed: finite_filter.isFinite() for: true
+GeneratorsImpl.tests.cpp:<line number>: passed: !(infinite_filter.isFinite()) for: !false
 Generators.tests.cpp:<line number>: passed: i % 2 == 0 for: 0 == 0
 Generators.tests.cpp:<line number>: passed: i % 2 == 0 for: 0 == 0
 Generators.tests.cpp:<line number>: passed: i % 2 == 0 for: 0 == 0
@@ -1557,6 +1567,9 @@ RandomNumberGeneration.tests.cpp:<line number>: passed: Catch::generateRandomSee
 RandomNumberGeneration.tests.cpp:<line number>: passed: Catch::generateRandomSeed(method)
 RandomNumberGeneration.tests.cpp:<line number>: passed: Catch::generateRandomSeed(method)
 RandomNumberGeneration.tests.cpp:<line number>: passed: Catch::generateRandomSeed(static_cast<Catch::GenerateFrom>(77))
+GeneratorsImpl.tests.cpp:<line number>: passed: !(Catch::Generators::random( TestType{ 0 }, TestType{ 100 } ).isFinite()) for: !false
+GeneratorsImpl.tests.cpp:<line number>: passed: !(Catch::Generators::random( TestType{ 0 }, TestType{ 100 } ).isFinite()) for: !false
+GeneratorsImpl.tests.cpp:<line number>: passed: !(Catch::Generators::random( TestType{ 0 }, TestType{ 100 } ).isFinite()) for: !false
 ToString.tests.cpp:<line number>: passed: Catch::Detail::stringify(UsesSentinel{}) == "{  }" for: "{  }" == "{  }"
 Decomposition.tests.cpp:<line number>: failed: truthy(false) for: Hey, its truthy!
 Matchers.tests.cpp:<line number>: failed: testStringForMatching(), Matches( "this STRING contains 'abc' as a substring" ) for: "this string contains 'abc' as a substring" matches "this STRING contains 'abc' as a substring" case sensitively
@@ -1564,6 +1577,7 @@ Matchers.tests.cpp:<line number>: failed: testStringForMatching(), Matches( "con
 Matchers.tests.cpp:<line number>: failed: testStringForMatching(), Matches( "this string contains 'abc' as a" ) for: "this string contains 'abc' as a substring" matches "this string contains 'abc' as a" case sensitively
 Reporters.tests.cpp:<line number>: passed: registry.registerReporter( "with::doublecolons", Catch::Detail::make_unique<TestReporterFactory>() ), "'::' is not allowed in reporter name: 'with::doublecolons'" for: "'::' is not allowed in reporter name: 'with::doublecolons'" equals: "'::' is not allowed in reporter name: 'with::doublecolons'"
 Matchers.tests.cpp:<line number>: passed: actual, !UnorderedEquals( expected ) for: { 'a', 'b' } not UnorderedEquals: { 'c', 'b' }
+GeneratorsImpl.tests.cpp:<line number>: passed: RepeatGenerator<int>( 2, random( 1, 100 ) )
 Reporters.tests.cpp:<line number>: passed: !(factories.empty()) for: !false
 Reporters.tests.cpp:<line number>: passed: listingString, ContainsSubstring("fakeTag"s) for: "All available tags:
    1  [fakeTag]
@@ -2935,7 +2949,7 @@ InternalBenchmark.tests.cpp:<line number>: passed: med == 18. for: 18.0 == 18.0
 InternalBenchmark.tests.cpp:<line number>: passed: q3 == 23. for: 23.0 == 23.0
 Misc.tests.cpp:<line number>: passed:
 Misc.tests.cpp:<line number>: passed:
-test cases:  443 |  323 passed |  96 failed | 6 skipped | 18 failed as expected
-assertions: 2362 | 2161 passed | 158 failed | 43 failed as expected
+test cases:  448 |  328 passed |  96 failed | 6 skipped | 18 failed as expected
+assertions: 2376 | 2175 passed | 158 failed | 43 failed as expected
 
 
diff --git a/tests/SelfTest/Baselines/console.std.approved.txt b/tests/SelfTest/Baselines/console.std.approved.txt
index 4529fef8..cd178a0c 100644
--- a/tests/SelfTest/Baselines/console.std.approved.txt
+++ b/tests/SelfTest/Baselines/console.std.approved.txt
@@ -1743,6 +1743,6 @@ due to unexpected exception with message:
   Why would you throw a std::string?
 
 ===============================================================================
-test cases:  443 |  341 passed |  76 failed | 7 skipped | 19 failed as expected
-assertions: 2340 | 2161 passed | 136 failed | 43 failed as expected
+test cases:  448 |  346 passed |  76 failed | 7 skipped | 19 failed as expected
+assertions: 2354 | 2175 passed | 136 failed | 43 failed as expected
 
diff --git a/tests/SelfTest/Baselines/console.sw.approved.txt b/tests/SelfTest/Baselines/console.sw.approved.txt
index 48a4c85f..f5166de0 100644
--- a/tests/SelfTest/Baselines/console.sw.approved.txt
+++ b/tests/SelfTest/Baselines/console.sw.approved.txt
@@ -5314,6 +5314,91 @@ Generators.tests.cpp:<line number>: PASSED:
 with expansion:
   0 == 0
 
+-------------------------------------------------------------------------------
+Generator adapters properly handle isFinite
+  concat generator
+-------------------------------------------------------------------------------
+GeneratorsImpl.tests.cpp:<line number>
+...............................................................................
+
+GeneratorsImpl.tests.cpp:<line number>: PASSED:
+  REQUIRE( finite_cat.isFinite() )
+with expansion:
+  true
+
+GeneratorsImpl.tests.cpp:<line number>: PASSED:
+  REQUIRE_FALSE( infinite_cat.isFinite() )
+with expansion:
+  !false
+
+-------------------------------------------------------------------------------
+Generator adapters properly handle isFinite
+  take generator
+-------------------------------------------------------------------------------
+GeneratorsImpl.tests.cpp:<line number>
+...............................................................................
+
+GeneratorsImpl.tests.cpp:<line number>: PASSED:
+  REQUIRE( take_1.isFinite() )
+with expansion:
+  true
+
+GeneratorsImpl.tests.cpp:<line number>: PASSED:
+  REQUIRE( take_2.isFinite() )
+with expansion:
+  true
+
+-------------------------------------------------------------------------------
+Generator adapters properly handle isFinite
+  chunk generator
+-------------------------------------------------------------------------------
+GeneratorsImpl.tests.cpp:<line number>
+...............................................................................
+
+GeneratorsImpl.tests.cpp:<line number>: PASSED:
+  REQUIRE( finite_chunk.isFinite() )
+with expansion:
+  true
+
+GeneratorsImpl.tests.cpp:<line number>: PASSED:
+  REQUIRE_FALSE( infinite_chunk.isFinite() )
+with expansion:
+  !false
+
+-------------------------------------------------------------------------------
+Generator adapters properly handle isFinite
+  map
+-------------------------------------------------------------------------------
+GeneratorsImpl.tests.cpp:<line number>
+...............................................................................
+
+GeneratorsImpl.tests.cpp:<line number>: PASSED:
+  REQUIRE( finite_map.isFinite() )
+with expansion:
+  true
+
+GeneratorsImpl.tests.cpp:<line number>: PASSED:
+  REQUIRE_FALSE( infinite_map.isFinite() )
+with expansion:
+  !false
+
+-------------------------------------------------------------------------------
+Generator adapters properly handle isFinite
+  filter
+-------------------------------------------------------------------------------
+GeneratorsImpl.tests.cpp:<line number>
+...............................................................................
+
+GeneratorsImpl.tests.cpp:<line number>: PASSED:
+  REQUIRE( finite_filter.isFinite() )
+with expansion:
+  true
+
+GeneratorsImpl.tests.cpp:<line number>: PASSED:
+  REQUIRE_FALSE( infinite_filter.isFinite() )
+with expansion:
+  !false
+
 -------------------------------------------------------------------------------
 Generators -- adapters
   Filtering by predicate
@@ -10367,6 +10452,39 @@ RandomNumberGeneration.tests.cpp:<line number>
 RandomNumberGeneration.tests.cpp:<line number>: PASSED:
   REQUIRE_THROWS( Catch::generateRandomSeed(static_cast<Catch::GenerateFrom>(77)) )
 
+-------------------------------------------------------------------------------
+RandomGenerator reports itself as infinite - float
+-------------------------------------------------------------------------------
+GeneratorsImpl.tests.cpp:<line number>
+...............................................................................
+
+GeneratorsImpl.tests.cpp:<line number>: PASSED:
+  REQUIRE_FALSE( Catch::Generators::random( TestType{ 0 }, TestType{ 100 } ).isFinite() )
+with expansion:
+  !false
+
+-------------------------------------------------------------------------------
+RandomGenerator reports itself as infinite - int
+-------------------------------------------------------------------------------
+GeneratorsImpl.tests.cpp:<line number>
+...............................................................................
+
+GeneratorsImpl.tests.cpp:<line number>: PASSED:
+  REQUIRE_FALSE( Catch::Generators::random( TestType{ 0 }, TestType{ 100 } ).isFinite() )
+with expansion:
+  !false
+
+-------------------------------------------------------------------------------
+RandomGenerator reports itself as infinite - long double
+-------------------------------------------------------------------------------
+GeneratorsImpl.tests.cpp:<line number>
+...............................................................................
+
+GeneratorsImpl.tests.cpp:<line number>: PASSED:
+  REQUIRE_FALSE( Catch::Generators::random( TestType{ 0 }, TestType{ 100 } ).isFinite() )
+with expansion:
+  !false
+
 -------------------------------------------------------------------------------
 Range type with sentinel
 -------------------------------------------------------------------------------
@@ -10436,6 +10554,15 @@ Matchers.tests.cpp:<line number>: PASSED:
 with expansion:
   { 'a', 'b' } not UnorderedEquals: { 'c', 'b' }
 
+-------------------------------------------------------------------------------
+RepeatGenerator refuses infinite generators
+-------------------------------------------------------------------------------
+GeneratorsImpl.tests.cpp:<line number>
+...............................................................................
+
+GeneratorsImpl.tests.cpp:<line number>: PASSED:
+  REQUIRE_THROWS( RepeatGenerator<int>( 2, random( 1, 100 ) ) )
+
 -------------------------------------------------------------------------------
 Reporter's write listings to provided stream
 -------------------------------------------------------------------------------
@@ -19717,6 +19844,6 @@ Misc.tests.cpp:<line number>
 Misc.tests.cpp:<line number>: PASSED:
 
 ===============================================================================
-test cases:  443 |  323 passed |  96 failed | 6 skipped | 18 failed as expected
-assertions: 2362 | 2161 passed | 158 failed | 43 failed as expected
+test cases:  448 |  328 passed |  96 failed | 6 skipped | 18 failed as expected
+assertions: 2376 | 2175 passed | 158 failed | 43 failed as expected
 
diff --git a/tests/SelfTest/Baselines/console.sw.multi.approved.txt b/tests/SelfTest/Baselines/console.sw.multi.approved.txt
index 7845ed07..bfb0f4bb 100644
--- a/tests/SelfTest/Baselines/console.sw.multi.approved.txt
+++ b/tests/SelfTest/Baselines/console.sw.multi.approved.txt
@@ -5312,6 +5312,91 @@ Generators.tests.cpp:<line number>: PASSED:
 with expansion:
   0 == 0
 
+-------------------------------------------------------------------------------
+Generator adapters properly handle isFinite
+  concat generator
+-------------------------------------------------------------------------------
+GeneratorsImpl.tests.cpp:<line number>
+...............................................................................
+
+GeneratorsImpl.tests.cpp:<line number>: PASSED:
+  REQUIRE( finite_cat.isFinite() )
+with expansion:
+  true
+
+GeneratorsImpl.tests.cpp:<line number>: PASSED:
+  REQUIRE_FALSE( infinite_cat.isFinite() )
+with expansion:
+  !false
+
+-------------------------------------------------------------------------------
+Generator adapters properly handle isFinite
+  take generator
+-------------------------------------------------------------------------------
+GeneratorsImpl.tests.cpp:<line number>
+...............................................................................
+
+GeneratorsImpl.tests.cpp:<line number>: PASSED:
+  REQUIRE( take_1.isFinite() )
+with expansion:
+  true
+
+GeneratorsImpl.tests.cpp:<line number>: PASSED:
+  REQUIRE( take_2.isFinite() )
+with expansion:
+  true
+
+-------------------------------------------------------------------------------
+Generator adapters properly handle isFinite
+  chunk generator
+-------------------------------------------------------------------------------
+GeneratorsImpl.tests.cpp:<line number>
+...............................................................................
+
+GeneratorsImpl.tests.cpp:<line number>: PASSED:
+  REQUIRE( finite_chunk.isFinite() )
+with expansion:
+  true
+
+GeneratorsImpl.tests.cpp:<line number>: PASSED:
+  REQUIRE_FALSE( infinite_chunk.isFinite() )
+with expansion:
+  !false
+
+-------------------------------------------------------------------------------
+Generator adapters properly handle isFinite
+  map
+-------------------------------------------------------------------------------
+GeneratorsImpl.tests.cpp:<line number>
+...............................................................................
+
+GeneratorsImpl.tests.cpp:<line number>: PASSED:
+  REQUIRE( finite_map.isFinite() )
+with expansion:
+  true
+
+GeneratorsImpl.tests.cpp:<line number>: PASSED:
+  REQUIRE_FALSE( infinite_map.isFinite() )
+with expansion:
+  !false
+
+-------------------------------------------------------------------------------
+Generator adapters properly handle isFinite
+  filter
+-------------------------------------------------------------------------------
+GeneratorsImpl.tests.cpp:<line number>
+...............................................................................
+
+GeneratorsImpl.tests.cpp:<line number>: PASSED:
+  REQUIRE( finite_filter.isFinite() )
+with expansion:
+  true
+
+GeneratorsImpl.tests.cpp:<line number>: PASSED:
+  REQUIRE_FALSE( infinite_filter.isFinite() )
+with expansion:
+  !false
+
 -------------------------------------------------------------------------------
 Generators -- adapters
   Filtering by predicate
@@ -10365,6 +10450,39 @@ RandomNumberGeneration.tests.cpp:<line number>
 RandomNumberGeneration.tests.cpp:<line number>: PASSED:
   REQUIRE_THROWS( Catch::generateRandomSeed(static_cast<Catch::GenerateFrom>(77)) )
 
+-------------------------------------------------------------------------------
+RandomGenerator reports itself as infinite - float
+-------------------------------------------------------------------------------
+GeneratorsImpl.tests.cpp:<line number>
+...............................................................................
+
+GeneratorsImpl.tests.cpp:<line number>: PASSED:
+  REQUIRE_FALSE( Catch::Generators::random( TestType{ 0 }, TestType{ 100 } ).isFinite() )
+with expansion:
+  !false
+
+-------------------------------------------------------------------------------
+RandomGenerator reports itself as infinite - int
+-------------------------------------------------------------------------------
+GeneratorsImpl.tests.cpp:<line number>
+...............................................................................
+
+GeneratorsImpl.tests.cpp:<line number>: PASSED:
+  REQUIRE_FALSE( Catch::Generators::random( TestType{ 0 }, TestType{ 100 } ).isFinite() )
+with expansion:
+  !false
+
+-------------------------------------------------------------------------------
+RandomGenerator reports itself as infinite - long double
+-------------------------------------------------------------------------------
+GeneratorsImpl.tests.cpp:<line number>
+...............................................................................
+
+GeneratorsImpl.tests.cpp:<line number>: PASSED:
+  REQUIRE_FALSE( Catch::Generators::random( TestType{ 0 }, TestType{ 100 } ).isFinite() )
+with expansion:
+  !false
+
 -------------------------------------------------------------------------------
 Range type with sentinel
 -------------------------------------------------------------------------------
@@ -10434,6 +10552,15 @@ Matchers.tests.cpp:<line number>: PASSED:
 with expansion:
   { 'a', 'b' } not UnorderedEquals: { 'c', 'b' }
 
+-------------------------------------------------------------------------------
+RepeatGenerator refuses infinite generators
+-------------------------------------------------------------------------------
+GeneratorsImpl.tests.cpp:<line number>
+...............................................................................
+
+GeneratorsImpl.tests.cpp:<line number>: PASSED:
+  REQUIRE_THROWS( RepeatGenerator<int>( 2, random( 1, 100 ) ) )
+
 -------------------------------------------------------------------------------
 Reporter's write listings to provided stream
 -------------------------------------------------------------------------------
@@ -19706,6 +19833,6 @@ Misc.tests.cpp:<line number>
 Misc.tests.cpp:<line number>: PASSED:
 
 ===============================================================================
-test cases:  443 |  323 passed |  96 failed | 6 skipped | 18 failed as expected
-assertions: 2362 | 2161 passed | 158 failed | 43 failed as expected
+test cases:  448 |  328 passed |  96 failed | 6 skipped | 18 failed as expected
+assertions: 2376 | 2175 passed | 158 failed | 43 failed as expected
 
diff --git a/tests/SelfTest/Baselines/junit.sw.approved.txt b/tests/SelfTest/Baselines/junit.sw.approved.txt
index 9f13c847..e3010c82 100644
--- a/tests/SelfTest/Baselines/junit.sw.approved.txt
+++ b/tests/SelfTest/Baselines/junit.sw.approved.txt
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <testsuitesloose text artifact
 >
-  <testsuite name="<exe-name>" errors="17" failures="141" skipped="12" tests="2374" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}">
+  <testsuite name="<exe-name>" errors="17" failures="141" skipped="12" tests="2388" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}">
     <properties>
       <property name="random-seed" value="1"/>
       <property name="filters" value="&quot;*&quot; ~[!nonportable] ~[!benchmark] ~[approvals]"/>
@@ -832,6 +832,12 @@ at Message.tests.cpp:<line number>
     <testcase classname="<exe-name>.global" name="Floating point matchers: float/Constructor validation" time="{duration}" status="run"/>
     <testcase classname="<exe-name>.global" name="Floating point matchers: float/IsNaN" time="{duration}" status="run"/>
     <testcase classname="<exe-name>.global" name="GENERATE can combine literals and generators" time="{duration}" status="run"/>
+    <testcase classname="<exe-name>.global" name="Generator adapters properly handle isFinite" time="{duration}" status="run"/>
+    <testcase classname="<exe-name>.global" name="Generator adapters properly handle isFinite/concat generator" time="{duration}" status="run"/>
+    <testcase classname="<exe-name>.global" name="Generator adapters properly handle isFinite/take generator" time="{duration}" status="run"/>
+    <testcase classname="<exe-name>.global" name="Generator adapters properly handle isFinite/chunk generator" time="{duration}" status="run"/>
+    <testcase classname="<exe-name>.global" name="Generator adapters properly handle isFinite/map" time="{duration}" status="run"/>
+    <testcase classname="<exe-name>.global" name="Generator adapters properly handle isFinite/filter" time="{duration}" status="run"/>
     <testcase classname="<exe-name>.global" name="Generators -- adapters" time="{duration}" status="run"/>
     <testcase classname="<exe-name>.global" name="Generators -- adapters/Filtering by predicate" time="{duration}" status="run"/>
     <testcase classname="<exe-name>.global" name="Generators -- adapters/Filtering by predicate/Basic usage" time="{duration}" status="run"/>
@@ -1342,6 +1348,9 @@ at Message.tests.cpp:<line number>
     <testcase classname="<exe-name>.global" name="Product with differing arities - std::tuple&lt;int>" time="{duration}" status="run"/>
     <testcase classname="<exe-name>.global" name="Random seed generation accepts known methods" time="{duration}" status="run"/>
     <testcase classname="<exe-name>.global" name="Random seed generation reports unknown methods" time="{duration}" status="run"/>
+    <testcase classname="<exe-name>.global" name="RandomGenerator reports itself as infinite - float" time="{duration}" status="run"/>
+    <testcase classname="<exe-name>.global" name="RandomGenerator reports itself as infinite - int" time="{duration}" status="run"/>
+    <testcase classname="<exe-name>.global" name="RandomGenerator reports itself as infinite - long double" time="{duration}" status="run"/>
     <testcase classname="<exe-name>.global" name="Range type with sentinel" time="{duration}" status="run"/>
     <testcase classname="<exe-name>.global" name="Reconstruction should be based on stringification: #914" time="{duration}" status="run">
       <failure message="truthy(false)" type="CHECK">
@@ -1380,6 +1389,7 @@ at Matchers.tests.cpp:<line number>
     </testcase>
     <testcase classname="<exe-name>.global" name="Registering reporter with '::' in name fails" time="{duration}" status="run"/>
     <testcase classname="<exe-name>.global" name="Regression test #1" time="{duration}" status="run"/>
+    <testcase classname="<exe-name>.global" name="RepeatGenerator refuses infinite generators" time="{duration}" status="run"/>
     <testcase classname="<exe-name>.global" name="Reporter's write listings to provided stream" time="{duration}" status="run"/>
     <testcase classname="<exe-name>.global" name="Reporter's write listings to provided stream/Automake reporter lists tags" time="{duration}" status="run"/>
     <testcase classname="<exe-name>.global" name="Reporter's write listings to provided stream/Automake reporter lists reporters" time="{duration}" status="run"/>
diff --git a/tests/SelfTest/Baselines/junit.sw.multi.approved.txt b/tests/SelfTest/Baselines/junit.sw.multi.approved.txt
index ec33f1ba..cc2c9946 100644
--- a/tests/SelfTest/Baselines/junit.sw.multi.approved.txt
+++ b/tests/SelfTest/Baselines/junit.sw.multi.approved.txt
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <testsuites>
-  <testsuite name="<exe-name>" errors="17" failures="141" skipped="12" tests="2374" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}">
+  <testsuite name="<exe-name>" errors="17" failures="141" skipped="12" tests="2388" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}">
     <properties>
       <property name="random-seed" value="1"/>
       <property name="filters" value="&quot;*&quot; ~[!nonportable] ~[!benchmark] ~[approvals]"/>
@@ -831,6 +831,12 @@ at Message.tests.cpp:<line number>
     <testcase classname="<exe-name>.global" name="Floating point matchers: float/Constructor validation" time="{duration}" status="run"/>
     <testcase classname="<exe-name>.global" name="Floating point matchers: float/IsNaN" time="{duration}" status="run"/>
     <testcase classname="<exe-name>.global" name="GENERATE can combine literals and generators" time="{duration}" status="run"/>
+    <testcase classname="<exe-name>.global" name="Generator adapters properly handle isFinite" time="{duration}" status="run"/>
+    <testcase classname="<exe-name>.global" name="Generator adapters properly handle isFinite/concat generator" time="{duration}" status="run"/>
+    <testcase classname="<exe-name>.global" name="Generator adapters properly handle isFinite/take generator" time="{duration}" status="run"/>
+    <testcase classname="<exe-name>.global" name="Generator adapters properly handle isFinite/chunk generator" time="{duration}" status="run"/>
+    <testcase classname="<exe-name>.global" name="Generator adapters properly handle isFinite/map" time="{duration}" status="run"/>
+    <testcase classname="<exe-name>.global" name="Generator adapters properly handle isFinite/filter" time="{duration}" status="run"/>
     <testcase classname="<exe-name>.global" name="Generators -- adapters" time="{duration}" status="run"/>
     <testcase classname="<exe-name>.global" name="Generators -- adapters/Filtering by predicate" time="{duration}" status="run"/>
     <testcase classname="<exe-name>.global" name="Generators -- adapters/Filtering by predicate/Basic usage" time="{duration}" status="run"/>
@@ -1341,6 +1347,9 @@ at Message.tests.cpp:<line number>
     <testcase classname="<exe-name>.global" name="Product with differing arities - std::tuple&lt;int>" time="{duration}" status="run"/>
     <testcase classname="<exe-name>.global" name="Random seed generation accepts known methods" time="{duration}" status="run"/>
     <testcase classname="<exe-name>.global" name="Random seed generation reports unknown methods" time="{duration}" status="run"/>
+    <testcase classname="<exe-name>.global" name="RandomGenerator reports itself as infinite - float" time="{duration}" status="run"/>
+    <testcase classname="<exe-name>.global" name="RandomGenerator reports itself as infinite - int" time="{duration}" status="run"/>
+    <testcase classname="<exe-name>.global" name="RandomGenerator reports itself as infinite - long double" time="{duration}" status="run"/>
     <testcase classname="<exe-name>.global" name="Range type with sentinel" time="{duration}" status="run"/>
     <testcase classname="<exe-name>.global" name="Reconstruction should be based on stringification: #914" time="{duration}" status="run">
       <failure message="truthy(false)" type="CHECK">
@@ -1379,6 +1388,7 @@ at Matchers.tests.cpp:<line number>
     </testcase>
     <testcase classname="<exe-name>.global" name="Registering reporter with '::' in name fails" time="{duration}" status="run"/>
     <testcase classname="<exe-name>.global" name="Regression test #1" time="{duration}" status="run"/>
+    <testcase classname="<exe-name>.global" name="RepeatGenerator refuses infinite generators" time="{duration}" status="run"/>
     <testcase classname="<exe-name>.global" name="Reporter's write listings to provided stream" time="{duration}" status="run"/>
     <testcase classname="<exe-name>.global" name="Reporter's write listings to provided stream/Automake reporter lists tags" time="{duration}" status="run"/>
     <testcase classname="<exe-name>.global" name="Reporter's write listings to provided stream/Automake reporter lists reporters" time="{duration}" status="run"/>
diff --git a/tests/SelfTest/Baselines/sonarqube.sw.approved.txt b/tests/SelfTest/Baselines/sonarqube.sw.approved.txt
index 1d36a1ff..f790e0eb 100644
--- a/tests/SelfTest/Baselines/sonarqube.sw.approved.txt
+++ b/tests/SelfTest/Baselines/sonarqube.sw.approved.txt
@@ -150,6 +150,12 @@ at AssertionHandler.tests.cpp:<line number>
     <testCase name="ConcatGenerator/Iterating over multiple generators" duration="{duration}"/>
     <testCase name="Filter generator throws exception for empty generator" duration="{duration}"/>
     <testCase name="FixedValuesGenerator can be skipped forward" duration="{duration}"/>
+    <testCase name="Generator adapters properly handle isFinite" duration="{duration}"/>
+    <testCase name="Generator adapters properly handle isFinite/concat generator" duration="{duration}"/>
+    <testCase name="Generator adapters properly handle isFinite/take generator" duration="{duration}"/>
+    <testCase name="Generator adapters properly handle isFinite/chunk generator" duration="{duration}"/>
+    <testCase name="Generator adapters properly handle isFinite/map" duration="{duration}"/>
+    <testCase name="Generator adapters properly handle isFinite/filter" duration="{duration}"/>
     <testCase name="Generators can be skipped forward" duration="{duration}"/>
     <testCase name="Generators internals" duration="{duration}"/>
     <testCase name="Generators internals/Single value" duration="{duration}"/>
@@ -189,6 +195,10 @@ at AssertionHandler.tests.cpp:<line number>
     <testCase name="Generators internals/Range/Negative manual step/Integer/Slightly over end" duration="{duration}"/>
     <testCase name="Generators internals/Range/Negative manual step/Integer/Slightly under end" duration="{duration}"/>
     <testCase name="MapGenerator can be skipped forward efficiently" duration="{duration}"/>
+    <testCase name="RandomGenerator reports itself as infinite - float" duration="{duration}"/>
+    <testCase name="RandomGenerator reports itself as infinite - int" duration="{duration}"/>
+    <testCase name="RandomGenerator reports itself as infinite - long double" duration="{duration}"/>
+    <testCase name="RepeatGenerator refuses infinite generators" duration="{duration}"/>
     <testCase name="TakeGenerator can be skipped forward" duration="{duration}"/>
     <testCase name="TakeGenerator can be skipped forward/take is shorter than underlying" duration="{duration}"/>
     <testCase name="TakeGenerator can be skipped forward/take is longer than underlying" duration="{duration}"/>
diff --git a/tests/SelfTest/Baselines/sonarqube.sw.multi.approved.txt b/tests/SelfTest/Baselines/sonarqube.sw.multi.approved.txt
index 9de7e03f..405cd887 100644
--- a/tests/SelfTest/Baselines/sonarqube.sw.multi.approved.txt
+++ b/tests/SelfTest/Baselines/sonarqube.sw.multi.approved.txt
@@ -149,6 +149,12 @@ at AssertionHandler.tests.cpp:<line number>
     <testCase name="ConcatGenerator/Iterating over multiple generators" duration="{duration}"/>
     <testCase name="Filter generator throws exception for empty generator" duration="{duration}"/>
     <testCase name="FixedValuesGenerator can be skipped forward" duration="{duration}"/>
+    <testCase name="Generator adapters properly handle isFinite" duration="{duration}"/>
+    <testCase name="Generator adapters properly handle isFinite/concat generator" duration="{duration}"/>
+    <testCase name="Generator adapters properly handle isFinite/take generator" duration="{duration}"/>
+    <testCase name="Generator adapters properly handle isFinite/chunk generator" duration="{duration}"/>
+    <testCase name="Generator adapters properly handle isFinite/map" duration="{duration}"/>
+    <testCase name="Generator adapters properly handle isFinite/filter" duration="{duration}"/>
     <testCase name="Generators can be skipped forward" duration="{duration}"/>
     <testCase name="Generators internals" duration="{duration}"/>
     <testCase name="Generators internals/Single value" duration="{duration}"/>
@@ -188,6 +194,10 @@ at AssertionHandler.tests.cpp:<line number>
     <testCase name="Generators internals/Range/Negative manual step/Integer/Slightly over end" duration="{duration}"/>
     <testCase name="Generators internals/Range/Negative manual step/Integer/Slightly under end" duration="{duration}"/>
     <testCase name="MapGenerator can be skipped forward efficiently" duration="{duration}"/>
+    <testCase name="RandomGenerator reports itself as infinite - float" duration="{duration}"/>
+    <testCase name="RandomGenerator reports itself as infinite - int" duration="{duration}"/>
+    <testCase name="RandomGenerator reports itself as infinite - long double" duration="{duration}"/>
+    <testCase name="RepeatGenerator refuses infinite generators" duration="{duration}"/>
     <testCase name="TakeGenerator can be skipped forward" duration="{duration}"/>
     <testCase name="TakeGenerator can be skipped forward/take is shorter than underlying" duration="{duration}"/>
     <testCase name="TakeGenerator can be skipped forward/take is longer than underlying" duration="{duration}"/>
diff --git a/tests/SelfTest/Baselines/tap.sw.approved.txt b/tests/SelfTest/Baselines/tap.sw.approved.txt
index 5261a4ac..0c303618 100644
--- a/tests/SelfTest/Baselines/tap.sw.approved.txt
+++ b/tests/SelfTest/Baselines/tap.sw.approved.txt
@@ -1358,6 +1358,26 @@ ok {test-number} - i % 2 == 0 for: 0 == 0
 ok {test-number} - i % 2 == 0 for: 0 == 0
 # GENERATE can combine literals and generators
 ok {test-number} - i % 2 == 0 for: 0 == 0
+# Generator adapters properly handle isFinite
+ok {test-number} - finite_cat.isFinite() for: true
+# Generator adapters properly handle isFinite
+ok {test-number} - !(infinite_cat.isFinite()) for: !false
+# Generator adapters properly handle isFinite
+ok {test-number} - take_1.isFinite() for: true
+# Generator adapters properly handle isFinite
+ok {test-number} - take_2.isFinite() for: true
+# Generator adapters properly handle isFinite
+ok {test-number} - finite_chunk.isFinite() for: true
+# Generator adapters properly handle isFinite
+ok {test-number} - !(infinite_chunk.isFinite()) for: !false
+# Generator adapters properly handle isFinite
+ok {test-number} - finite_map.isFinite() for: true
+# Generator adapters properly handle isFinite
+ok {test-number} - !(infinite_map.isFinite()) for: !false
+# Generator adapters properly handle isFinite
+ok {test-number} - finite_filter.isFinite() for: true
+# Generator adapters properly handle isFinite
+ok {test-number} - !(infinite_filter.isFinite()) for: !false
 # Generators -- adapters
 ok {test-number} - i % 2 == 0 for: 0 == 0
 # Generators -- adapters
@@ -2592,6 +2612,12 @@ ok {test-number} - Catch::generateRandomSeed(method)
 ok {test-number} - Catch::generateRandomSeed(method)
 # Random seed generation reports unknown methods
 ok {test-number} - Catch::generateRandomSeed(static_cast<Catch::GenerateFrom>(77))
+# RandomGenerator reports itself as infinite - float
+ok {test-number} - !(Catch::Generators::random( TestType{ 0 }, TestType{ 100 } ).isFinite()) for: !false
+# RandomGenerator reports itself as infinite - int
+ok {test-number} - !(Catch::Generators::random( TestType{ 0 }, TestType{ 100 } ).isFinite()) for: !false
+# RandomGenerator reports itself as infinite - long double
+ok {test-number} - !(Catch::Generators::random( TestType{ 0 }, TestType{ 100 } ).isFinite()) for: !false
 # Range type with sentinel
 ok {test-number} - Catch::Detail::stringify(UsesSentinel{}) == "{  }" for: "{  }" == "{  }"
 # Reconstruction should be based on stringification: #914
@@ -2606,6 +2632,8 @@ not ok {test-number} - testStringForMatching(), Matches( "this string contains '
 ok {test-number} - registry.registerReporter( "with::doublecolons", Catch::Detail::make_unique<TestReporterFactory>() ), "'::' is not allowed in reporter name: 'with::doublecolons'" for: "'::' is not allowed in reporter name: 'with::doublecolons'" equals: "'::' is not allowed in reporter name: 'with::doublecolons'"
 # Regression test #1
 ok {test-number} - actual, !UnorderedEquals( expected ) for: { 'a', 'b' } not UnorderedEquals: { 'c', 'b' }
+# RepeatGenerator refuses infinite generators
+ok {test-number} - RepeatGenerator<int>( 2, random( 1, 100 ) )
 # Reporter's write listings to provided stream
 ok {test-number} - !(factories.empty()) for: !false
 # Reporter's write listings to provided stream
@@ -4743,5 +4771,5 @@ ok {test-number} - q3 == 23. for: 23.0 == 23.0
 ok {test-number} -
 # xmlentitycheck
 ok {test-number} -
-1..2374
+1..2388
 
diff --git a/tests/SelfTest/Baselines/tap.sw.multi.approved.txt b/tests/SelfTest/Baselines/tap.sw.multi.approved.txt
index eeafbc01..611983af 100644
--- a/tests/SelfTest/Baselines/tap.sw.multi.approved.txt
+++ b/tests/SelfTest/Baselines/tap.sw.multi.approved.txt
@@ -1356,6 +1356,26 @@ ok {test-number} - i % 2 == 0 for: 0 == 0
 ok {test-number} - i % 2 == 0 for: 0 == 0
 # GENERATE can combine literals and generators
 ok {test-number} - i % 2 == 0 for: 0 == 0
+# Generator adapters properly handle isFinite
+ok {test-number} - finite_cat.isFinite() for: true
+# Generator adapters properly handle isFinite
+ok {test-number} - !(infinite_cat.isFinite()) for: !false
+# Generator adapters properly handle isFinite
+ok {test-number} - take_1.isFinite() for: true
+# Generator adapters properly handle isFinite
+ok {test-number} - take_2.isFinite() for: true
+# Generator adapters properly handle isFinite
+ok {test-number} - finite_chunk.isFinite() for: true
+# Generator adapters properly handle isFinite
+ok {test-number} - !(infinite_chunk.isFinite()) for: !false
+# Generator adapters properly handle isFinite
+ok {test-number} - finite_map.isFinite() for: true
+# Generator adapters properly handle isFinite
+ok {test-number} - !(infinite_map.isFinite()) for: !false
+# Generator adapters properly handle isFinite
+ok {test-number} - finite_filter.isFinite() for: true
+# Generator adapters properly handle isFinite
+ok {test-number} - !(infinite_filter.isFinite()) for: !false
 # Generators -- adapters
 ok {test-number} - i % 2 == 0 for: 0 == 0
 # Generators -- adapters
@@ -2590,6 +2610,12 @@ ok {test-number} - Catch::generateRandomSeed(method)
 ok {test-number} - Catch::generateRandomSeed(method)
 # Random seed generation reports unknown methods
 ok {test-number} - Catch::generateRandomSeed(static_cast<Catch::GenerateFrom>(77))
+# RandomGenerator reports itself as infinite - float
+ok {test-number} - !(Catch::Generators::random( TestType{ 0 }, TestType{ 100 } ).isFinite()) for: !false
+# RandomGenerator reports itself as infinite - int
+ok {test-number} - !(Catch::Generators::random( TestType{ 0 }, TestType{ 100 } ).isFinite()) for: !false
+# RandomGenerator reports itself as infinite - long double
+ok {test-number} - !(Catch::Generators::random( TestType{ 0 }, TestType{ 100 } ).isFinite()) for: !false
 # Range type with sentinel
 ok {test-number} - Catch::Detail::stringify(UsesSentinel{}) == "{  }" for: "{  }" == "{  }"
 # Reconstruction should be based on stringification: #914
@@ -2604,6 +2630,8 @@ not ok {test-number} - testStringForMatching(), Matches( "this string contains '
 ok {test-number} - registry.registerReporter( "with::doublecolons", Catch::Detail::make_unique<TestReporterFactory>() ), "'::' is not allowed in reporter name: 'with::doublecolons'" for: "'::' is not allowed in reporter name: 'with::doublecolons'" equals: "'::' is not allowed in reporter name: 'with::doublecolons'"
 # Regression test #1
 ok {test-number} - actual, !UnorderedEquals( expected ) for: { 'a', 'b' } not UnorderedEquals: { 'c', 'b' }
+# RepeatGenerator refuses infinite generators
+ok {test-number} - RepeatGenerator<int>( 2, random( 1, 100 ) )
 # Reporter's write listings to provided stream
 ok {test-number} - !(factories.empty()) for: !false
 # Reporter's write listings to provided stream
@@ -4732,5 +4760,5 @@ ok {test-number} - q3 == 23. for: 23.0 == 23.0
 ok {test-number} -
 # xmlentitycheck
 ok {test-number} -
-1..2374
+1..2388
 
diff --git a/tests/SelfTest/Baselines/teamcity.sw.approved.txt b/tests/SelfTest/Baselines/teamcity.sw.approved.txt
index b7be8d11..e7859ebd 100644
--- a/tests/SelfTest/Baselines/teamcity.sw.approved.txt
+++ b/tests/SelfTest/Baselines/teamcity.sw.approved.txt
@@ -417,6 +417,8 @@
 ##teamcity[testFinished name='Floating point matchers: float' duration="{duration}"]
 ##teamcity[testStarted name='GENERATE can combine literals and generators']
 ##teamcity[testFinished name='GENERATE can combine literals and generators' duration="{duration}"]
+##teamcity[testStarted name='Generator adapters properly handle isFinite']
+##teamcity[testFinished name='Generator adapters properly handle isFinite' duration="{duration}"]
 ##teamcity[testStarted name='Generators -- adapters']
 ##teamcity[testFinished name='Generators -- adapters' duration="{duration}"]
 ##teamcity[testStarted name='Generators -- simple']
@@ -571,6 +573,12 @@
 ##teamcity[testFinished name='Random seed generation accepts known methods' duration="{duration}"]
 ##teamcity[testStarted name='Random seed generation reports unknown methods']
 ##teamcity[testFinished name='Random seed generation reports unknown methods' duration="{duration}"]
+##teamcity[testStarted name='RandomGenerator reports itself as infinite - float']
+##teamcity[testFinished name='RandomGenerator reports itself as infinite - float' duration="{duration}"]
+##teamcity[testStarted name='RandomGenerator reports itself as infinite - int']
+##teamcity[testFinished name='RandomGenerator reports itself as infinite - int' duration="{duration}"]
+##teamcity[testStarted name='RandomGenerator reports itself as infinite - long double']
+##teamcity[testFinished name='RandomGenerator reports itself as infinite - long double' duration="{duration}"]
 ##teamcity[testStarted name='Range type with sentinel']
 ##teamcity[testFinished name='Range type with sentinel' duration="{duration}"]
 ##teamcity[testStarted name='Reconstruction should be based on stringification: #914']
@@ -585,6 +593,8 @@
 ##teamcity[testFinished name='Registering reporter with |'::|' in name fails' duration="{duration}"]
 ##teamcity[testStarted name='Regression test #1']
 ##teamcity[testFinished name='Regression test #1' duration="{duration}"]
+##teamcity[testStarted name='RepeatGenerator refuses infinite generators']
+##teamcity[testFinished name='RepeatGenerator refuses infinite generators' duration="{duration}"]
 ##teamcity[testStarted name='Reporter|'s write listings to provided stream']
 ##teamcity[testFinished name='Reporter|'s write listings to provided stream' duration="{duration}"]
 ##teamcity[testStarted name='Reproducer for #2309 - a very long description past 80 chars (default console width) with a late colon : blablabla']
diff --git a/tests/SelfTest/Baselines/teamcity.sw.multi.approved.txt b/tests/SelfTest/Baselines/teamcity.sw.multi.approved.txt
index feb5f1d9..4f96fab8 100644
--- a/tests/SelfTest/Baselines/teamcity.sw.multi.approved.txt
+++ b/tests/SelfTest/Baselines/teamcity.sw.multi.approved.txt
@@ -417,6 +417,8 @@
 ##teamcity[testFinished name='Floating point matchers: float' duration="{duration}"]
 ##teamcity[testStarted name='GENERATE can combine literals and generators']
 ##teamcity[testFinished name='GENERATE can combine literals and generators' duration="{duration}"]
+##teamcity[testStarted name='Generator adapters properly handle isFinite']
+##teamcity[testFinished name='Generator adapters properly handle isFinite' duration="{duration}"]
 ##teamcity[testStarted name='Generators -- adapters']
 ##teamcity[testFinished name='Generators -- adapters' duration="{duration}"]
 ##teamcity[testStarted name='Generators -- simple']
@@ -571,6 +573,12 @@
 ##teamcity[testFinished name='Random seed generation accepts known methods' duration="{duration}"]
 ##teamcity[testStarted name='Random seed generation reports unknown methods']
 ##teamcity[testFinished name='Random seed generation reports unknown methods' duration="{duration}"]
+##teamcity[testStarted name='RandomGenerator reports itself as infinite - float']
+##teamcity[testFinished name='RandomGenerator reports itself as infinite - float' duration="{duration}"]
+##teamcity[testStarted name='RandomGenerator reports itself as infinite - int']
+##teamcity[testFinished name='RandomGenerator reports itself as infinite - int' duration="{duration}"]
+##teamcity[testStarted name='RandomGenerator reports itself as infinite - long double']
+##teamcity[testFinished name='RandomGenerator reports itself as infinite - long double' duration="{duration}"]
 ##teamcity[testStarted name='Range type with sentinel']
 ##teamcity[testFinished name='Range type with sentinel' duration="{duration}"]
 ##teamcity[testStarted name='Reconstruction should be based on stringification: #914']
@@ -585,6 +593,8 @@
 ##teamcity[testFinished name='Registering reporter with |'::|' in name fails' duration="{duration}"]
 ##teamcity[testStarted name='Regression test #1']
 ##teamcity[testFinished name='Regression test #1' duration="{duration}"]
+##teamcity[testStarted name='RepeatGenerator refuses infinite generators']
+##teamcity[testFinished name='RepeatGenerator refuses infinite generators' duration="{duration}"]
 ##teamcity[testStarted name='Reporter|'s write listings to provided stream']
 ##teamcity[testFinished name='Reporter|'s write listings to provided stream' duration="{duration}"]
 ##teamcity[testStarted name='Reproducer for #2309 - a very long description past 80 chars (default console width) with a late colon : blablabla']
diff --git a/tests/SelfTest/Baselines/xml.sw.approved.txt b/tests/SelfTest/Baselines/xml.sw.approved.txt
index 77a45a54..bd5a725c 100644
--- a/tests/SelfTest/Baselines/xml.sw.approved.txt
+++ b/tests/SelfTest/Baselines/xml.sw.approved.txt
@@ -6119,6 +6119,104 @@ Approx( 1.30000000000000004 )
     </Expression>
     <OverallResult success="true" skips="0"/>
   </TestCase>
+  <TestCase name="Generator adapters properly handle isFinite" tags="[chunk][concat][filter][generators][map][take]" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
+    <Section name="concat generator" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
+      <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
+        <Original>
+          finite_cat.isFinite()
+        </Original>
+        <Expanded>
+          true
+        </Expanded>
+      </Expression>
+      <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
+        <Original>
+          !(infinite_cat.isFinite())
+        </Original>
+        <Expanded>
+          !false
+        </Expanded>
+      </Expression>
+      <OverallResults successes="2" failures="0" expectedFailures="0" skipped="false"/>
+    </Section>
+    <Section name="take generator" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
+      <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
+        <Original>
+          take_1.isFinite()
+        </Original>
+        <Expanded>
+          true
+        </Expanded>
+      </Expression>
+      <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
+        <Original>
+          take_2.isFinite()
+        </Original>
+        <Expanded>
+          true
+        </Expanded>
+      </Expression>
+      <OverallResults successes="2" failures="0" expectedFailures="0" skipped="false"/>
+    </Section>
+    <Section name="chunk generator" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
+      <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
+        <Original>
+          finite_chunk.isFinite()
+        </Original>
+        <Expanded>
+          true
+        </Expanded>
+      </Expression>
+      <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
+        <Original>
+          !(infinite_chunk.isFinite())
+        </Original>
+        <Expanded>
+          !false
+        </Expanded>
+      </Expression>
+      <OverallResults successes="2" failures="0" expectedFailures="0" skipped="false"/>
+    </Section>
+    <Section name="map" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
+      <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
+        <Original>
+          finite_map.isFinite()
+        </Original>
+        <Expanded>
+          true
+        </Expanded>
+      </Expression>
+      <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
+        <Original>
+          !(infinite_map.isFinite())
+        </Original>
+        <Expanded>
+          !false
+        </Expanded>
+      </Expression>
+      <OverallResults successes="2" failures="0" expectedFailures="0" skipped="false"/>
+    </Section>
+    <Section name="filter" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
+      <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
+        <Original>
+          finite_filter.isFinite()
+        </Original>
+        <Expanded>
+          true
+        </Expanded>
+      </Expression>
+      <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
+        <Original>
+          !(infinite_filter.isFinite())
+        </Original>
+        <Expanded>
+          !false
+        </Expanded>
+      </Expression>
+      <OverallResults successes="2" failures="0" expectedFailures="0" skipped="false"/>
+    </Section>
+    <OverallResult success="true" skips="0"/>
+  </TestCase>
   <TestCase name="Generators -- adapters" tags="[generators][generic]" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" >
     <Section name="Filtering by predicate" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" >
       <Section name="Basic usage" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" >
@@ -12492,6 +12590,39 @@ Approx( 0.98999999999999999 )
     </Expression>
     <OverallResult success="true" skips="0"/>
   </TestCase>
+  <TestCase name="RandomGenerator reports itself as infinite - float" tags="[generators][random]" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
+    <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
+      <Original>
+        !(Catch::Generators::random( TestType{ 0 }, TestType{ 100 } ).isFinite())
+      </Original>
+      <Expanded>
+        !false
+      </Expanded>
+    </Expression>
+    <OverallResult success="true" skips="0"/>
+  </TestCase>
+  <TestCase name="RandomGenerator reports itself as infinite - int" tags="[generators][random]" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
+    <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
+      <Original>
+        !(Catch::Generators::random( TestType{ 0 }, TestType{ 100 } ).isFinite())
+      </Original>
+      <Expanded>
+        !false
+      </Expanded>
+    </Expression>
+    <OverallResult success="true" skips="0"/>
+  </TestCase>
+  <TestCase name="RandomGenerator reports itself as infinite - long double" tags="[generators][random]" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
+    <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
+      <Original>
+        !(Catch::Generators::random( TestType{ 0 }, TestType{ 100 } ).isFinite())
+      </Original>
+      <Expanded>
+        !false
+      </Expanded>
+    </Expression>
+    <OverallResult success="true" skips="0"/>
+  </TestCase>
   <TestCase name="Range type with sentinel" filename="tests/<exe-name>/IntrospectiveTests/ToString.tests.cpp" >
     <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/ToString.tests.cpp" >
       <Original>
@@ -12563,6 +12694,17 @@ Approx( 0.98999999999999999 )
     </Expression>
     <OverallResult success="true" skips="0"/>
   </TestCase>
+  <TestCase name="RepeatGenerator refuses infinite generators" tags="[generators][repeat]" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
+    <Expression success="true" type="REQUIRE_THROWS" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
+      <Original>
+        RepeatGenerator&lt;int>( 2, random( 1, 100 ) )
+      </Original>
+      <Expanded>
+        RepeatGenerator&lt;int>( 2, random( 1, 100 ) )
+      </Expanded>
+    </Expression>
+    <OverallResult success="true" skips="0"/>
+  </TestCase>
   <TestCase name="Reporter's write listings to provided stream" tags="[reporters]" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" >
     <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" >
       <Original>
@@ -22878,6 +23020,6 @@ Approx( -1.95996398454005449 )
     </Section>
     <OverallResult success="true" skips="0"/>
   </TestCase>
-  <OverallResults successes="2161" failures="158" expectedFailures="43" skips="12"/>
-  <OverallResultsCases successes="323" failures="96" expectedFailures="18" skips="6"/>
+  <OverallResults successes="2175" failures="158" expectedFailures="43" skips="12"/>
+  <OverallResultsCases successes="328" failures="96" expectedFailures="18" skips="6"/>
 </Catch2TestRun>
diff --git a/tests/SelfTest/Baselines/xml.sw.multi.approved.txt b/tests/SelfTest/Baselines/xml.sw.multi.approved.txt
index dbb3996f..3bdd4518 100644
--- a/tests/SelfTest/Baselines/xml.sw.multi.approved.txt
+++ b/tests/SelfTest/Baselines/xml.sw.multi.approved.txt
@@ -6119,6 +6119,104 @@ Approx( 1.30000000000000004 )
     </Expression>
     <OverallResult success="true" skips="0"/>
   </TestCase>
+  <TestCase name="Generator adapters properly handle isFinite" tags="[chunk][concat][filter][generators][map][take]" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
+    <Section name="concat generator" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
+      <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
+        <Original>
+          finite_cat.isFinite()
+        </Original>
+        <Expanded>
+          true
+        </Expanded>
+      </Expression>
+      <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
+        <Original>
+          !(infinite_cat.isFinite())
+        </Original>
+        <Expanded>
+          !false
+        </Expanded>
+      </Expression>
+      <OverallResults successes="2" failures="0" expectedFailures="0" skipped="false"/>
+    </Section>
+    <Section name="take generator" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
+      <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
+        <Original>
+          take_1.isFinite()
+        </Original>
+        <Expanded>
+          true
+        </Expanded>
+      </Expression>
+      <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
+        <Original>
+          take_2.isFinite()
+        </Original>
+        <Expanded>
+          true
+        </Expanded>
+      </Expression>
+      <OverallResults successes="2" failures="0" expectedFailures="0" skipped="false"/>
+    </Section>
+    <Section name="chunk generator" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
+      <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
+        <Original>
+          finite_chunk.isFinite()
+        </Original>
+        <Expanded>
+          true
+        </Expanded>
+      </Expression>
+      <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
+        <Original>
+          !(infinite_chunk.isFinite())
+        </Original>
+        <Expanded>
+          !false
+        </Expanded>
+      </Expression>
+      <OverallResults successes="2" failures="0" expectedFailures="0" skipped="false"/>
+    </Section>
+    <Section name="map" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
+      <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
+        <Original>
+          finite_map.isFinite()
+        </Original>
+        <Expanded>
+          true
+        </Expanded>
+      </Expression>
+      <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
+        <Original>
+          !(infinite_map.isFinite())
+        </Original>
+        <Expanded>
+          !false
+        </Expanded>
+      </Expression>
+      <OverallResults successes="2" failures="0" expectedFailures="0" skipped="false"/>
+    </Section>
+    <Section name="filter" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
+      <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
+        <Original>
+          finite_filter.isFinite()
+        </Original>
+        <Expanded>
+          true
+        </Expanded>
+      </Expression>
+      <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
+        <Original>
+          !(infinite_filter.isFinite())
+        </Original>
+        <Expanded>
+          !false
+        </Expanded>
+      </Expression>
+      <OverallResults successes="2" failures="0" expectedFailures="0" skipped="false"/>
+    </Section>
+    <OverallResult success="true" skips="0"/>
+  </TestCase>
   <TestCase name="Generators -- adapters" tags="[generators][generic]" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" >
     <Section name="Filtering by predicate" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" >
       <Section name="Basic usage" filename="tests/<exe-name>/UsageTests/Generators.tests.cpp" >
@@ -12492,6 +12590,39 @@ Approx( 0.98999999999999999 )
     </Expression>
     <OverallResult success="true" skips="0"/>
   </TestCase>
+  <TestCase name="RandomGenerator reports itself as infinite - float" tags="[generators][random]" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
+    <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
+      <Original>
+        !(Catch::Generators::random( TestType{ 0 }, TestType{ 100 } ).isFinite())
+      </Original>
+      <Expanded>
+        !false
+      </Expanded>
+    </Expression>
+    <OverallResult success="true" skips="0"/>
+  </TestCase>
+  <TestCase name="RandomGenerator reports itself as infinite - int" tags="[generators][random]" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
+    <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
+      <Original>
+        !(Catch::Generators::random( TestType{ 0 }, TestType{ 100 } ).isFinite())
+      </Original>
+      <Expanded>
+        !false
+      </Expanded>
+    </Expression>
+    <OverallResult success="true" skips="0"/>
+  </TestCase>
+  <TestCase name="RandomGenerator reports itself as infinite - long double" tags="[generators][random]" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
+    <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
+      <Original>
+        !(Catch::Generators::random( TestType{ 0 }, TestType{ 100 } ).isFinite())
+      </Original>
+      <Expanded>
+        !false
+      </Expanded>
+    </Expression>
+    <OverallResult success="true" skips="0"/>
+  </TestCase>
   <TestCase name="Range type with sentinel" filename="tests/<exe-name>/IntrospectiveTests/ToString.tests.cpp" >
     <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/ToString.tests.cpp" >
       <Original>
@@ -12563,6 +12694,17 @@ Approx( 0.98999999999999999 )
     </Expression>
     <OverallResult success="true" skips="0"/>
   </TestCase>
+  <TestCase name="RepeatGenerator refuses infinite generators" tags="[generators][repeat]" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
+    <Expression success="true" type="REQUIRE_THROWS" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
+      <Original>
+        RepeatGenerator&lt;int>( 2, random( 1, 100 ) )
+      </Original>
+      <Expanded>
+        RepeatGenerator&lt;int>( 2, random( 1, 100 ) )
+      </Expanded>
+    </Expression>
+    <OverallResult success="true" skips="0"/>
+  </TestCase>
   <TestCase name="Reporter's write listings to provided stream" tags="[reporters]" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" >
     <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/IntrospectiveTests/Reporters.tests.cpp" >
       <Original>
@@ -22877,6 +23019,6 @@ Approx( -1.95996398454005449 )
     </Section>
     <OverallResult success="true" skips="0"/>
   </TestCase>
-  <OverallResults successes="2161" failures="158" expectedFailures="43" skips="12"/>
-  <OverallResultsCases successes="323" failures="96" expectedFailures="18" skips="6"/>
+  <OverallResults successes="2175" failures="158" expectedFailures="43" skips="12"/>
+  <OverallResultsCases successes="328" failures="96" expectedFailures="18" skips="6"/>
 </Catch2TestRun>
diff --git a/tests/SelfTest/IntrospectiveTests/GeneratorsImpl.tests.cpp b/tests/SelfTest/IntrospectiveTests/GeneratorsImpl.tests.cpp
index 6c81b160..c415686b 100644
--- a/tests/SelfTest/IntrospectiveTests/GeneratorsImpl.tests.cpp
+++ b/tests/SelfTest/IntrospectiveTests/GeneratorsImpl.tests.cpp
@@ -13,6 +13,7 @@
 #include <helpers/range_test_helpers.hpp>
 
 #include <catch2/catch_approx.hpp>
+#include <catch2/catch_template_test_macros.hpp>
 #include <catch2/catch_test_macros.hpp>
 #include <catch2/generators/catch_generator_exception.hpp>
 #include <catch2/generators/catch_generators_adapters.hpp>
@@ -339,6 +340,7 @@ public:
     bool next() override {
         return false;
     }
+    bool isFinite() const override { return true; }
 };
 
 // Avoids -Wweak-vtables
@@ -472,6 +474,7 @@ namespace {
 
     public:
         bool const& get() const override;
+        bool isFinite() const override { return true; }
     };
 
     // Avoids -Wweak-vtables
@@ -509,6 +512,7 @@ namespace {
 
         bool const& get() const override;
         size_t stringificationCalls() const { return m_stringificationCalls; }
+        bool isFinite() const override { return true; }
     };
 
     // Avoids -Wweak-vtables
@@ -618,6 +622,8 @@ namespace {
             ++m_idx;
             return m_idx < m_elements.size();
         }
+
+        bool isFinite() const override { return true; }
     };
 }
 
@@ -721,3 +727,66 @@ TEST_CASE("MapGenerator can be skipped forward efficiently",
     REQUIRE_THROWS( map_generator.skipToNthElement( 7 ) );
     REQUIRE( map_calls == map_calls_2 + 1 );
 }
+
+TEST_CASE( "Generator adapters properly handle isFinite",
+           "[generators][map][take][chunk][filter][concat]" ) {
+    using namespace Catch::Generators;
+    SECTION( "concat generator" ) {
+        ConcatGenerator<int> finite_cat(
+            value( 1 ), values( { 2, 3, 4 } ), value( 5 ) );
+        REQUIRE( finite_cat.isFinite() );
+
+        ConcatGenerator<int> infinite_cat(
+            value( 1 ), random( 1, 10 ), value( 3 ) );
+        REQUIRE_FALSE( infinite_cat.isFinite() );
+    }
+    SECTION( "take generator" ) {
+        TakeGenerator<int> take_1( 2, values( { 1, 2, 3, 4, 5 } ) );
+        REQUIRE( take_1.isFinite() );
+        TakeGenerator<int> take_2( 3, random( 1, 100 ) );
+        REQUIRE( take_2.isFinite() );
+    }
+    SECTION( "chunk generator" ) {
+        ChunkGenerator<int> finite_chunk( 2, values( { 1, 2, 3, 4, 5 } ) );
+        REQUIRE( finite_chunk.isFinite() );
+        ChunkGenerator<int> infinite_chunk( 2, random( 1, 100 ) );
+        REQUIRE_FALSE( infinite_chunk.isFinite() );
+    }
+    SECTION( "map" ) {
+        auto identity = []( int i ) {
+            return i;
+        };
+
+        MapGenerator<int, int, decltype( identity )> finite_map(
+            identity, values( { 1, 2, 3 } ) );
+        REQUIRE( finite_map.isFinite() );
+        MapGenerator<int, int, decltype( identity )> infinite_map(
+            identity, random( 1, 100 ) );
+        REQUIRE_FALSE( infinite_map.isFinite() );
+    }
+    SECTION( "filter" ) {
+        auto always_true = []( int ) {
+            return true;
+        };
+        FilterGenerator<int, decltype( always_true )> finite_filter(
+            always_true, values( { 1, 2, 3, 4, 5 } ) );
+        REQUIRE( finite_filter.isFinite() );
+        FilterGenerator<int, decltype( always_true )> infinite_filter(
+            always_true, random( 1, 100 ) );
+        REQUIRE_FALSE( infinite_filter.isFinite() );
+    }
+}
+
+TEST_CASE( "RepeatGenerator refuses infinite generators",
+           "[generators][repeat]" ) {
+    using namespace Catch::Generators;
+    REQUIRE_THROWS( RepeatGenerator<int>( 2, random( 1, 100 ) ) );
+}
+
+TEMPLATE_TEST_CASE( "RandomGenerator reports itself as infinite",
+                    "[generators][random]",
+    int,
+    float,
+    long double) {
+    REQUIRE_FALSE( Catch::Generators::random( TestType{ 0 }, TestType{ 100 } ).isFinite() );
+}
diff --git a/tests/SelfTest/UsageTests/Generators.tests.cpp b/tests/SelfTest/UsageTests/Generators.tests.cpp
index b03192cf..3394b4b5 100644
--- a/tests/SelfTest/UsageTests/Generators.tests.cpp
+++ b/tests/SelfTest/UsageTests/Generators.tests.cpp
@@ -296,6 +296,7 @@ namespace {
         }
 
         auto next() -> bool override { return false; }
+        auto isFinite() const -> bool override { return true; }
     };
 
     static auto make_test_generator()
diff --git a/tests/SelfTest/UsageTests/Skip.tests.cpp b/tests/SelfTest/UsageTests/Skip.tests.cpp
index 661795e1..e6f9a797 100644
--- a/tests/SelfTest/UsageTests/Skip.tests.cpp
+++ b/tests/SelfTest/UsageTests/Skip.tests.cpp
@@ -83,6 +83,8 @@ namespace {
         }
 
         auto next() -> bool override { return false; }
+
+        auto isFinite() const -> bool override { return true; }
     };
 
     static auto make_test_skip_generator()