#3203

Add configurable precision for complex stringification

Openfzlzjerrywants to merge intofrom

Description

Add an opt-in StringMaker<std::complex<T>> with configurable precision for float, double and long double components. Each component type has its own setting, defaulting to max_digits10.

This follows the existing optional stringmaker mechanism, including the ALL toggle, CMake option, generated configuration header and Bazel template. It retains the standard (real,imag) stream format and leaves scalar precision settings and the non-opt-in fallback unchanged.

Validation

  • 11 new cases / 37 assertions cover round-tripping, runtime precision, special values, independent settings and stream reuse.
  • GCC 14.2 / C++14: basic preset 81/81 CTest checks and full all-tests preset 143/143 pass. The discovery checks use a private writable runtime/temp directory.
  • Clang 19.1.7 / C++20 shared library with the individual option: 81/81 checks pass.
  • Installed-package consumers verify cross-translation-unit settings and actual assertion diagnostics; the generated amalgamation also compiles and runs the API.
  • With ALL stringmakers enabled, the existing pair/tuple reporter-baseline mismatch remains: 80/81 checks pass, and all eight differing output files are byte-identical on pristine base and candidate. No reporter baselines were changed.

GitHub Issues

Refs #2876.

Activity

3
copilot-pull-request-reviewer[bot]reviewed1mo ago
copilot-pull-request-reviewer[bot]1mo ago

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

codecov[bot]1mo 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 (897d804) to head (b36caf1).

Additional details and impacted files
@@            Coverage Diff             @@
##            devel    #3203      +/-   ##
==========================================
+ Coverage   91.17%   91.18%   +0.01%     
==========================================
  Files         206      206              
  Lines        9031     9037       +6     
==========================================
+ Hits         8234     8240       +6     
  Misses        797      797              
:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.