harfbuzz/test/shaping/run-tests.sh
Behdad Esfahbod 841e20d083 Add test suite for shaping results
The new test suite runs tests included under
hb/test/shaping/tests/*.tests, which themselves reference
font files stored by sha1sum under hb/test/shaping/fonts/sha1sum.
The fonts are produced using a subsetter to only include glyphs
needed to run the test.

Four initial tests are added for (Chain)Context matching,
of which three currently fail.
2013-10-14 18:54:51 +02:00

35 lines
705 B
Bash
Executable File

#!/bin/bash
test "x$srcdir" = x && srcdir=.
test "x$builddir" = x && builddir=.
test "x$top_builddir" = x && top_builddir=../..
hb_shape=$top_builddir/util/hb-shape
fails=0
if test $# = 0; then
set /dev/stdin
fi
IFS=:
for f in "$@"; do
echo "Running tests in $f"
while read fontfile unicodes glyphs_expected; do
echo "Testing $fontfile:$unicodes"
glyphs=`$srcdir/hb-unicode-encode "$unicodes" | $hb_shape "$srcdir/$fontfile"`
if ! test "x$glyphs" = "x$glyphs_expected"; then
echo "Actual: $glyphs" >&2
echo "Expected: $glyphs_expected" >&2
let fails=$fails+1
fi
done < "$f"
done
if test $fails != 0; then
echo "$fails tests failed."
exit 1
else
echo "All tests passed."
fi