Add regression tests to distribution package

Add test target to the Makefile, and also automatically run tests
in the dist target. Current test results:

Run tests in /home/claudio/figlet/figlet
 _____       _                     _ _
|_   _|__ __| |_   _ _ ___ ____  _| | |_ ___
  | |/ -_|_-<  _| | '_/ -_|_-< || | |  _(_-<
  |_|\___/__/\__| |_| \___/__/\_,_|_|\__/__/

Run test 001: showfigfonts output... pass
Run test 002: text rendering in all fonts... pass
Run test 003: long text rendering... pass
Run test 004: left-to-right text... pass
Run test 005: right-to-left text... pass
Run test 006: flush-left justification... pass
Run test 007: flush-right justification... pass
Run test 008: center justification... pass
Run test 009: kerning mode... pass
Run test 010: full width mode... pass
Run test 011: overlap mode... pass
Run test 012: TLF font rendering... pass
Run test 013: kerning flush-left right-to-left mode... pass
Run test 014: kerning centered right-to-left mode (slant)... pass
Run test 015: full-width flush-right right-to-left mode... pass
Run test 016: overlap flush-right mode (big)... pass

 All tests passed.

Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>
This commit is contained in:
Claudio Matsuoka 2011-01-24 19:10:23 -02:00
parent 8ce91d7e80
commit 6dc0a00468
3 changed files with 11 additions and 4 deletions

@ -12,6 +12,8 @@ o Add infocode 5 to list supported font formats
o Fix rendering error caused by the previous attempt to fix invalid
memory accesses when smushing at start of line
o Add regression tests
These changes were made by Claudio Matsuoka <cmatsuoka@gmail.com>
26 January 2011

@ -56,7 +56,7 @@ BINS = figlet chkfont figlist showfigfonts
MANUAL = figlet.6 chkfont.6 figlist.6 showfigfonts.6
DFILES = Makefile Makefile.tc $(MANUAL) $(OBJS:.o=.c) chkfont.c \
figlist showfigfonts CHANGES FAQ README LICENSE figfont.txt \
crc.h inflate.h zipio.h utf8.h
crc.h inflate.h zipio.h utf8.h run-tests.sh
.c.o:
$(CC) -c $(CFLAGS) $(XCFLAGS) -DDEFAULTFONTDIR=\"$(DEFAULTFONTDIR)\" \
@ -88,14 +88,19 @@ dist:
cp $(DFILES) $(DIST)/
mkdir $(DIST)/fonts
cp fonts/*.fl[fc] $(DIST)/fonts
mkdir $(DIST)/tests
cp tests/*txt tests/emboss.tlf $(DIST)/tests
tar cvf - $(DIST) | gzip -9c > $(DIST).tar.gz
rm -Rf $(DIST)
tar xf $(DIST).tar.gz
(cd $(DIST); make all test)
rm -Rf $(DIST)
ls -l $(DIST).tar.gz
test:
tar xf $(DIST).tar.gz
(cd $(DIST); make; ../tests.sh)
rm -Rf $(DIST)
@echo -n "Run tests in "
@pwd
@./run-tests.sh
$(OBJS) chkfont.o getopt.o: Makefile
chkfont.o: chkfont.c