File tree Expand file tree Collapse file tree 3 files changed +11
-10
lines changed Expand file tree Collapse file tree 3 files changed +11
-10
lines changed Original file line number Diff line number Diff line change @@ -24,20 +24,19 @@ const std::function<std::vector<const char*>()> G_TEST_COMMAND_LINE_ARGUMENTS{};
2424
2525namespace {
2626
27- void GenerateTemplateResults (const std::vector<ankerl::nanobench::Result>& benchmarkResults, const std::string& filename , const char * tpl)
27+ void GenerateTemplateResults (const std::vector<ankerl::nanobench::Result>& benchmarkResults, const fs::path& file , const char * tpl)
2828{
29- if (benchmarkResults.empty () || filename .empty ()) {
29+ if (benchmarkResults.empty () || file .empty ()) {
3030 // nothing to write, bail out
3131 return ;
3232 }
33- std::ofstream fout{fs::PathFromString (filename) };
33+ std::ofstream fout{file };
3434 if (fout.is_open ()) {
3535 ankerl::nanobench::render (tpl, benchmarkResults, fout);
36+ std::cout << " Created " << file << std::endl;
3637 } else {
37- std::cout << " Could write to file ' " << filename << " ' " << std::endl;
38+ std::cout << " Could not write to file " << file << std::endl;
3839 }
39-
40- std::cout << " Created '" << filename << " '" << std::endl;
4140}
4241
4342} // namespace
Original file line number Diff line number Diff line change 55#ifndef BITCOIN_BENCH_BENCH_H
66#define BITCOIN_BENCH_BENCH_H
77
8+ #include < fs.h>
89#include < util/macros.h>
910
1011#include < chrono>
@@ -44,8 +45,8 @@ struct Args {
4445 bool is_list_only;
4546 std::chrono::milliseconds min_time;
4647 std::vector<double > asymptote;
47- std::string output_csv;
48- std::string output_json;
48+ fs::path output_csv;
49+ fs::path output_json;
4950 std::string regex_filter;
5051};
5152
Original file line number Diff line number Diff line change 66
77#include < clientversion.h>
88#include < crypto/sha256.h>
9+ #include < fs.h>
910#include < util/strencodings.h>
1011#include < util/system.h>
1112
@@ -108,8 +109,8 @@ int main(int argc, char** argv)
108109 args.asymptote = parseAsymptote (argsman.GetArg (" -asymptote" , " " ));
109110 args.is_list_only = argsman.GetBoolArg (" -list" , false );
110111 args.min_time = std::chrono::milliseconds (argsman.GetIntArg (" -min_time" , DEFAULT_MIN_TIME_MS));
111- args.output_csv = argsman.GetArg (" -output_csv" , " " );
112- args.output_json = argsman.GetArg (" -output_json" , " " );
112+ args.output_csv = fs::PathFromString ( argsman.GetArg (" -output_csv" , " " ) );
113+ args.output_json = fs::PathFromString ( argsman.GetArg (" -output_json" , " " ) );
113114 args.regex_filter = argsman.GetArg (" -filter" , DEFAULT_BENCH_FILTER);
114115
115116 benchmark::BenchRunner::RunAll (args);
You can’t perform that action at this time.
0 commit comments