From adcddcd38e51c788b77cbba2a6df5687bbfd5133 Mon Sep 17 00:00:00 2001
From: Claudio Matsuoka <cmatsuoka@gmail.com>
Date: Tue, 25 Jan 2011 21:23:36 -0200
Subject: [PATCH] Set font dir when checking the dist package

Make sure the binary built from the distribution package uses a local
font directory to run tests.

Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>
---
 Makefile     | 2 +-
 run-tests.sh | 4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 432e3ac..5ff0ba7 100644
--- a/Makefile
+++ b/Makefile
@@ -96,7 +96,7 @@ dist:
 	tar cvf - $(DIST) | gzip -9c > $(DIST).tar.gz
 	rm -Rf $(DIST)
 	tar xf $(DIST).tar.gz
-	(cd $(DIST); make all check vercheck)
+	(cd $(DIST); make all check vercheck DEFAULTFONTDIR=fonts)
 	@rm -Rf $(DIST)
 	@echo
 	@ls -l $(DIST).tar.gz
diff --git a/run-tests.sh b/run-tests.sh
index b4313d6..927897a 100755
--- a/run-tests.sh
+++ b/run-tests.sh
@@ -33,6 +33,10 @@ $CMD -f small "Test results" | tee -a $LOGFILE
 file="$TESTDIR/input.txt"
 cmd="cat $file|$CMD"
 
+echo -n "Default font dir: "; $CMD -I2
+echo -n "Default font: "; $CMD -I3
+echo
+
 run_test 001 "showfigfonts output" "./showfigfonts"
 run_test 002 "text rendering in all fonts" \
   "for i in fonts/*.flf; do $cmd -f \$i; done"