google / google/benchmark

[BUG] Breaking public API by removing error_occurred from BenchmarkReporter::Run

Open
#1,603 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
10.4k
Forks
1.8k
Avg merge
2d 4h
Merged PRs (30d)
8

Description

**Describe the bug**
The commit https://github.com/google/benchmark/commit/adb0d3d0bf5841bddc2bcc025baad93dbc7fa39f in PR https://github.com/google/benchmark/pull/1564 removed member `error_occurred` from `BenchmarkReporter::Run` struct.

```
@@ -1685,8 +1720,8 @@ class BENCHMARK_EXPORT BenchmarkReporter {
std::string aggregate_name;
StatisticUnit aggregate_unit;
std::string report_label; // Empty if not set by benchmark.
- bool error_occurred;
- std::string error_message;
+ internal::Skipped skipped;
+ std::string skip_message;

IterationCount iterations;
int64_t threads;
```

This is a API breaking change that was introduced without any deprecation warning. Updating the application code to use `skipped` will cause a build-break for when compiled against older version of GoogleBenchmark. There are no macros to detect the version of benchmark library.

**System**
- all

**To reproduce**
NA

**Expected behavior**
All code using `error_occurred` should compile. A deprecation warning should be emitted a few releases prior to removing the public field from a struct.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Additional context**
Add any other context about the problem here.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.