6bd5646f1b
Apparently on travis-ci, bash is linked to dash, which doesn't understand "let". Failing tests were not being noticed. See eg: https://travis-ci.org/behdad/harfbuzz/jobs/29544211 Don't rely on bash.
35 lines
710 B
Bash
Executable File
35 lines
710 B
Bash
Executable File
#!/bin/sh
|
|
|
|
test "x$srcdir" = x && srcdir=.
|
|
test "x$builddir" = x && builddir=.
|
|
test "x$top_builddir" = x && top_builddir=../..
|
|
|
|
hb_shape=$top_builddir/util/hb-shape$EXEEXT
|
|
|
|
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
|
|
fails=$((fails+1))
|
|
fi
|
|
done < "$f"
|
|
done
|
|
|
|
if test $fails != 0; then
|
|
echo "$fails tests failed."
|
|
exit 1
|
|
else
|
|
echo "All tests passed."
|
|
fi
|