Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
bdfdac0f
T
Third Party Harfbuzz
项目概览
OpenHarmony
/
Third Party Harfbuzz
1 年多 前同步成功
通知
0
Star
18
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
Third Party Harfbuzz
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
bdfdac0f
编写于
7月 19, 2019
作者:
E
Ebrahim Byagowi
提交者:
GitHub
7月 19, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[ci][fuzzer] print valgrind failure if an error happened
上级
2bd953ff
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
17 addition
and
17 deletion
+17
-17
test/fuzzing/run-shape-fuzzer-tests.py
test/fuzzing/run-shape-fuzzer-tests.py
+17
-17
未找到文件。
test/fuzzing/run-shape-fuzzer-tests.py
浏览文件 @
bdfdac0f
...
...
@@ -5,41 +5,41 @@ from __future__ import print_function, division, absolute_import
import
sys
,
os
,
subprocess
,
tempfile
,
threading
def
which
(
program
):
def
which
(
program
):
# https://stackoverflow.com/a/377028
def
is_exe
(
fpath
):
return
os
.
path
.
isfile
(
fpath
)
and
os
.
access
(
fpath
,
os
.
X_OK
)
def
is_exe
(
fpath
):
return
os
.
path
.
isfile
(
fpath
)
and
os
.
access
(
fpath
,
os
.
X_OK
)
fpath
,
_
=
os
.
path
.
split
(
program
)
fpath
,
_
=
os
.
path
.
split
(
program
)
if
fpath
:
if
is_exe
(
program
):
if
is_exe
(
program
):
return
program
else
:
for
path
in
os
.
environ
[
"PATH"
].
split
(
os
.
pathsep
):
exe_file
=
os
.
path
.
join
(
path
,
program
)
if
is_exe
(
exe_file
):
for
path
in
os
.
environ
[
"PATH"
].
split
(
os
.
pathsep
):
exe_file
=
os
.
path
.
join
(
path
,
program
)
if
is_exe
(
exe_file
):
return
exe_file
return
None
def
cmd
(
command
):
def
cmd
(
command
):
# https://stackoverflow.com/a/4408409
# https://stackoverflow.com/a/10012262
with
tempfile
.
TemporaryFile
()
as
tempf
:
with
tempfile
.
TemporaryFile
()
as
tempf
:
p
=
subprocess
.
Popen
(
command
,
stderr
=
tempf
)
is_killed
=
{
'value'
:
False
}
def
timeout
(
p
,
is_killed
):
def
timeout
(
p
,
is_killed
):
is_killed
[
'value'
]
=
True
p
.
kill
()
p
.
kill
()
timer
=
threading
.
Timer
(
2
,
timeout
,
[
p
,
is_killed
])
try
:
timer
.
start
()
p
.
wait
()
tempf
.
seek
(
0
)
text
=
tempf
.
read
().
decode
(
"utf-8"
).
strip
()
text
=
tempf
.
read
().
decode
(
"utf-8"
).
strip
()
returncode
=
p
.
returncode
finally
:
timer
.
cancel
()
...
...
@@ -67,9 +67,9 @@ please provide it as the first argument to the tool""")
print
(
'hb_shape_fuzzer:'
,
hb_shape_fuzzer
)
fails
=
0
libtool
=
os
.
environ
.
get
(
'LIBTOOL'
)
libtool
=
os
.
environ
.
get
(
'LIBTOOL'
)
valgrind
=
None
if
os
.
environ
.
get
(
'RUN_VALGRIND'
,
''
):
if
os
.
environ
.
get
(
'RUN_VALGRIND'
,
''
):
valgrind
=
which
(
'valgrind'
)
if
valgrind
is
None
:
print
(
"""Valgrind requested but not found."""
)
...
...
@@ -80,7 +80,7 @@ if os.environ.get('RUN_VALGRIND', ''):
parent_path
=
os
.
path
.
join
(
srcdir
,
"fonts"
)
for
file
in
os
.
listdir
(
parent_path
):
path
=
os
.
path
.
join
(
parent_path
,
file
)
path
=
os
.
path
.
join
(
parent_path
,
file
)
if
valgrind
:
text
,
returncode
=
cmd
(
libtool
.
split
(
' '
)
+
[
'--mode=execute'
,
valgrind
+
' --leak-check=full --error-exitcode=1'
,
'--'
,
hb_shape_fuzzer
,
path
])
...
...
@@ -89,7 +89,7 @@ for file in os.listdir (parent_path):
if
'error'
in
text
:
returncode
=
1
if
not
valgrind
and
text
.
strip
():
if
(
not
valgrind
or
returncode
)
and
text
.
strip
():
print
(
text
)
if
returncode
!=
0
:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录