#3218
Reject zero benchmark resamples on the command line
Description
--benchmark-resamples=0 currently parses successfully, even though the bootstrap analysis needs a nonempty set of resamples. Reject zero at the command-line boundary, mirroring the existing validation of --benchmark-samples.
Use parseUInt to validate the value before updating ConfigData, and report a specific error for malformed input. Add command-line regressions for zero and nonnumeric input, retain the existing positive-value test, document the constraint, and update the SelfTest approval baselines. No amalgamated files are changed.
Validation on Windows with Clang 23.1.3/libc++, C++14, and the basic-tests development preset:
- Before the fix, the new zero-value test fails because parsing succeeds; the malformed-value test fails because the parser returns the generic conversion error.
- After the fix, the command-line group passes all 263 assertions in 4 test cases.
- All 82 CTest entries pass, including approval tests after regenerating and reviewing the expected output with
tools/scripts/approve.py. - Linux, macOS, and sanitizer builds were not run locally.
GitHub Issues
No linked issue; this change is limited to command-line validation of the resample count.
Codecov Report
:white_check_mark: All modified and coverable lines are covered by tests. :white_check_mark: Project coverage is 91.19%. Comparing base (
0809213) to head (89e5cd5).Additional details and impacted files
:rocket: New features to boost your workflow: