Add a test to check that all fonts can be loaded.
This commit is contained in:
parent
98eaf9d35d
commit
8beb7e82ee
4 changed files with 43 additions and 3 deletions
|
@ -11,3 +11,5 @@ EXTRA_DIST = $(allfonts)
|
||||||
font_DATA = $(allfonts)
|
font_DATA = $(allfonts)
|
||||||
fontdir = $(datadir)/figlet
|
fontdir = $(datadir)/figlet
|
||||||
|
|
||||||
|
echo-fonts: ; echo $(allfonts)
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
# $Id$
|
# $Id$
|
||||||
|
|
||||||
EXTRA_DIST = check-build
|
EXTRA_DIST = check-build check-fonts
|
||||||
|
|
||||||
TESTS = check-build
|
TESTS = check-build check-fonts
|
||||||
|
|
||||||
|
|
|
@ -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
test/check-fonts
Executable file
34
test/check-fonts
Executable 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…
Reference in a new issue