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

Add problems with `SECTION`s in loops to documentations

Commit
626b1d39361ac644bc1025bef28b9592315cf0ae
Author
Martin Hořeňovský ·
Parents
5d6c1f4dd04a

Files · Download .tar.gz

Changes

 docs/limitations.md | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/docs/limitations.md b/docs/limitations.md
index bee4a296..60ea0de2 100644
--- a/docs/limitations.md
+++ b/docs/limitations.md
@@ -2,6 +2,20 @@
 
 Catch has some known limitations, that we are not planning to change. Some of these are caused by our desire to support C++98 compilers, some of these are caused by our desire to keep Catch crossplatform, some exist because their priority is seen as low compared to the development effort they would need and some other yet are compiler/runtime bugs.
 
+## Implementation limits
+### Sections nested in loops
+
+If you are using `SECTION`s inside loops, you have to create them with different name per loop's iteration. The recommended way to do so is to incorporate the loop's counter into section's name, like so
+```cpp
+TEST_CASE( "Looped section" ) {
+    for (char i = '0'; i < '5'; ++i) {
+        SECTION(std::string("Looped section ") + i) {
+            SUCCEED( "Everything is OK" );
+        }
+    }
+}
+```
+
 ## Features
 This section outlines some missing features, what is their status and their possible workarounds.