Commit Graph

38 Commits

Author SHA1 Message Date
Akira TAGOH f3e049967e Fix errors on shellcheck
Fixes https://gitlab.freedesktop.org/fontconfig/fontconfig/-/issues/235
2020-04-10 17:27:15 +09:00
Akira TAGOH 8bddcb1137 Fix a test fail when no bwrap was available
Fixes https://gitlab.freedesktop.org/fontconfig/fontconfig/issues/201
2019-12-05 19:55:06 +09:00
Akira TAGOH b5bcf61fe7 Use FcConfigReference/Destroy appropriately instead of FcConfigGetCurrent
This may improves to be MT-safe.

Reported at https://bugs.chromium.org/p/chromium/issues/detail?id=1004254
2019-11-01 14:44:47 +09:00
Akira TAGOH c9862b6ea7 Read latest cache in paths
Right now fontconfig uses a cache found first in a path and
cachedirs are the order of the system-wide path and then the user path.
this is due to avoid writing caches into the user path when running as root.

However, changing caches by certain config only, e.g. using <match target="scan">
may not take effect by this behavior, because it may be stored into the user path.

Thus, needing to find the latest cache out from paths.

Fixes https://gitlab.freedesktop.org/fontconfig/fontconfig/issues/182
2019-10-28 17:15:07 +09:00
Akira TAGOH 75eadca266 Warn as well if no directory name for cachedir provided
cachedir is used to determine where cache files are stored.
the empty directory will ends up to put them under the top of
directory of XDG_CACHE_HOME. that messes it up and must be avoided.

As a note, if you want to read/write something from the top of
XDG_DATA_HOME (dir) and/or XDG_CACHE_HOME (cachedir),
put "." instead of the empty.

https://gitlab.freedesktop.org/fontconfig/fontconfig/issues/180
2019-10-08 20:12:12 +09:00
Akira TAGOH 01e4f088bf Fix the fails of make check when SOURCE_DATE_EPOCH is set
Fixes https://gitlab.freedesktop.org/fontconfig/fontconfig/issues/172
2019-07-31 13:18:51 +00:00
Jon Turney fd2e155665
Only use test wrapper-script if host is MinGW
Currently it fails if the executable extension is .exe, but wine isn't
available (e.g. on Cygwin)

Possibly the check to use this wrapper should be even more restrictive
e.g. checking if cross-building and/or if wine is available.
2019-04-15 20:42:48 +01:00
Akira TAGOH faa11fb642 Update the test case that is looking for uuid based on host 2019-04-04 12:14:20 +00:00
Akira TAGOH 7f61838435 Fallback uuid-based name to read a cache if no MD5-based cache available 2019-04-04 10:59:47 +00:00
Akira TAGOH 13d2a47d79 Fix unexpected cache name by double-slash in path 2019-04-04 06:47:34 +00:00
Akira TAGOH 34791c32f1 Don't share fonts and cache dir for testing
There seems a race condition on CI. so create an unique directory to avoid colision.
2019-04-03 12:02:09 +00:00
Akira TAGOH 2e8ce63514 Add salt attribute to dir and remap-dir elements
'salt' attribute affects a cache filename to generate different name from directory name.
This is useful when sharing caches with host on sandbox and/or give a filename differently:

    <dir salt="randomdata">/usr/share/fonts</dir>
    <remap-dir as-path="/usr/share/fonts" salt="salt for /usr/share/fonts on host">/run/host/fonts</remap-dir>

Applications can read caches as-is for fonts on /run/host/fonts where is mounted from host.
and write a cache for their own fonts on /usr/share/fonts with different name.
2019-04-03 12:02:09 +00:00
Akira TAGOH 916cf6caa3 Update testcase 2019-04-03 12:02:09 +00:00
Keith Packard c4324f54ee Replace UUID file mechanism with per-directory 'map' attribute [v2]
The UUID files would be placed in each font directory to provide the
unique cache name, independent of path, for that directory. The UUID
files are undesireable for a couple of reasons:

 1) They must be placed in the font directories to be useful. This
    requires modifying the font directories themselves, introducing
    potential visible timestamp changes when running multiple
    applications, and makes the cache processing inconsistent between
    applications with permission to write to the font directories and
    applications without such permission.

 2) The UUID contents were generated randomly, which makes the font
    cache not reproducible across multiple runs.

One proposed fix for 2) is to make the UUID dependent on the font
directory path, but once we do that, we can simply use the font
directory path itself as the key as the original MD5-based font cache
naming mechanism did.

The goal of the UUID file mechanism was to fix startup time of
flatpaks; as the font path names inside the flatpak did not match the
font path names in the base system, the font cache would need to be
reconstructed the first time the flatpak was launched.

The new mechanism for doing this is to allow each '<dir>' element in
the configuration include a 'map' attribute. When looking for a cache
file for a particular directory, if the directory name starts with the
contents of the <dir> element, that portion of the name will be
replaced with the value of the 'map' attribute.

Outside of the flatpak, nothing need change -- fontconfig will build
cache files using real directory names.

