google / benchmark

A microbenchmark support library
Apache License 2.0
8.94k stars 1.62k forks source link

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

Open tstanisl opened 1 year ago

tstanisl commented 1 year ago

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

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.