Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
b4ba71ea
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看板
提交
b4ba71ea
编写于
2月 28, 2018
作者:
G
Garret Rieger
提交者:
Behdad Esfahbod
2月 28, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[subset] In subset integration test pass output through ots-sanitize if present.
上级
588a4e0f
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
23 addition
and
2 deletion
+23
-2
test/subset/run-tests.py
test/subset/run-tests.py
+23
-2
未找到文件。
test/subset/run-tests.py
浏览文件 @
b4ba71ea
...
...
@@ -38,7 +38,7 @@ def fail_test(test, cli_args, message):
print
(
' expected_file %s'
%
os
.
path
.
abspath
(
expected_file
))
return
1
def
run_test
(
test
):
def
run_test
(
test
,
should_check_ots
):
out_file
=
os
.
path
.
join
(
tempfile
.
mkdtemp
(),
test
.
get_font_name
()
+
'-subset.ttf'
)
cli_args
=
[
hb_subset
,
"--font-file="
+
test
.
font_path
,
...
...
@@ -69,6 +69,11 @@ def run_test(test):
sys
.
stdout
.
flush
()
return
fail_test
(
test
,
cli_args
,
'ttx for expected and actual does not match.'
)
if
should_check_ots
:
print
(
"Checking output with ots-sanitize."
)
if
not
check_ots
(
out_file
):
return
fail_test
(
test
,
cli_args
,
'ots for subsetted file fails.'
)
return
0
def
run_ttx
(
file
):
...
...
@@ -82,6 +87,20 @@ def strip_check_sum (ttx_string):
'checkSumAdjustment value="0x00000000"'
,
ttx_string
,
count
=
1
)
def
has_ots
():
_
,
returncode
=
cmd
([
"which"
,
"ots-sanitize"
])
if
returncode
:
print
(
"OTS is not present, skipping all ots checks."
)
return
False
return
True
def
check_ots
(
path
):
ots_report
,
returncode
=
cmd
([
"ots-sanitize"
,
path
])
if
returncode
:
print
(
"OTS Failure: %s"
%
ots_report
);
return
False
return
True
args
=
sys
.
argv
[
1
:]
if
not
args
or
sys
.
argv
[
1
].
find
(
'hb-subset'
)
==
-
1
or
not
os
.
path
.
exists
(
sys
.
argv
[
1
]):
print
(
"First argument does not seem to point to usable hb-subset."
)
...
...
@@ -97,13 +116,15 @@ if returncode:
print
(
"TTX is not present, skipping test."
)
sys
.
exit
(
77
)
has_ots
=
has_ots
()
fails
=
0
for
path
in
args
:
with
io
.
open
(
path
,
mode
=
"r"
,
encoding
=
"utf-8"
)
as
f
:
print
(
"Running tests in "
+
path
)
test_suite
=
SubsetTestSuite
(
path
,
f
.
read
())
for
test
in
test_suite
.
tests
():
fails
+=
run_test
(
test
)
fails
+=
run_test
(
test
,
has_ots
)
if
fails
!=
0
:
print
(
str
(
fails
)
+
" test(s) failed."
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录