summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAkira TAGOH <akira@tagoh.org>2019-04-04 10:59:47 +0000
committerAkira TAGOH <akira@tagoh.org>2019-04-04 10:59:47 +0000
commit7f61838435ed3e3f8c19c593e9e646d221128df8 (patch)
tree88eb0cba9f83a1eb5359b2407dc493016953e440 /test
parent13d2a47d79a4ec4d3bc48aeb89dd9c899468152e (diff)
Fallback uuid-based name to read a cache if no MD5-based cache available
Diffstat (limited to 'test')
-rw-r--r--test/run-test.sh25
1 files changed, 24 insertions, 1 deletions
diff --git a/test/run-test.sh b/test/run-test.sh
index 69a12f62..2d820a89 100644
--- a/test/run-test.sh
+++ b/test/run-test.sh
@@ -236,7 +236,6 @@ mkdir -p $TESTTMPDIR/cache.dir
sed "s!@FONTDIR@!$TESTTMPDIR/fonts!
s!@REMAPDIR@!<remap-dir as-path="'"'"$FONTDIR"'"'">$TESTTMPDIR/fonts</remap-dir>!
s!@CACHEDIR@!$TESTTMPDIR/cache.dir!" < $TESTDIR/fonts.conf.in > bind-fonts.conf
-cat bind-fonts.conf
$BWRAP --bind / / --bind $FONTDIR $TESTTMPDIR/fonts --bind .. $TESTTMPDIR/build --dev-bind /dev /dev --setenv FONTCONFIG_FILE $TESTTMPDIR/build/test/bind-fonts.conf $TESTTMPDIR/build/fc-cache/fc-cache$EXEEXT $TESTTMPDIR/fonts
(cd $TESTTMPDIR/cache.dir; ls -1 --color=no *cache*) > out2
if cmp out1 out2 > /dev/null ; then : ; else
@@ -277,6 +276,30 @@ fi
rm -rf $MyPWD/sysroot
+dotest "Fallback to uuid"
+prep
+cp $FONT1 $FONTDIR
+touch -d @`stat -c %Y $FONTDIR` $FONTDIR
+$FCCACHE $FONTDIR
+_cache=`ls -1 --color=no $CACHEDIR/*cache*`
+_mtime=`stat -c %Y $FONTDIR`
+_uuid=`uuidgen`
+_newcache=`echo $_cache | sed "s/\([0-9a-f]*\)\(\-.*\)/$_uuid\2/"`
+mv $_cache $_newcache
+echo $_uuid > $FONTDIR/.uuid
+touch -d @$_mtime $FONTDIR
+$FCCACHE $FONTDIR
+_cache2=`ls -1 --color=no $CACHEDIR/*cache*`
+if [ "x$_cache2" != "x$_newcache" ]; then
+ echo "*** Test failed: $TEST"
+ echo "Cache wasn't fallen back."
+ echo "Expected result:"
+ echo $_newcache
+ echo "Actual result:"
+ echo $_cache2
+ exit 1
fi
+fi # if [ "x$EXEEXT" = "x" ]
+
rm -rf $FONTDIR $CACHEFILE $CACHEDIR $BASEDIR $FONTCONFIG_FILE out