Skip errored runs when computing repetition statistics#2199
Conversation
LebedevRI
left a comment
There was a problem hiding this comment.
Please clang-format the diff
|
Applied clang-format 18 to the touched test file and pushed c0a4bda. Local validation:
|
| @@ -129,14 +134,17 @@ std::vector<BenchmarkReporter::Run> ComputeStats( | |||
There was a problem hiding this comment.
These should probably also use successful_count?
|
I do not see any active threads left now, and the clang-format check is passing after c0a4bda. Happy to make another pass if I missed something. |
There are last two inline comments. |
|
Thanks, I missed those two. Updated in e5409c3: the time accumulators and per-counter buffers now reserve the successful run count as well. I also added the explicit size_type cast so the warning flags stay clean. Locally checked with clang-format --dry-run, the statistics/skip-with-error build targets, and the matching ctest filter. |
| std::find_if(reports.begin(), reports.end(), is_successful); | ||
| const auto successful_count = | ||
| std::count_if(reports.begin(), reports.end(), is_successful); | ||
| const auto successful_count = static_cast<std::vector<Run>::size_type>( |
There was a problem hiding this comment.
- Why, C++, why?!
- Let's just hardcode
size_there
There was a problem hiding this comment.
Done in 7caecf6. I switched the cast to size_t and reran the same local checks: clang-format dry run, the statistics/skip-with-error build targets, and the matching ctest filter.
Fixes #1406.
Summary
reports[0]Validation
statistics_gtest|skip_with_error_test--output-on-failureNote: the explicit CMAKE_CXX_FLAGS include path is only needed on my local macOS CommandLineTools install because its default C++ header search path does not find SDK libc++ headers.