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
af441fc1
Commit
af441fc1
authored
Aug 16, 2018
by
BaaMeow
Committed by
Dominic Hamon
Aug 16, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
properly escape json names (#652)
parent
94c4d6d5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
2 deletions
+8
-2
json_reporter.cc
src/json_reporter.cc
+6
-1
reporter_output_test.cc
test/reporter_output_test.cc
+2
-1
No files found.
src/json_reporter.cc
View file @
af441fc1
...
...
@@ -78,7 +78,12 @@ bool JSONReporter::ReportContext(const Context& context) {
out
<<
indent
<<
FormatKV
(
"date"
,
walltime_value
)
<<
",
\n
"
;
if
(
Context
::
executable_name
)
{
out
<<
indent
<<
FormatKV
(
"executable"
,
Context
::
executable_name
)
<<
",
\n
"
;
// windows uses backslash for its path separator,
// which must be escaped in JSON otherwise it blows up conforming JSON
// decoders
std
::
string
executable_name
=
Context
::
executable_name
;
ReplaceAll
(
&
executable_name
,
"
\\
"
,
"
\\\\
"
);
out
<<
indent
<<
FormatKV
(
"executable"
,
executable_name
)
<<
",
\n
"
;
}
CPUInfo
const
&
info
=
context
.
cpu_info
;
...
...
test/reporter_output_test.cc
View file @
af441fc1
...
...
@@ -23,7 +23,8 @@ static int AddContextCases() {
{{
"^
\\
{"
,
MR_Default
},
{
"
\"
context
\"
:"
,
MR_Next
},
{
"
\"
date
\"
:
\"
"
,
MR_Next
},
{
"
\"
executable
\"
:
\"
.*/reporter_output_test(
\\
.exe)?
\"
,"
,
MR_Next
},
{
"
\"
executable
\"
:
\"
.*(/|
\\\\
)reporter_output_test(
\\
.exe)?
\"
,"
,
MR_Next
},
{
"
\"
num_cpus
\"
: %int,$"
,
MR_Next
},
{
"
\"
mhz_per_cpu
\"
: %float,$"
,
MR_Next
},
{
"
\"
cpu_scaling_enabled
\"
: "
,
MR_Next
},
...
...
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