Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
benchmark
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
benchmark
Commits
eeaec441
Commit
eeaec441
authored
Sep 30, 2015
by
Dominic Hamon
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #143 from devjgm/master
Updates Initialize() to work with an argv as 'char**'
parents
7583ed93
2463339d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
9 deletions
+8
-9
benchmark_api.h
include/benchmark/benchmark_api.h
+5
-5
benchmark.cc
src/benchmark.cc
+2
-2
filter_test.cc
test/filter_test.cc
+1
-2
No files found.
include/benchmark/benchmark_api.h
View file @
eeaec441
...
@@ -151,7 +151,7 @@ BENCHMARK(BM_MultiThreaded)->Threads(4);
...
@@ -151,7 +151,7 @@ BENCHMARK(BM_MultiThreaded)->Threads(4);
namespace
benchmark
{
namespace
benchmark
{
class
BenchmarkReporter
;
class
BenchmarkReporter
;
void
Initialize
(
int
*
argc
,
c
onst
c
har
**
argv
);
void
Initialize
(
int
*
argc
,
char
**
argv
);
// Otherwise, run all benchmarks specified by the --benchmark_filter flag,
// Otherwise, run all benchmarks specified by the --benchmark_filter flag,
// and exit after running the benchmarks.
// and exit after running the benchmarks.
...
@@ -593,10 +593,10 @@ protected: \
...
@@ -593,10 +593,10 @@ protected: \
// Helper macro to create a main routine in a test that runs the benchmarks
// Helper macro to create a main routine in a test that runs the benchmarks
#define BENCHMARK_MAIN()
\
#define BENCHMARK_MAIN() \
int main(int argc, c
onst char** argv) {
\
int main(int argc, c
har** argv) {
\
::benchmark::Initialize(&argc, argv);
\
::benchmark::Initialize(&argc, argv); \
::benchmark::RunSpecifiedBenchmarks();
\
::benchmark::RunSpecifiedBenchmarks(); \
}
}
#endif // BENCHMARK_BENCHMARK_API_H_
#endif // BENCHMARK_BENCHMARK_API_H_
src/benchmark.cc
View file @
eeaec441
...
@@ -863,7 +863,7 @@ void PrintUsageAndExit() {
...
@@ -863,7 +863,7 @@ void PrintUsageAndExit() {
exit
(
0
);
exit
(
0
);
}
}
void
ParseCommandLineFlags
(
int
*
argc
,
c
onst
c
har
**
argv
)
{
void
ParseCommandLineFlags
(
int
*
argc
,
char
**
argv
)
{
using
namespace
benchmark
;
using
namespace
benchmark
;
for
(
int
i
=
1
;
i
<
*
argc
;
++
i
)
{
for
(
int
i
=
1
;
i
<
*
argc
;
++
i
)
{
if
(
if
(
...
@@ -904,7 +904,7 @@ Benchmark* RegisterBenchmarkInternal(Benchmark* bench) {
...
@@ -904,7 +904,7 @@ Benchmark* RegisterBenchmarkInternal(Benchmark* bench) {
}
// end namespace internal
}
// end namespace internal
void
Initialize
(
int
*
argc
,
c
onst
c
har
**
argv
)
{
void
Initialize
(
int
*
argc
,
char
**
argv
)
{
internal
::
ParseCommandLineFlags
(
argc
,
argv
);
internal
::
ParseCommandLineFlags
(
argc
,
argv
);
internal
::
SetLogLevel
(
FLAGS_v
);
internal
::
SetLogLevel
(
FLAGS_v
);
// TODO remove this. It prints some output the first time it is called.
// TODO remove this. It prints some output the first time it is called.
...
...
test/filter_test.cc
View file @
eeaec441
...
@@ -67,7 +67,7 @@ BENCHMARK(BM_FooBa);
...
@@ -67,7 +67,7 @@ BENCHMARK(BM_FooBa);
int
main
(
int
argc
,
c
onst
c
har
*
argv
[])
{
int
main
(
int
argc
,
char
*
argv
[])
{
benchmark
::
Initialize
(
&
argc
,
argv
);
benchmark
::
Initialize
(
&
argc
,
argv
);
TestReporter
test_reporter
;
TestReporter
test_reporter
;
...
@@ -82,4 +82,3 @@ int main(int argc, const char* argv[]) {
...
@@ -82,4 +82,3 @@ int main(int argc, const char* argv[]) {
return
-
1
;
return
-
1
;
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment