diff options
Diffstat (limited to 'font')
-rwxr-xr-x | font/devpdf/tests/basic-fonts-present.sh | 43 |
1 files changed, 36 insertions, 7 deletions
diff --git a/font/devpdf/tests/basic-fonts-present.sh b/font/devpdf/tests/basic-fonts-present.sh index b373dfc0f..f54534697 100755 --- a/font/devpdf/tests/basic-fonts-present.sh +++ b/font/devpdf/tests/basic-fonts-present.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# Copyright (C) 2022 Free Software Foundation, Inc. +# Copyright (C) 2022-2023 Free Software Foundation, Inc. # # This file is part of groff. # @@ -23,15 +23,45 @@ # # We need all of them except SS and ZDR. -# Our configure script warns that gropdf will not be functional if gs -# (Ghostscript) is not available. +# Our configure script warns that gropdf will not be fully functional if +# gs (Ghostscript) is not available. Namely, we will have only +# descriptions for the PostScript Level 1 base 14 fonts, not the Level 2 +# base 35 fonts. We're using the presence of the command as a proxy for +# the availabilty of the fonts because locating the latter is +# unreliable (package names, directory locations, and file names all +# vary), but if the command is present, the fonts usually are too. if ! command -v gs then - echo "gs command not available; skipping test" >&2 + echo "$0: gs command not available; skipping test" >&2 + exit 77 # skip +fi + +# Locate directory containing the font descriptions for the PostScript +# device. +for srcroot in . .. ../.. +do + # Look for a source file characteristic of the groff source tree. + if ! [ -f "$srcroot"/ChangeLog.115 ] + then + continue + fi + + d=$srcroot/font/devps + if [ -d "$d" ] + then + devps_fontsrcdir=$d + break + fi +done + +# If we can't find it, we can't test. +if [ -z "$devps_fontsrcdir" ] +then + echo "$0: cannot locate font descriptions for 'ps' device;" \ + "skipping test" >&2 exit 77 # skip fi -devps_fontsrcdir="${abs_top_srcdir:-..}"/font/devps devpdf_fontbuilddir="${abs_top_builddir:-.}"/font/devpdf psfonts=$(cd "$devps_fontsrcdir" && ls [A-Z]* \ @@ -42,9 +72,8 @@ fail= for f in $psfonts do printf "checking for font description %s...\n" "$f" >&2 - if ! test -f "$devpdf_fontbuilddir"/"$f" + if ! [ -f "$devpdf_fontbuilddir"/"$f" ] then - echo test -f "$devpdf_fontbuilddir"/"$f" echo FAILED >&2 fail=yes fi |