Commit 916cf6ca authored by Akira TAGOH's avatar Akira TAGOH

Update testcase

parent 2e09c62b
check_SCRIPTS=run-test.sh run-test-map.sh check_SCRIPTS=run-test.sh
TEST_EXTENSIONS = \ TEST_EXTENSIONS = \
.sh \ .sh \
$(NULL) $(NULL)
......
<fontconfig> <fontconfig>
<dir @MAP@>@FONTDIR@</dir> @REMAPDIR@
<dir>@FONTDIR@</dir>
<cachedir>@CACHEDIR@</cachedir> <cachedir>@CACHEDIR@</cachedir>
</fontconfig> </fontconfig>
...@@ -73,7 +73,7 @@ dotest () { ...@@ -73,7 +73,7 @@ dotest () {
} }
sed "s!@FONTDIR@!$FONTDIR! sed "s!@FONTDIR@!$FONTDIR!
s!@MAP@!! s!@REMAPDIR@!!
s!@CACHEDIR@!$CACHEDIR!" < $TESTDIR/fonts.conf.in > fonts.conf s!@CACHEDIR@!$CACHEDIR!" < $TESTDIR/fonts.conf.in > fonts.conf
FONTCONFIG_FILE="$MyPWD"/fonts.conf FONTCONFIG_FILE="$MyPWD"/fonts.conf
...@@ -146,11 +146,17 @@ sleep 1 ...@@ -146,11 +146,17 @@ sleep 1
ls -l $CACHEDIR > out1 ls -l $CACHEDIR > out1
TESTTMPDIR=`mktemp -d /tmp/fontconfig.XXXXXXXX` TESTTMPDIR=`mktemp -d /tmp/fontconfig.XXXXXXXX`
sed "s!@FONTDIR@!$TESTTMPDIR/fonts! sed "s!@FONTDIR@!$TESTTMPDIR/fonts!
s!@MAP@!map="'"'"$FONTDIR"'"'"! s!@REMAPDIR@!<remap-dir as-path="'"'"$FONTDIR"'"'">$TESTTMPDIR/fonts</remap-dir>!
s!@CACHEDIR@!$TESTTMPDIR/cache.dir!" < $TESTDIR/fonts.conf.in > bind-fonts.conf s!@CACHEDIR@!$TESTTMPDIR/cache.dir!" < $TESTDIR/fonts.conf.in > bind-fonts.conf
$BWRAP --bind / / --bind $CACHEDIR $TESTTMPDIR/cache.dir --bind $FONTDIR $TESTTMPDIR/fonts --bind .. $TESTTMPDIR/build --dev-bind /dev /dev --setenv FONTCONFIG_FILE $TESTTMPDIR/build/test/bind-fonts.conf $TESTTMPDIR/build/fc-match/fc-match$EXEEXT -f "%{file}\n" ":foundry=Misc" > xxx $BWRAP --bind / / --bind $CACHEDIR $TESTTMPDIR/cache.dir --bind $FONTDIR $TESTTMPDIR/fonts --bind .. $TESTTMPDIR/build --dev-bind /dev /dev --setenv FONTCONFIG_FILE $TESTTMPDIR/build/test/bind-fonts.conf $TESTTMPDIR/build/fc-match/fc-match$EXEEXT -f "%{file}\n" ":foundry=Misc" > xxx
$BWRAP --bind / / --bind $CACHEDIR $TESTTMPDIR/cache.dir --bind $FONTDIR $TESTTMPDIR/fonts --bind .. $TESTTMPDIR/build --dev-bind /dev /dev --setenv FONTCONFIG_FILE $TESTTMPDIR/build/test/bind-fonts.conf $TESTTMPDIR/build/test/test-bz106618$EXEEXT | sort > flist1 $BWRAP --bind / / --bind $CACHEDIR $TESTTMPDIR/cache.dir --bind $FONTDIR $TESTTMPDIR/fonts --bind .. $TESTTMPDIR/build --dev-bind /dev /dev --setenv FONTCONFIG_FILE $TESTTMPDIR/build/test/bind-fonts.conf $TESTTMPDIR/build/test/test-bz106618$EXEEXT | sort > flist1
$BWRAP --bind / / --bind $CACHEDIR $TESTTMPDIR/cache.dir --bind $FONTDIR $TESTTMPDIR/fonts --bind .. $TESTTMPDIR/build --dev-bind /dev /dev find $TESTTMPDIR/fonts/ -type f -name '*.pcf' | sort > flist2 $BWRAP --bind / / --bind $CACHEDIR $TESTTMPDIR/cache.dir --bind $FONTDIR $TESTTMPDIR/fonts --bind .. $TESTTMPDIR/build --dev-bind /dev /dev find $TESTTMPDIR/fonts/ -type f -name '*.pcf' | sort > flist2
ls -l $CACHEDIR > out2
if cmp out1 out2 > /dev/null ; then : ; else
echo "*** Test failed: $TEST"
echo "cache was created/updated."
exit 1
fi
if [ x`cat xxx` != "x$TESTTMPDIR/fonts/4x6.pcf" ]; then if [ x`cat xxx` != "x$TESTTMPDIR/fonts/4x6.pcf" ]; then
echo "*** Test failed: $TEST" echo "*** Test failed: $TEST"
echo "file property doesn't point to the new place: $TESTTMPDIR/fonts/4x6.pcf" echo "file property doesn't point to the new place: $TESTTMPDIR/fonts/4x6.pcf"
......
...@@ -268,7 +268,9 @@ main (void) ...@@ -268,7 +268,9 @@ main (void)
} }
free (d); free (d);
FcConfigDestroy (cfg);
setenv ("FONTCONFIG_SYSROOT", sysroot, 1); setenv ("FONTCONFIG_SYSROOT", sysroot, 1);
cfg = FcConfigCreate ();
dsa = FcStrBuildFilename (sysroot, da, NULL); dsa = FcStrBuildFilename (sysroot, da, NULL);
dsac = FcStrCanonFilename (dsa); dsac = FcStrCanonFilename (dsa);
d = FcConfigRealFilename (cfg, dc); d = FcConfigRealFilename (cfg, dc);
......
...@@ -224,7 +224,9 @@ main(void) ...@@ -224,7 +224,9 @@ main(void)
goto bail; goto bail;
free (ret); free (ret);
free (s); free (s);
FcConfigDestroy (cfg);
setenv ("FONTCONFIG_SYSROOT", sysroot, 1); setenv ("FONTCONFIG_SYSROOT", sysroot, 1);
cfg = FcConfigCreate ();
fprintf (stderr, "D: Creating %s\n", sysroot); fprintf (stderr, "D: Creating %s\n", sysroot);
mkdir_p (sysroot); mkdir_p (sysroot);
retval++; retval++;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment