Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/docs
diff options
context:
space:
mode:
authorMark Jansen2025-02-26 18:45:00 +0100
committerChris Thrasher2025-04-12 12:05:58 -0600
commit5b3b22860344193bfd51e4c3c7429e94d8a5996f (patch)
tree0cb2d163433c3ec1c0ab3855790615166938e0f5 /docs
parent2b60af89e23d28eefc081bc930831ee9d45ea58b (diff)
downloadcatch3-5b3b22860344193bfd51e4c3c7429e94d8a5996f.tar.gz
Update generator docs with relevant headers
Diffstat (limited to 'docs')
-rw-r--r--docs/generators.md13
1 files changed, 8 insertions, 5 deletions
diff --git a/docs/generators.md b/docs/generators.md
index eb1a255a..4e0d99b8 100644
--- a/docs/generators.md
+++ b/docs/generators.md
@@ -21,7 +21,10 @@ The "Generators" `TEST_CASE` will be entered 3 times, and the value of
`i` will be 1, 3, and 5 in turn. `GENERATE`s can also be used multiple
times at the same scope, in which case the result will be a cartesian
product of all elements in the generators. This means that in the snippet
-below, the test case will be run 6 (2\*3) times.
+below, the test case will be run 6 (2\*3) times. The `GENERATE` macro
+is defined in the `catch_generators.hpp` header, so compiling
+the code examples below also requires
+`#include <catch2/generators/catch_generators.hpp>`.
```cpp
TEST_CASE("Generators") {
@@ -103,7 +106,7 @@ a test case,
* 2 fundamental generators
* `SingleValueGenerator<T>` -- contains only single element
* `FixedValuesGenerator<T>` -- contains multiple elements
-* 5 generic generators that modify other generators
+* 5 generic generators that modify other generators (defined in `catch2/generators/catch_generators_adapters.hpp`)
* `FilterGenerator<T, Predicate>` -- filters out elements from a generator
for which the predicate returns "false"
* `TakeGenerator<T>` -- takes first `n` elements from a generator
@@ -111,11 +114,11 @@ a test case,
* `MapGenerator<T, U, Func>` -- returns the result of applying `Func`
on elements from a different generator
* `ChunkGenerator<T>` -- returns chunks (inside `std::vector`) of n elements from a generator
-* 4 specific purpose generators
+* 4 specific purpose generators (defined in `catch2/generators/catch_generators_random.hpp`)
* `RandomIntegerGenerator<Integral>` -- generates random Integrals from range
* `RandomFloatGenerator<Float>` -- generates random Floats from range
- * `RangeGenerator<T>(first, last)` -- generates all values inside a `[first, last)` arithmetic range
- * `IteratorGenerator<T>` -- copies and returns values from an iterator range
+ * `RangeGenerator<T>(first, last)` -- generates all values inside a `[first, last)` arithmetic range (defined in `catch2/generators/catch_generators_range.hpp`)
+ * `IteratorGenerator<T>` -- copies and returns values from an iterator range (defined in `catch2/generators/catch_generators_range.hpp`)
> `ChunkGenerator<T>`, `RandomIntegerGenerator<Integral>`, `RandomFloatGenerator<Float>` and `RangeGenerator<T>` were introduced in Catch2 2.7.0.