From 6e3cfc5bc8ca969856e4d56dec01870df709d75a Mon Sep 17 00:00:00 2001 From: marha Date: Wed, 19 Jan 2011 10:06:48 +0000 Subject: Added libXft-2.2.0 fontconfig-2.8.0 libXrender-0.9.6 --- fontconfig/test/4x6.pcf | Bin 0 -> 70952 bytes fontconfig/test/8x16.pcf | Bin 0 -> 21320 bytes fontconfig/test/Makefile.am | 9 +++++ fontconfig/test/fonts.conf.in | 4 ++ fontconfig/test/out.expected | 8 ++++ fontconfig/test/run-test.sh | 92 ++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 113 insertions(+) create mode 100644 fontconfig/test/4x6.pcf create mode 100644 fontconfig/test/8x16.pcf create mode 100644 fontconfig/test/Makefile.am create mode 100644 fontconfig/test/fonts.conf.in create mode 100644 fontconfig/test/out.expected create mode 100644 fontconfig/test/run-test.sh (limited to 'fontconfig/test') diff --git a/fontconfig/test/4x6.pcf b/fontconfig/test/4x6.pcf new file mode 100644 index 000000000..dc25510a6 Binary files /dev/null and b/fontconfig/test/4x6.pcf differ diff --git a/fontconfig/test/8x16.pcf b/fontconfig/test/8x16.pcf new file mode 100644 index 000000000..0babed164 Binary files /dev/null and b/fontconfig/test/8x16.pcf differ diff --git a/fontconfig/test/Makefile.am b/fontconfig/test/Makefile.am new file mode 100644 index 000000000..72da8d64a --- /dev/null +++ b/fontconfig/test/Makefile.am @@ -0,0 +1,9 @@ +check_SCRIPTS=run-test.sh +TESTS_ENVIRONMENT=src=${srcdir} sh +TESTS=run-test.sh + +TESTDATA=4x6.pcf 8x16.pcf out.expected fonts.conf.in + +EXTRA_DIST=$(check_SCRIPTS) $(TESTDATA) + +CLEANFILES= diff --git a/fontconfig/test/fonts.conf.in b/fontconfig/test/fonts.conf.in new file mode 100644 index 000000000..95def72d4 --- /dev/null +++ b/fontconfig/test/fonts.conf.in @@ -0,0 +1,4 @@ + +@FONTDIR@ +@CACHEDIR@ + diff --git a/fontconfig/test/out.expected b/fontconfig/test/out.expected new file mode 100644 index 000000000..39634c50a --- /dev/null +++ b/fontconfig/test/out.expected @@ -0,0 +1,8 @@ +Fixed:pixelsize=16 +Fixed:pixelsize=6 += +Fixed:pixelsize=16 +Fixed:pixelsize=6 += +Fixed:pixelsize=16 +Fixed:pixelsize=6 diff --git a/fontconfig/test/run-test.sh b/fontconfig/test/run-test.sh new file mode 100644 index 000000000..e7174b289 --- /dev/null +++ b/fontconfig/test/run-test.sh @@ -0,0 +1,92 @@ +#!/bin/sh +TESTDIR=${srcdir-`pwd`} + +FONTDIR=`pwd`/fonts +CACHEDIR=`pwd`/cache.dir + +ECHO=true + +FCLIST=../fc-list/fc-list +FCCACHE=../fc-cache/fc-cache + +FONT1=$TESTDIR/4x6.pcf +FONT2=$TESTDIR/8x16.pcf + +check () { + $FCLIST - family pixelsize | sort > out + echo "=" >> out + $FCLIST - family pixelsize | sort >> out + echo "=" >> out + $FCLIST - family pixelsize | sort >> out + tr -d '\015' out.tmp; mv out.tmp out + if cmp out $TESTDIR/out.expected > /dev/null ; then : ; else + echo "*** Test failed: $TEST" + echo "*** output is in 'out', expected output in 'out.expected'" + exit 1 + fi + rm out +} + +prep() { + rm -rf $CACHEDIR + rm -rf $FONTDIR + mkdir $FONTDIR +} + +dotest () { + TEST=$1 + test x$VERBOSE = x || echo Running: $TEST +} + +sed "s!@FONTDIR@!$FONTDIR! +s!@CACHEDIR@!$CACHEDIR!" < $TESTDIR/fonts.conf.in > fonts.conf + +FONTCONFIG_FILE=`pwd`/fonts.conf +export FONTCONFIG_FILE + +dotest "Basic check" +prep +cp $FONT1 $FONT2 $FONTDIR +check + +dotest "With a subdir" +prep +cp $FONT1 $FONT2 $FONTDIR +$FCCACHE $FONTDIR +check + +dotest "Subdir with a cache file" +prep +mkdir $FONTDIR/a +cp $FONT1 $FONT2 $FONTDIR/a +$FCCACHE $FONTDIR/a +check + +dotest "Complicated directory structure" +prep +mkdir $FONTDIR/a +mkdir $FONTDIR/a/a +mkdir $FONTDIR/b +mkdir $FONTDIR/b/a +cp $FONT1 $FONTDIR/a +cp $FONT2 $FONTDIR/b/a +check + +dotest "Subdir with an out-of-date cache file" +prep +mkdir $FONTDIR/a +$FCCACHE $FONTDIR/a +sleep 1 +cp $FONT1 $FONT2 $FONTDIR/a +check + +dotest "Dir with an out-of-date cache file" +prep +cp $FONT1 $FONTDIR +$FCCACHE $FONTDIR +sleep 1 +mkdir $FONTDIR/a +cp $FONT2 $FONTDIR/a +check + +rm -rf $FONTDIR $CACHEFILE $CACHEDIR $FONTCONFIG_FILE out -- cgit v1.2.3