Inside the flatpak, the custom fonts.conf file will now include
mappings such as this:

	<dir map="/usr/share/fonts">/run/host/fonts</dir>

When scanning the directory /run/host/fonts/ttf, fontconfig will
use the name /usr/share/fonts/ttf as the source for building the cache
file name.

The existing FC_FILE replacement code used for the UUID-based
implementation continues to correctly adapt font path names seen by
applications.

v2:
	Leave FcDirCacheCreateUUID stub around to avoid removing
	public API function.

	Document 'map' attribute of <dir> element in
	fontconfig-user.sgml

	Suggested-by: Akira TAGOH <akira@tagoh.org>

Signed-off-by: Keith Packard <keithp@keithp.com>
2019-04-03 12:02:09 +00:00
Keith Packard 4cde12bfda Remove UUID-related tests
Remove test-hash
Remove UUID tests from run-test.sh

Signed-off-by: Keith Packard <keithp@keithp.com>
2019-04-03 12:02:09 +00:00
Akira TAGOH 809f040bc3 Don't test bind-mount thing for MinGW 2019-03-23 07:19:08 +00:00
Akira TAGOH f6810ede60 Fix make check on cross-compiled env 2019-03-22 16:51:38 +09:00
Akira TAGOH e9113a764a Do not run a test case for .uuid deletion 2018-10-25 07:16:32 +00:00
Akira TAGOH a887659706 Fix distcheck fail 2018-08-29 10:01:45 +00:00
Akira TAGOH f5dd8512bd Remove .uuid when no font files exists on a directory
https://bugs.freedesktop.org/show_bug.cgi?id=106632
2018-06-11 17:03:46 +09:00
Akira TAGOH 3fa8381336 Add a test case for bz#106618 2018-05-25 15:24:44 +09:00
Akira TAGOH 0b85e77ede Bug 106459 - fc-cache doesn't use -y option for .uuid files
https://bugs.freedesktop.org/show_bug.cgi?id=106459
2018-05-13 16:21:58 +09:00
Akira TAGOH 2cf2e79cb6 Fix make check fail when srcdir != builddir. 2018-03-28 18:54:11 +09:00
Akira TAGOH 182186e53a Do not update mtime with creating .uuid 2017-12-18 21:26:29 +09:00
Akira TAGOH c1e48b0c14 Add a test case for uuid creation 2017-12-18 20:05:44 +09:00
Akira TAGOH a6797cd5c2 Fix distcheck error 2017-12-05 21:57:19 +09:00
Akira TAGOH 4758144492 Fix the testcase for env not enabled PCF_CONFIG_OPTION_LONG_FAMILY_NAMES in freetype 2017-11-20 17:46:47 +05:30
Akira TAGOH 5af21201e1 Add a testcase for bind-mounted cachedir 2017-11-20 17:37:23 +05:30
Akira TAGOH 64895e719d Add the check of PCF_CONFIG_OPTION_LONG_FAMILY_NAMES back
This isn't enabled by default in freetype so need to check it for testsuites
2017-11-20 17:29:39 +05:30
Akira TAGOH 5ca2b1e6dc Update a bit for the changes in FreeType 2.7.1
Our test case relies on the outcome of the family property from freetype though,
it was changed in 2.7.1:

  - PCF family names are made more `colourful'; they now include the
    foundry  and information  whether they contain  wide characters.
    For example,  you no longer get `Fixed' but  rather `Sony Fixed'
    or `Misc Fixed Wide'.

https://bugs.freedesktop.org/show_bug.cgi?id=47704
2017-03-21 12:27:11 +09:00
Akira TAGOH 5886d98c36 Bug 93075 - Possible fix for make check failure on msys/MinGW...
Patch from Christian Fafard
2015-11-24 10:46:34 +09:00
Akira TAGOH 5918d5bea5 Add missing license headers
https://bugs.freedesktop.org/show_bug.cgi?id=73401
2014-01-17 13:05:25 +09:00
Behdad Esfahbod 6bfef3ca4e Make tests run on Windows 2012-12-31 17:21:07 -06:00
Keith Packard 7a03bbdceb During test run, remove cache directory to avoid stale cache usage.
As file timestamps have only one second granularity, an old cache
file could easily be used when a test took less than 1 second to run.
Just remove the cache directory and its contents before each test is run.
Also, remove mention of the old cache file from the test config file.
2006-08-28 10:30:22 -07:00
Patrick Lam 7410e40bd9 2006-08-04 Keith Packard (keithp@keithp.com) reviewed by: plam
Make cache directories configurable. Simplify and correct some code which
    deals with per-directory caches.
2006-08-04 16:13:00 +00:00
Keith Packard 4cbc3ee8fe Yet more cleanups to finish getting 'make distcheck' working This has been
tested to ensure that it even works from a _build directory.
2003-10-27 10:44:13 +00:00
Tor Lillqvist 231051f416 Remove CRs from the out file before comparing (needed on Windows). 2003-06-15 22:57:21 +00:00
Keith Packard 44d903783d Add simple tests 2003-03-01 05:55:17 +00:00