Add a test to check that all fonts can be loaded.

This commit is contained in:
Sam Hocevar 2010-01-24 01:47:14 +00:00 committed by sam
parent 98eaf9d35d
commit 8beb7e82ee
4 changed files with 43 additions and 3 deletions

View file

@ -11,3 +11,5 @@ EXTRA_DIST = $(allfonts)
font_DATA = $(allfonts)
fontdir = $(datadir)/figlet
echo-fonts: ; echo $(allfonts)

View file

@ -1,6 +1,6 @@
# $Id$
EXTRA_DIST = check-build
EXTRA_DIST = check-build check-fonts
TESTS = check-build
TESTS = check-build check-fonts

View file

@ -8,7 +8,11 @@ ret=0
failure=0
for dir in src tools; do
pushd ../$dir >/dev/null
for x in $(make echo-sources); do
for x in $(make -s echo-sources); do
case "$x" in
*.c|*.cpp|*.h|*.m) ;;
*) continue ;;
esac
if grep '[[:space:]]$' "$x" >/dev/null 2>&1; then
echo "error: $dir/$x contains trailing spaces"
failure=1

34
test/check-fonts Executable file
View file

@ -0,0 +1,34 @@
#!/bin/sh
ret=0
#
# Check that we have no tabs or trailing spaces in the source code
#
failure=0
(cd ../fonts
for x in $(make -s echo-fonts); do
case "$x" in
*.tlf|*.flf) ;;
*) continue ;;
esac
echo "Checking font $x..."
if ../src/toilet -d ../fonts -f "$x" Hello World >/dev/null; then
:
else
echo "Error loading font $x"
failure=1
fi
done)
if test "$failure" != "0"; then
ret=1
else
echo "0 errors in fonts"
fi
if test "$ret" != "0"; then
exit 1
fi
exit 0