mirror of
https://gitee.com/openharmony/third_party_benchmark
synced 2024-11-23 15:30:48 +00:00
Merge pull request #143 from devjgm/master
Updates Initialize() to work with an argv as 'char**'
This commit is contained in:
commit
eeaec441a7
@ -151,7 +151,7 @@ BENCHMARK(BM_MultiThreaded)->Threads(4);
|
||||
namespace benchmark {
|
||||
class BenchmarkReporter;
|
||||
|
||||
void Initialize(int* argc, const char** argv);
|
||||
void Initialize(int* argc, char** argv);
|
||||
|
||||
// Otherwise, run all benchmarks specified by the --benchmark_filter flag,
|
||||
// and exit after running the benchmarks.
|
||||
@ -593,10 +593,10 @@ protected: \
|
||||
|
||||
|
||||
// Helper macro to create a main routine in a test that runs the benchmarks
|
||||
#define BENCHMARK_MAIN() \
|
||||
int main(int argc, const char** argv) { \
|
||||
::benchmark::Initialize(&argc, argv); \
|
||||
::benchmark::RunSpecifiedBenchmarks(); \
|
||||
#define BENCHMARK_MAIN() \
|
||||
int main(int argc, char** argv) { \
|
||||
::benchmark::Initialize(&argc, argv); \
|
||||
::benchmark::RunSpecifiedBenchmarks(); \
|
||||
}
|
||||
|
||||
#endif // BENCHMARK_BENCHMARK_API_H_
|
||||
|
@ -863,7 +863,7 @@ void PrintUsageAndExit() {
|
||||
exit(0);
|
||||
}
|
||||
|
||||
void ParseCommandLineFlags(int* argc, const char** argv) {
|
||||
void ParseCommandLineFlags(int* argc, char** argv) {
|
||||
using namespace benchmark;
|
||||
for (int i = 1; i < *argc; ++i) {
|
||||
if (
|
||||
@ -904,7 +904,7 @@ Benchmark* RegisterBenchmarkInternal(Benchmark* bench) {
|
||||
|
||||
} // end namespace internal
|
||||
|
||||
void Initialize(int* argc, const char** argv) {
|
||||
void Initialize(int* argc, char** argv) {
|
||||
internal::ParseCommandLineFlags(argc, argv);
|
||||
internal::SetLogLevel(FLAGS_v);
|
||||
// TODO remove this. It prints some output the first time it is called.
|
||||
|
@ -67,7 +67,7 @@ BENCHMARK(BM_FooBa);
|
||||
|
||||
|
||||
|
||||
int main(int argc, const char* argv[]) {
|
||||
int main(int argc, char* argv[]) {
|
||||
benchmark::Initialize(&argc, argv);
|
||||
|
||||
TestReporter test_reporter;
|
||||
@ -82,4 +82,3 @@ int main(int argc, const char* argv[]) {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user