提交 ee3a3e10 编写于 作者: B Behdad Esfahbod

[tests/shaping] Allow comments in test files

Line should start with "# ".
上级 ed900ee9
...@@ -47,6 +47,20 @@ for filename in args: ...@@ -47,6 +47,20 @@ for filename in args:
f = open (filename) f = open (filename)
for line in f: for line in f:
comment = False
if line.startswith ("#"):
comment = True
line = line[1:]
if line.startswith (' '):
if not reference:
print ("#%s" % line)
continue
line = line.strip ()
if not line:
continue
fontfile, options, unicodes, glyphs_expected = line.split (":") fontfile, options, unicodes, glyphs_expected = line.split (":")
if fontfile.startswith ('/') or fontfile.startswith ('"/'): if fontfile.startswith ('/') or fontfile.startswith ('"/'):
fontfile, expected_hash = fontfile.split('@') fontfile, expected_hash = fontfile.split('@')
...@@ -68,11 +82,10 @@ for filename in args: ...@@ -68,11 +82,10 @@ for filename in args:
fontfile = os.path.normpath (os.path.join (cwd, fontfile)) fontfile = os.path.normpath (os.path.join (cwd, fontfile))
extra_options = ["--shaper=ot"] extra_options = ["--shaper=ot"]
glyphs_expected = glyphs_expected.strip()
if glyphs_expected != '*': if glyphs_expected != '*':
extra_options.append("--verify") extra_options.append("--verify")
if line.startswith ("#"): if comment:
if not reference: if not reference:
print ("# %s %s --unicodes %s" % (hb_shape, fontfile, unicodes)) print ("# %s %s --unicodes %s" % (hb_shape, fontfile, unicodes))
continue continue
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册