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
2555035f
Commit
2555035f
authored
Oct 07, 2016
by
Eric Fiselier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use correct RE for floating point numbers in reporter_output_test.cc
parent
332f677b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
5 deletions
+6
-5
complexity_test.cc
test/complexity_test.cc
+1
-1
output_test_helper.cc
test/output_test_helper.cc
+4
-3
reporter_output_test.cc
test/reporter_output_test.cc
+1
-1
No files found.
test/complexity_test.cc
View file @
2555035f
...
@@ -16,7 +16,7 @@ int AddComplexityTest(std::string big_o_test_name, std::string rms_test_name,
...
@@ -16,7 +16,7 @@ int AddComplexityTest(std::string big_o_test_name, std::string rms_test_name,
std
::
string
big_o
)
{
std
::
string
big_o
)
{
SetSubstitutions
({{
"%bigo_name"
,
big_o_test_name
},
SetSubstitutions
({{
"%bigo_name"
,
big_o_test_name
},
{
"%rms_name"
,
rms_test_name
},
{
"%rms_name"
,
rms_test_name
},
{
"%bigo_str"
,
"[ ]*
"
+
std
::
string
(
dec_re
)
+
"
"
+
big_o
},
{
"%bigo_str"
,
"[ ]*
%float
"
+
big_o
},
{
"%bigo"
,
big_o
},
{
"%bigo"
,
big_o
},
{
"%rms"
,
"[ ]*[0-9]+ %"
}});
{
"%rms"
,
"[ ]*[0-9]+ %"
}});
AddCases
(
AddCases
(
...
...
test/output_test_helper.cc
View file @
2555035f
...
@@ -160,16 +160,17 @@ int AddCases(TestCaseID ID, std::initializer_list<TestCase> il) {
...
@@ -160,16 +160,17 @@ int AddCases(TestCaseID ID, std::initializer_list<TestCase> il) {
int
SetSubstitutions
(
int
SetSubstitutions
(
std
::
initializer_list
<
std
::
pair
<
std
::
string
,
std
::
string
>>
il
)
{
std
::
initializer_list
<
std
::
pair
<
std
::
string
,
std
::
string
>>
il
)
{
auto
&
subs
=
internal
::
GetSubstitutions
();
auto
&
subs
=
internal
::
GetSubstitutions
();
for
(
auto
const
&
KV
:
il
)
{
for
(
auto
KV
:
il
)
{
bool
exists
=
false
;
bool
exists
=
false
;
KV
.
second
=
internal
::
PerformSubstitutions
(
KV
.
second
);
for
(
auto
&
EKV
:
subs
)
{
for
(
auto
&
EKV
:
subs
)
{
if
(
EKV
.
first
==
KV
.
first
)
{
if
(
EKV
.
first
==
KV
.
first
)
{
EKV
.
second
=
KV
.
second
;
EKV
.
second
=
std
::
move
(
KV
.
second
)
;
exists
=
true
;
exists
=
true
;
break
;
break
;
}
}
}
}
if
(
!
exists
)
subs
.
push_back
(
KV
);
if
(
!
exists
)
subs
.
push_back
(
std
::
move
(
KV
)
);
}
}
return
0
;
return
0
;
}
}
...
...
test/reporter_output_test.cc
View file @
2555035f
...
@@ -61,7 +61,7 @@ void BM_Complexity_O1(benchmark::State& state) {
...
@@ -61,7 +61,7 @@ void BM_Complexity_O1(benchmark::State& state) {
state
.
SetComplexityN
(
state
.
range
(
0
));
state
.
SetComplexityN
(
state
.
range
(
0
));
}
}
BENCHMARK
(
BM_Complexity_O1
)
->
Range
(
1
,
1
<<
18
)
->
Complexity
(
benchmark
::
o1
);
BENCHMARK
(
BM_Complexity_O1
)
->
Range
(
1
,
1
<<
18
)
->
Complexity
(
benchmark
::
o1
);
SET_SUBSTITUTIONS
({{
"%bigOStr"
,
"[ ]*
[0-9]+
\\
.[0-9]+
\\
([0-9]+
\\
)"
},
SET_SUBSTITUTIONS
({{
"%bigOStr"
,
"[ ]*
%float
\\
([0-9]+
\\
)"
},
{
"%RMS"
,
"[ ]*[0-9]+ %"
}});
{
"%RMS"
,
"[ ]*[0-9]+ %"
}});
ADD_CASES
(
TC_ConsoleOut
,
{{
"^BM_Complexity_O1_BigO %bigOStr %bigOStr[ ]*$"
},
ADD_CASES
(
TC_ConsoleOut
,
{{
"^BM_Complexity_O1_BigO %bigOStr %bigOStr[ ]*$"
},
{
"^BM_Complexity_O1_RMS %RMS %RMS[ ]*$"
}});
{
"^BM_Complexity_O1_RMS %RMS %RMS[ ]*$"
}});
...
...
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