瀏覽代碼

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

pull/1/head
Sam Hocevar sam 15 年之前
父節點
當前提交
8beb7e82ee
共有 4 個文件被更改,包括 43 次插入3 次删除
  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 查看文件

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

echo-fonts: ; echo $(allfonts)


+ 2
- 2
test/Makefile.am 查看文件

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

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

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


+ 5
- 1
test/check-build 查看文件

@@ -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
- 0
test/check-fonts 查看文件

@@ -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…
取消
儲存