Browse Source

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

pull/1/head
Sam Hocevar sam 15 years ago
parent
commit
8beb7e82ee
4 changed files with 43 additions and 3 deletions
  1. +2
    -0
      fonts/Makefile.am
  2. +2
    -2
      test/Makefile.am
  3. +5
    -1
      test/check-build
  4. +34
    -0
      test/check-fonts

+ 2
- 0
fonts/Makefile.am View File

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


echo-fonts: ; echo $(allfonts)


+ 2
- 2
test/Makefile.am View File

@@ -1,6 +1,6 @@
# $Id$ # $Id$


EXTRA_DIST = check-build
EXTRA_DIST = check-build check-fonts


TESTS = check-build
TESTS = check-build check-fonts



+ 5
- 1
test/check-build View File

@@ -8,7 +8,11 @@ ret=0
failure=0 failure=0
for dir in src tools; do for dir in src tools; do
pushd ../$dir >/dev/null 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 if grep '[[:space:]]$' "$x" >/dev/null 2>&1; then
echo "error: $dir/$x contains trailing spaces" echo "error: $dir/$x contains trailing spaces"
failure=1 failure=1


+ 34
- 0
test/check-fonts 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


Loading…
Cancel
Save