Skip to content

Commit

Permalink
Fix benchmarks filters
Browse files Browse the repository at this point in the history
Summary:
> The bug was introduced in [[bitcoin/bitcoin#17781 | PR17781]]
> before this fix `./src/bench/bitcoin-bench -filter="RIPEMD160|SHA256|SHA1"` will fail with:
> ```
> # Benchmark, evals, iterations, total, min, max, median
> bench_bitcoin: bench/bench.cpp:119: static void benchmark::BenchRunner::RunAll(benchmark::Printer&, uint64_t, double, const string&, bool): Assertion `g_testing_setup == nullptr' failed.
> Aborted (core dumped)
> ```

This is a backport of Core [[bitcoin/bitcoin#18013 | PR18013]]

Test Plan: `ninja && ./src/bench/bitcoin-bench -filter="RIPEMD160|SHA256|SHA1"`

Reviewers: #bitcoin_abc, majcosta

Reviewed By: #bitcoin_abc, majcosta

Differential Revision: https://reviews.bitcoinabc.org/D8690
  • Loading branch information
elichai authored and PiRK committed Dec 18, 2020
1 parent a4de9ac commit 8d80549
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/bench/bench.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ void benchmark::BenchRunner::RunAll(Printer &printer, uint64_t num_evals,
assert(::ChainActive().Height() == 0);

if (!std::regex_match(p.first, baseMatch, reFilter)) {
g_testing_setup = nullptr;
continue;
}

Expand Down

0 comments on commit 8d80549

Please sign in to comment.