Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
5f061d27
T
Third Party Harfbuzz
项目概览
OpenHarmony
/
Third Party Harfbuzz
接近 2 年 前同步成功
通知
1
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看板
未验证
提交
5f061d27
编写于
12月 07, 2017
作者:
E
ebraminio
提交者:
GitHub
12月 07, 2017
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Rewrite run-tests in python (#647)
上级
3ce6c7bd
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
117 addition
and
67 deletion
+117
-67
test/shaping/Makefile.am
test/shaping/Makefile.am
+2
-2
test/shaping/run-tests.py
test/shaping/run-tests.py
+115
-0
test/shaping/run-tests.sh
test/shaping/run-tests.sh
+0
-65
未找到文件。
test/shaping/Makefile.am
浏览文件 @
5f061d27
...
@@ -26,7 +26,7 @@ EXTRA_DIST += \
...
@@ -26,7 +26,7 @@ EXTRA_DIST += \
hb-unicode-encode
\
hb-unicode-encode
\
hb-unicode-prettyname
\
hb-unicode-prettyname
\
record-test.sh
\
record-test.sh
\
run-tests.
sh
\
run-tests.
py
\
texts/in-tree
\
texts/in-tree
\
fonts/sha1sum
\
fonts/sha1sum
\
$(TESTS)
\
$(TESTS)
\
...
@@ -104,7 +104,7 @@ TESTS_ENVIRONMENT = \
...
@@ -104,7 +104,7 @@ TESTS_ENVIRONMENT = \
$(NULL)
$(NULL)
endif
endif
TESTS_LOG_COMPILER
=
sh
$(srcdir)
/run-tests.sh
TESTS_LOG_COMPILER
=
python
$(srcdir)
/run-tests.py
.PHONY
:
manifests
.PHONY
:
manifests
...
...
test/shaping/run-tests.py
0 → 100755
浏览文件 @
5f061d27
#!/usr/bin/env python
from
__future__
import
print_function
import
sys
,
os
,
subprocess
try
:
input
=
raw_input
except
NameError
:
pass
def
cmd
(
command
):
p
=
subprocess
.
Popen
(
command
,
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
)
p
.
wait
()
print
(
p
.
stderr
.
read
(),
file
=
sys
.
stderr
)
return
p
.
stdout
.
read
().
decode
(
"utf-8"
),
p
.
returncode
srcdir
=
os
.
environ
.
get
(
"srcdir"
,
"."
)
builddir
=
os
.
environ
.
get
(
"builddir"
,
"."
)
top_builddir
=
os
.
environ
.
get
(
"top_builddir"
,
os
.
path
.
normpath
(
os
.
path
.
join
(
os
.
getcwd
(),
".."
,
".."
)))
EXEEXT
=
os
.
environ
.
get
(
"EXEEXT"
,
""
)
extra_options
=
"--verify"
hb_shape
=
os
.
path
.
join
(
top_builddir
,
"util"
,
"hb-shape"
+
EXEEXT
)
fails
=
0
args
=
sys
.
argv
[
1
:]
reference
=
False
if
len
(
args
)
and
args
[
0
]
==
"--reference"
:
reference
=
True
args
=
args
[
1
:]
if
not
len
(
args
):
args
=
[
sys
.
stdin
]
for
f
in
args
:
if
not
reference
:
if
f
==
sys
.
stdin
:
print
(
"Running tests from standard input"
)
else
:
print
(
"Running tests in "
+
f
)
if
f
==
sys
.
stdin
:
def
f
():
while
True
:
try
:
line
=
input
()
except
EOFError
:
break
if
len
(
line
):
yield
line
else
:
break
f
=
f
()
else
:
f
=
open
(
f
)
for
line
in
f
:
if
line
.
startswith
(
"#"
):
continue
fontfile
,
options
,
unicodes
,
glyphs_expected
=
line
.
split
(
":"
)
if
not
reference
:
print
(
"# hb-shape %s --unicodes %s"
%
(
fontfile
,
unicodes
))
if
not
reference
:
print
(
"hb-shape %s %s %s --unicodes %s"
%
(
fontfile
,
extra_options
,
options
,
unicodes
))
glyphs1
,
returncode
=
cmd
([
hb_shape
,
"--font-funcs=ft"
,
os
.
path
.
join
(
srcdir
,
fontfile
),
extra_options
,
"--unicodes"
,
unicodes
]
+
(
options
.
split
(
' '
)
if
len
(
options
)
else
[]))
if
returncode
:
print
(
"hb-shape --font-funcs=ft failed."
,
file
=
sys
.
stderr
)
fails
=
fails
+
1
#continue
glyphs2
,
returncode
=
cmd
([
hb_shape
,
"--font-funcs=ot"
,
os
.
path
.
join
(
srcdir
,
fontfile
),
extra_options
,
"--unicodes"
,
unicodes
]
+
(
options
.
split
(
' '
)
if
len
(
options
)
else
[]))
if
returncode
:
print
(
"hb-shape --font-funcs=ot failed."
,
file
=
sys
.
stderr
)
fails
=
fails
+
1
#continue
if
glyphs1
!=
glyphs2
:
print
(
"FT funcs: "
+
glyphs1
,
file
=
sys
.
stderr
)
print
(
"OT funcs: "
+
glyphs2
,
file
=
sys
.
stderr
)
fails
=
fails
+
1
if
reference
:
print
(
":"
.
join
([
fontfile
,
options
,
unicodes
,
glyphs1
]))
continue
if
glyphs1
.
strip
()
!=
glyphs_expected
.
strip
():
print
(
"Actual: "
+
glyphs1
,
file
=
sys
.
stderr
)
print
(
"Expected: "
+
glyphs_expected
,
file
=
sys
.
stderr
)
fails
=
fails
+
1
if
fails
!=
0
:
if
not
reference
:
print
(
str
(
fails
)
+
" tests failed."
)
sys
.
exit
(
1
)
else
:
if
not
reference
:
print
(
"All tests passed."
)
test/shaping/run-tests.sh
已删除
100755 → 0
浏览文件 @
3ce6c7bd
#!/bin/sh
test
"x
$srcdir
"
=
x
&&
srcdir
=
.
test
"x
$builddir
"
=
x
&&
builddir
=
.
test
"x
$top_builddir
"
=
x
&&
top_builddir
=
../..
extra_options
=
"--verify"
hb_shape
=
"
$top_builddir
/util/hb-shape
$EXEEXT
"
#hb_shape="$top_builddir/util/hb-shape$EXEEXT"
fails
=
0
reference
=
false
if
test
"x
$1
"
=
x--reference
;
then
reference
=
true
shift
fi
if
test
$#
=
0
;
then
set
/dev/stdin
fi
for
f
in
"
$@
"
;
do
$reference
||
echo
"Running tests in
$f
"
while
IFS
=
:
read
fontfile options unicodes glyphs_expected
;
do
if
echo
"
$fontfile
"
|
grep
-q
'^#'
;
then
$reference
||
echo
"# hb-shape
$fontfile
--unicodes
$unicodes
"
continue
fi
$reference
||
echo
"hb-shape
$fontfile
$extra_options
$options
--unicodes
$unicodes
"
glyphs1
=
`
$hb_shape
--font-funcs
=
ft
"
$srcdir
/
$fontfile
"
$extra_options
$options
--unicodes
"
$unicodes
"
`
if
test
$?
!=
0
;
then
echo
"hb-shape --font-funcs=ft failed."
>
&2
fails
=
$((
fails+1
))
#continue
fi
glyphs2
=
`
$hb_shape
--font-funcs
=
ot
"
$srcdir
/
$fontfile
"
$extra_options
$options
--unicodes
"
$unicodes
"
`
if
test
$?
!=
0
;
then
echo
"hb-shape --font-funcs=ot failed."
>
&2
fails
=
$((
fails+1
))
#continue
fi
if
!
test
"x
$glyphs1
"
=
"x
$glyphs2
"
;
then
echo
"FT funcs:
$glyphs1
"
>
&2
echo
"OT funcs:
$glyphs2
"
>
&2
fails
=
$((
fails+1
))
fi
if
$reference
;
then
echo
"
$fontfile
:
$options
:
$unicodes
:
$glyphs1
"
continue
fi
if
!
test
"x
$glyphs1
"
=
"x
$glyphs_expected
"
;
then
echo
"Actual:
$glyphs1
"
>
&2
echo
"Expected:
$glyphs_expected
"
>
&2
fails
=
$((
fails+1
))
fi
done
<
"
$f
"
done
if
test
$fails
!=
0
;
then
$reference
||
echo
"
$fails
tests failed."
exit
1
else
$reference
||
echo
"All tests passed."
fi
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录