Skip to content

Conversation

@chanmyae09
Copy link

Fixes #3040

Summary
Added validation to reject --benchmark-samples 0 which was causing a segmentation fault.

Changes

  • Added 'setBenchmarkSamples' validation function in 'src/catch2/internal/catch_commandline.cpp'
  • Function checks if the value is 0 and returns an error message instead of allowing the crash
  • Follows the same pattern as existing validators like 'setShardCount'

Testing
Tested with a benchmark test case - now shows error message "Benchmark samples must be greater than 0" instead of crashing with SIGSEGV.

@chanmyae09 chanmyae09 force-pushed the fix-benchmark-samples-validation branch from a75ac05 to 84a8fc4 Compare October 16, 2025 23:09
@codecov
Copy link

codecov bot commented Oct 17, 2025

Codecov Report

❌ Patch coverage is 77.77778% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.03%. Comparing base (33e6fd2) to head (84a8fc4).
⚠️ Report is 3 commits behind head on devel.

Additional details and impacted files
@@            Coverage Diff             @@
##            devel    #3041      +/-   ##
==========================================
- Coverage   91.05%   91.03%   -0.03%     
==========================================
  Files         202      202              
  Lines        8716     8725       +9     
==========================================
+ Hits         7936     7942       +6     
- Misses        780      783       +3     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@horenmar
Copy link
Member

Needs an automated test.

@chanmyae09 chanmyae09 force-pushed the fix-benchmark-samples-validation branch from 84a8fc4 to ff7fe4a Compare October 18, 2025 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SIGSEGV when --benchmark-samples 0

2 participants