fix(bench): reset reporter context (#14360)

This commit fixes previous file benchmarks leaking into the next file benchmarks summary.
This commit is contained in:
evan 2022-04-22 14:43:22 +03:00 committed by GitHub
parent 57f7e07c13
commit 6fad5c33c9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 47 additions and 0 deletions

View file

@ -178,6 +178,10 @@ impl BenchReporter for ConsoleReporter {
use std::sync::atomic::Ordering;
static FIRST_PLAN: AtomicBool = AtomicBool::new(true);
self.group = None;
self.baseline = None;
self.name = String::new();
self.group_measurements.clear();
self.options = Some(mitata::reporter::Options::new(
&plan.names.iter().map(|x| x.as_str()).collect::<Vec<&str>>(),
));