diff options
author | MarcoFalke <falke.marco@gmail.com> | 2019-04-10 14:57:19 -0400 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2019-04-10 15:59:11 -0400 |
commit | fa8685d49ed8e52b1220a89f669dac63bef172bc (patch) | |
tree | d3b1da72395a33e7b7053ddbac1789502225b0b2 /src/bench/bench.cpp | |
parent | 666696b673c5d3b7ab467a890cafd13ac19be503 (diff) |
test: Use test_bitcoin setup in bench, Add test utils
Diffstat (limited to 'src/bench/bench.cpp')
-rw-r--r-- | src/bench/bench.cpp | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/bench/bench.cpp b/src/bench/bench.cpp index 966b99f6c8..da098a6eee 100644 --- a/src/bench/bench.cpp +++ b/src/bench/bench.cpp @@ -4,12 +4,16 @@ #include <bench/bench.h> +#include <chainparams.h> +#include <test/test_bitcoin.h> +#include <validation.h> + +#include <algorithm> #include <assert.h> -#include <iostream> #include <iomanip> -#include <algorithm> -#include <regex> +#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; } |