Skip to content

Commit fda951f

Browse files
committed
merge bitcoin#26481: Suppress output when running with -sanity-check option
1 parent a5718a0 commit fda951f

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

src/Makefile.test.include

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ if TARGET_WINDOWS
400400
else
401401
if ENABLE_BENCH
402402
@echo "Running bench/bench_dash (one iteration sanity check, only high priority)..."
403-
$(BENCH_BINARY) -sanity-check -priority-level=high > /dev/null
403+
$(BENCH_BINARY) -sanity-check -priority-level=high
404404
endif
405405
endif
406406
$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C secp256k1 check

src/bench/bench.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ void BenchRunner::RunAll(const Args& args)
8484
std::smatch baseMatch;
8585

8686
if (args.sanity_check) {
87-
std::cout << "Running with --sanity-check option, benchmark results will be useless." << std::endl;
87+
std::cout << "Running with -sanity-check option, output is being suppressed as benchmark results will be useless." << std::endl;
8888
}
8989

9090
std::vector<ankerl::nanobench::Result> benchmarkResults;
@@ -107,6 +107,7 @@ void BenchRunner::RunAll(const Args& args)
107107
Bench bench;
108108
if (args.sanity_check) {
109109
bench.epochs(1).epochIterations(1);
110+
bench.output(nullptr);
110111
}
111112
bench.name(name);
112113
if (args.min_time > 0ms) {

src/bench/bench_bitcoin.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ static void SetupBenchArgs(ArgsManager& argsman)
3131
argsman.AddArg("-min-time=<milliseconds>", strprintf("Minimum runtime per benchmark, in milliseconds (default: %d)", DEFAULT_MIN_TIME_MS), ArgsManager::ALLOW_ANY | ArgsManager::DISALLOW_NEGATION, OptionsCategory::OPTIONS);
3232
argsman.AddArg("-output-csv=<output.csv>", "Generate CSV file with the most important benchmark results", ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
3333
argsman.AddArg("-output-json=<output.json>", "Generate JSON file with all benchmark results", ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
34-
argsman.AddArg("-sanity-check", "Run benchmarks for only one iteration", ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
34+
argsman.AddArg("-sanity-check", "Run benchmarks for only one iteration with no output", ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
3535
argsman.AddArg("-priority-level=<l1,l2,l3>", strprintf("Run benchmarks of one or multiple priority level(s) (%s), default: '%s'",
3636
benchmark::ListPriorities(), DEFAULT_PRIORITY), ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
3737
}

0 commit comments

Comments
 (0)