test: Use test_bitcoin setup in bench, Add test utils

This commit is contained in:
MarcoFalke committed 2019-04-10 15:59:11 -04:00
1 parent 666696b673
commit fa8685d49e
9 files changed
+152 -135

No files matched your search

+15 -4
View File
@@ -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;
}