test: Use test_bitcoin setup in bench, Add test utils
This commit is contained in:
9 files changed
+152
-135
No files matched your search
+15
-4
@@ -4,12 +4,16 @@
|
||||
|
||||
#include <bench/bench.h>
|
||||
|
||||
#include <assert.h>
|
||||
#include <iostream>
|
||||
#include <iomanip>
|
||||
#include <chainparams.h>
|
||||
#include <test/test_bitcoin.h>
|
||||
#include <validation.h>
|
||||
|
||||
#include <algorithm>
|
||||
#include <regex>
|
||||
#include <assert.h>
|
||||
#include <iomanip>
|
||||
#include <iostream>
|
||||
#include <numeric>
|
||||
#include <regex>
|
||||
|
||||
void benchmark::ConsolePrinter::header()
|
||||
{
|
||||
@@ -108,6 +112,13 @@ void benchmark::BenchRunner::RunAll(Printer& printer, uint64_t num_evals, double
|
||||
printer.header();
|
||||
|
||||
for (const auto& p : benchmarks()) {
|
||||
TestingSetup test{CBaseChainParams::REGTEST};
|
||||
{
|
||||
assert(::chainActive.Height() == 0);
|
||||
const bool witness_enabled{IsWitnessEnabled(::chainActive.Tip(), Params().GetConsensus())};
|
||||
assert(witness_enabled);
|
||||
}
|
||||
|
||||
if (!std::regex_match(p.first, baseMatch, reFilter)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user