aboutsummaryrefslogtreecommitdiff
path: root/src/bench/bench.cpp
diff options
context:
space:
mode:
authorHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2022-11-10 16:26:34 +0000
committerHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2022-11-10 16:26:34 +0000
commit4dbcdf26a301f54c60c85ceab1aaa4dae43f6aeb (patch)
treecc7ef44edfde3b517ab6f42002d1ece86f4a3d29 /src/bench/bench.cpp
parent9dce30194bc07463d634072251a8bf83e1b10ff9 (diff)
bench: Suppress output when running with `-sanity-check` option
This change allows to simplify CI tests, and makes it easier to integrate the `bench_bitcoin` binary into CMake custom targets or commands, as `COMMAND` does not support output redirection
Diffstat (limited to 'src/bench/bench.cpp')
-rw-r--r--src/bench/bench.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/bench/bench.cpp b/src/bench/bench.cpp
index 1a3a006286..3bca27f64c 100644
--- a/src/bench/bench.cpp
+++ b/src/bench/bench.cpp
@@ -83,7 +83,7 @@ void BenchRunner::RunAll(const Args& args)
std::smatch baseMatch;
if (args.sanity_check) {
- std::cout << "Running with --sanity-check option, benchmark results will be useless." << std::endl;
+ std::cout << "Running with -sanity-check option, output is being suppressed as benchmark results will be useless." << std::endl;
}
std::vector<ankerl::nanobench::Result> benchmarkResults;
@@ -106,6 +106,7 @@ void BenchRunner::RunAll(const Args& args)
Bench bench;
if (args.sanity_check) {
bench.epochs(1).epochIterations(1);
+ bench.output(nullptr);
}
bench.name(name);
if (args.min_time > 0ms) {