#3219

Fix report order for unfinished nested sections

Openxiehuanyiwants to merge intofrom

Description

Nested SKIP, fatal assertions, and unexpected exceptions defer section endings until stack unwinding completes. The section information is queued inner-first, but the reverse traversal emits outer endings first. CumulativeReporterBase assigns those statistics to the current inner node, corrupting section names and hierarchy.

Process the deferred endings in enqueue order. A real custom cumulative reporter checks balanced start/end names and the resulting tree paths for skip, fatal failure, unexpected exception, and normal completion. The first three fail before the fix; all four pass afterward.

The four updated JUnit/SonarQube approval files now show the actual nested paths and remove spurious parent nodes. Amalgamated files were regenerated locally for testing and are excluded from this commit.

Validation on Linux with GCC 13.3: complete all-tests build and all 160 CTest checks pass, including examples, extra tests, configuration/helper checks, signals, and approval outputs. Changed source and the new fixture also pass C++14 syntax checks. The new fixture passes clang-format.

Prepared with OpenAI Codex assistance; the reported failure was reproduced and the submitted source was tested locally.

GitHub Issues

Closes #2928.

Activity

3
copilot-pull-request-reviewer[bot]reviewed18d ago
copilot-pull-request-reviewer[bot]18d ago

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

codecov[bot]18d ago

Codecov Report

:white_check_mark: All modified and coverable lines are covered by tests. :white_check_mark: Project coverage is 91.18%. Comparing base (0809213) to head (662f5ab).

Additional details and impacted files
@@           Coverage Diff           @@
##            devel    #3219   +/-   ##
=======================================
  Coverage   91.18%   91.18%           
=======================================
  Files         205      205           
  Lines        9101     9101           
=======================================
  Hits         8298     8298           
  Misses        803      803           
:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.