[tests/shaping] Allow comments in test files

Line should start with "# ".
This commit is contained in:
Behdad Esfahbod 2018-11-24 15:37:01 -05:00
parent ed900ee9af
commit ee3a3e10d4
1 changed files with 15 additions and 2 deletions

View File

@ -47,6 +47,20 @@ for filename in args:
f = open (filename)
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 (":")
if fontfile.startswith ('/') or fontfile.startswith ('"/'):
fontfile, expected_hash = fontfile.split('@')
@ -68,11 +82,10 @@ for filename in args:
fontfile = os.path.normpath (os.path.join (cwd, fontfile))
extra_options = ["--shaper=ot"]
glyphs_expected = glyphs_expected.strip()
if glyphs_expected != '*':
extra_options.append("--verify")
if line.startswith ("#"):
if comment:
if not reference:
print ("# %s %s --unicodes %s" % (hb_shape, fontfile, unicodes))
continue