Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
422debb8
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看板
提交
422debb8
编写于
10月 30, 2018
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[test/shaping] Spawn one hb-shape per test file
Speeds up runnings in-house tests from over 20s to 2s.
上级
58e20f53
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
12 addition
and
20 deletion
+12
-20
test/shaping/run-tests.py
test/shaping/run-tests.py
+12
-20
未找到文件。
test/shaping/run-tests.py
浏览文件 @
422debb8
...
@@ -2,16 +2,13 @@
...
@@ -2,16 +2,13 @@
from
__future__
import
print_function
,
division
,
absolute_import
from
__future__
import
print_function
,
division
,
absolute_import
import
sys
,
os
,
subprocess
,
tempfile
import
sys
,
os
,
subprocess
def
cmd
(
command
):
def
cmd
(
command
):
# https://stackoverflow.com/a/4408409
global
process
with
tempfile
.
TemporaryFile
()
as
tempf
:
process
.
stdin
.
write
(
' '
.
join
(
command
)
+
'
\n
'
)
p
=
subprocess
.
Popen
(
command
,
stdout
=
tempf
,
stderr
=
sys
.
stdout
)
process
.
stdin
.
flush
()
p
.
wait
()
return
process
.
stdout
.
readline
().
decode
(
"utf-8"
).
strip
()
tempf
.
seek
(
0
)
return
tempf
.
read
().
decode
(
"utf-8"
).
strip
(),
p
.
returncode
args
=
sys
.
argv
[
1
:]
args
=
sys
.
argv
[
1
:]
if
not
args
or
sys
.
argv
[
1
].
find
(
'hb-shape'
)
==
-
1
or
not
os
.
path
.
exists
(
sys
.
argv
[
1
]):
if
not
args
or
sys
.
argv
[
1
].
find
(
'hb-shape'
)
==
-
1
or
not
os
.
path
.
exists
(
sys
.
argv
[
1
]):
...
@@ -19,6 +16,11 @@ if not args or sys.argv[1].find('hb-shape') == -1 or not os.path.exists (sys.arg
...
@@ -19,6 +16,11 @@ if not args or sys.argv[1].find('hb-shape') == -1 or not os.path.exists (sys.arg
sys
.
exit
(
1
)
sys
.
exit
(
1
)
hb_shape
,
args
=
args
[
0
],
args
[
1
:]
hb_shape
,
args
=
args
[
0
],
args
[
1
:]
process
=
subprocess
.
Popen
([
hb_shape
,
'--batch'
],
stdin
=
subprocess
.
PIPE
,
stdout
=
subprocess
.
PIPE
,
stderr
=
sys
.
stdout
)
fails
=
0
fails
=
0
reference
=
False
reference
=
False
...
@@ -60,24 +62,14 @@ for filename in args:
...
@@ -60,24 +62,14 @@ for filename in args:
print
(
"%s %s %s %s --unicodes %s"
%
print
(
"%s %s %s %s --unicodes %s"
%
(
hb_shape
,
fontfile
,
' '
.
join
(
extra_options
),
options
,
unicodes
))
(
hb_shape
,
fontfile
,
' '
.
join
(
extra_options
),
options
,
unicodes
))
glyphs1
,
returncode
=
cmd
([
hb_shape
,
"--font-funcs=ft"
,
glyphs1
=
cmd
([
hb_shape
,
"--font-funcs=ft"
,
fontfile
]
+
extra_options
+
[
"--unicodes"
,
fontfile
]
+
extra_options
+
[
"--unicodes"
,
unicodes
]
+
(
options
.
split
(
' '
)
if
options
else
[]))
unicodes
]
+
(
options
.
split
(
' '
)
if
options
else
[]))
if
returncode
:
glyphs2
=
cmd
([
hb_shape
,
"--font-funcs=ot"
,
print
(
"ERROR: hb-shape --font-funcs=ft failed."
)
# file=sys.stderr
fails
=
fails
+
1
#continue
glyphs2
,
returncode
=
cmd
([
hb_shape
,
"--font-funcs=ot"
,
fontfile
]
+
extra_options
+
[
"--unicodes"
,
fontfile
]
+
extra_options
+
[
"--unicodes"
,
unicodes
]
+
(
options
.
split
(
' '
)
if
options
else
[]))
unicodes
]
+
(
options
.
split
(
' '
)
if
options
else
[]))
if
returncode
:
print
(
"ERROR: hb-shape --font-funcs=ot failed."
)
# file=sys.stderr
fails
=
fails
+
1
#continue
if
glyphs1
!=
glyphs2
and
glyphs_expected
!=
'*'
:
if
glyphs1
!=
glyphs2
and
glyphs_expected
!=
'*'
:
print
(
"FT funcs: "
+
glyphs1
)
# file=sys.stderr
print
(
"FT funcs: "
+
glyphs1
)
# file=sys.stderr
print
(
"OT funcs: "
+
glyphs2
)
# file=sys.stderr
print
(
"OT funcs: "
+
glyphs2
)
# file=sys.stderr
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录