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{};
24
24
25
25
namespace {
26
26
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)
28
28
{
29
- if (benchmarkResults.empty () || filename .empty ()) {
29
+ if (benchmarkResults.empty () || file .empty ()) {
30
30
// nothing to write, bail out
31
31
return ;
32
32
}
33
- std::ofstream fout{fs::PathFromString (filename) };
33
+ std::ofstream fout{file };
34
34
if (fout.is_open ()) {
35
35
ankerl::nanobench::render (tpl, benchmarkResults, fout);
36
+ std::cout << " Created " << file << std::endl;
36
37
} else {
37
- std::cout << " Could write to file ' " << filename << " ' " << std::endl;
38
+ std::cout << " Could not write to file " << file << std::endl;
38
39
}
39
-
40
- std::cout << " Created '" << filename << " '" << std::endl;
41
40
}
42
41
43
42
} // namespace
Original file line number Diff line number Diff line change 5
5
#ifndef BITCOIN_BENCH_BENCH_H
6
6
#define BITCOIN_BENCH_BENCH_H
7
7
8
+ #include < fs.h>
8
9
#include < util/macros.h>
9
10
10
11
#include < chrono>
@@ -44,8 +45,8 @@ struct Args {
44
45
bool is_list_only;
45
46
std::chrono::milliseconds min_time;
46
47
std::vector<double > asymptote;
47
- std::string output_csv;
48
- std::string output_json;
48
+ fs::path output_csv;
49
+ fs::path output_json;
49
50
std::string regex_filter;
50
51
};
51
52
Original file line number Diff line number Diff line change 6
6
7
7
#include < clientversion.h>
8
8
#include < crypto/sha256.h>
9
+ #include < fs.h>
9
10
#include < util/strencodings.h>
10
11
#include < util/system.h>
11
12
@@ -108,8 +109,8 @@ int main(int argc, char** argv)
108
109
args.asymptote = parseAsymptote (argsman.GetArg (" -asymptote" , " " ));
109
110
args.is_list_only = argsman.GetBoolArg (" -list" , false );
110
111
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" , " " ) );
113
114
args.regex_filter = argsman.GetArg (" -filter" , DEFAULT_BENCH_FILTER);
114
115
115
116
benchmark::BenchRunner::RunAll (args);
You can’t perform that action at this time.
0 commit comments