1#!/bin/sh 2 3dir=`dirname "$0"` 4 5set -ex 6if test -d text-rendering-tests; then 7 cd text-rendering-tests 8 git pull 9 cd .. 10else 11 git clone https://github.com/unicode-org/text-rendering-tests 12fi 13 14test -d fonts && git rm -rf fonts 15test -d fonts && (echo "fonts/ dir not empty; investigate."; false) 16cp -a text-rendering-tests/fonts . 17git add fonts 18 19rmdir tests || true 20test -d tests && git rm -rf tests || true 21test -d tests && (echo "tests/ dir not empty; investigate."; false) 22mkdir tests 23 24echo "TESTS = \\" > Makefile.sources 25 26DISABLED="DISBALED_TESTS = \\" 27for x in text-rendering-tests/testcases/*.html; do 28 test "x$x" = xtext-rendering-tests/testcases/index.html && continue 29 out=tests/`basename "$x" .html`.tests 30 "$dir"/extract-tests.py < "$x" > "$out" 31 if grep -q "^$out$" DISABLED; then 32 DISABLED="$DISABLED 33 $out \\" 34 else 35 echo " $out \\" >> Makefile.sources 36 fi 37done 38git add tests 39 40echo ' $(NULL)' >> Makefile.sources 41echo >> Makefile.sources 42echo "$DISABLED" >> Makefile.sources 43echo ' $(NULL)' >> Makefile.sources 44git add Makefile.sources 45 46git commit -e -m "[test/text-rendering-tests] Update from upstream" 47