[test] Write one sequence per-line
https://github.com/harfbuzz/harfbuzz/pull/3087#issuecomment-888691436
This commit is contained in:
parent
ddf87ffb22
commit
9a7ff54bb7
|
@ -86,26 +86,13 @@ with open(sys.argv[2]) as f:
|
||||||
if ";" in line:
|
if ";" in line:
|
||||||
line = line[:line.index(";")]
|
line = line[:line.index(";")]
|
||||||
line = line.strip()
|
line = line.strip()
|
||||||
if not line:
|
|
||||||
continue
|
|
||||||
line = line.split(" ")
|
line = line.split(" ")
|
||||||
if len(line) == 1:
|
if len(line) < 2:
|
||||||
continue
|
continue
|
||||||
sequences.append(line)
|
sequences.append(line)
|
||||||
|
|
||||||
# Split into number of sequences per line, too small number slows the test, and
|
|
||||||
# too big overwhelms the test runner.
|
|
||||||
CHUNK = 50
|
|
||||||
with open("../test/shaping/data/in-house/tests/emoji-clusters.tests", "w") as f:
|
with open("../test/shaping/data/in-house/tests/emoji-clusters.tests", "w") as f:
|
||||||
for i in range(0, len(sequences), CHUNK):
|
for sequence in sequences:
|
||||||
outputs = []
|
|
||||||
inputs = []
|
|
||||||
cluster = 0
|
|
||||||
for sequence in sequences[i:i + CHUNK]:
|
|
||||||
outputs.append("|".join(f"1={cluster}" for c in sequence))
|
|
||||||
inputs.append(",".join(sequence))
|
|
||||||
cluster += len(sequence)
|
|
||||||
|
|
||||||
f.write("../fonts/AdobeBlank2.ttf:--no-glyph-names --no-positions --font-funcs=ot")
|
f.write("../fonts/AdobeBlank2.ttf:--no-glyph-names --no-positions --font-funcs=ot")
|
||||||
f.write(":" + ",".join(inputs))
|
f.write(":" + ",".join(sequence))
|
||||||
f.write(":[" + "|".join(outputs) + "]\n")
|
f.write(":[" + "|".join("1=0" for c in sequence) + "]\n")
|
||||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue