bench: Remove requirement that all benches use RegTestingSetup
This commit is contained in:
10 files changed
+28
-20
No files matched your search
@@ -15,7 +15,6 @@
|
||||
#include <numeric>
|
||||
#include <regex>
|
||||
|
||||
const RegTestingSetup* g_testing_setup = nullptr;
|
||||
const std::function<void(const std::string&)> G_TEST_LOG_FUN{};
|
||||
|
||||
void benchmark::ConsolePrinter::header()
|
||||
@@ -115,18 +114,7 @@ void benchmark::BenchRunner::RunAll(Printer& printer, uint64_t num_evals, double
|
||||
printer.header();
|
||||
|
||||
for (const auto& p : benchmarks()) {
|
||||
RegTestingSetup test{};
|
||||
assert(g_testing_setup == nullptr);
|
||||
g_testing_setup = &test;
|
||||
{
|
||||
LOCK(cs_main);
|
||||
assert(::ChainActive().Height() == 0);
|
||||
const bool witness_enabled{IsWitnessEnabled(::ChainActive().Tip(), Params().GetConsensus())};
|
||||
assert(witness_enabled);
|
||||
}
|
||||
|
||||
if (!std::regex_match(p.first, baseMatch, reFilter)) {
|
||||
g_testing_setup = nullptr;
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -139,7 +127,6 @@ void benchmark::BenchRunner::RunAll(Printer& printer, uint64_t num_evals, double
|
||||
p.second.func(state);
|
||||
}
|
||||
printer.result(state);
|
||||
g_testing_setup = nullptr;
|
||||
}
|
||||
|
||||
printer.footer();
|
||||
|
||||
Reference in new issue
Block a user