1#!/bin/sh 2 3test "x$srcdir" = x && srcdir=. 4test "x$builddir" = x && builddir=. 5test "x$top_builddir" = x && top_builddir=../.. 6 7hb_shape=$top_builddir/util/hb-shape$EXEEXT 8 9fails=0 10 11if test $# = 0; then 12 set /dev/stdin 13fi 14 15IFS=: 16for f in "$@"; do 17 echo "Running tests in $f" 18 while read fontfile unicodes glyphs_expected; do 19 echo "Testing $fontfile:$unicodes" 20 glyphs=`$srcdir/hb-unicode-encode "$unicodes" | $hb_shape "$srcdir/$fontfile"` 21 if ! test "x$glyphs" = "x$glyphs_expected"; then 22 echo "Actual: $glyphs" >&2 23 echo "Expected: $glyphs_expected" >&2 24 fails=$((fails+1)) 25 fi 26 done < "$f" 27done 28 29if test $fails != 0; then 30 echo "$fails tests failed." 31 exit 1 32else 33 echo "All tests passed." 34fi 35