Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Xiph.Org
aom-rav1e
Commits
01aae92d
Commit
01aae92d
authored
Apr 07, 2014
by
Joshua Litt
Committed by
Gerrit Code Review
Apr 07, 2014
Browse files
Merge "Small fixes to script based off of cry-infra"
parents
e8c1c95c
15931a1d
Changes
1
Hide whitespace changes
Inline
Side-by-side
test/android/scrape_gtest_log.py
View file @
01aae92d
...
...
@@ -13,16 +13,45 @@ waterfall to gather json results mixed in with gtest logs. This is
dubious software engineering.
"""
import
getopt
import
json
import
os
import
re
import
sys
def
main
():
if
len
(
sys
.
argv
)
!=
3
:
print
"Expects a file to write json to!"
exit
(
1
)
try
:
opts
,
_
=
\
getopt
.
getopt
(
sys
.
argv
[
1
:],
\
'o:'
,
[
'output-json='
])
except
getopt
.
GetOptError
:
print
'scrape_gtest_log.py -o <output_json>'
sys
.
exit
(
2
)
output_json
=
''
for
opt
,
arg
in
opts
:
if
opt
in
(
'-o'
,
'--output-json'
):
output_json
=
os
.
path
.
join
(
arg
)
blob
=
sys
.
stdin
.
read
()
json_string
=
'['
+
','
.
join
(
'{'
+
x
+
'}'
for
x
in
re
.
findall
(
r
'{([^}]*.?)}'
,
blob
))
+
']'
print
json
.
dumps
(
json
.
loads
(
json_string
),
indent
=
4
,
sort_keys
=
True
)
print
blob
output
=
json
.
dumps
(
json
.
loads
(
json_string
),
indent
=
4
,
sort_keys
=
True
)
print
output
path
=
os
.
path
.
dirname
(
output_json
)
if
path
and
not
os
.
path
.
exists
(
path
):
os
.
makedirs
(
path
)
outfile
=
open
(
output_json
,
'w'
)
outfile
.
write
(
output
)
if
__name__
==
'__main__'
:
sys
.
exit
(
main
())
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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