Follow-up Comment #65, bug #63808 (project groff): Things are looking good on Debian bullseye
Here's the revised last commit, with ChangeLog and proper commit message. commit a887a4eda48d0b90a0203355497faa9f9f83cc6d (HEAD -> master) Author: G. Branden Robinson <g.branden.robin...@gmail.com> Date: Sat Feb 25 02:08:57 2023 -0600 [devpdf]: Revise tests. * font/devpdf/tests/check-default-foundry.sh.in: Test only the base 14 fonts of the PDF standard unconditionally. Test the remainder from the set of 35 commonly distributed only if a Ghostscript interpreter was detected at configuration time, because the latter fonts _must_ be embedded in PDF documents. If they're not present, skip the test rather than failing it. * font/devpdf/tests/check-urw-foundry.sh.in: Skip test if no URW fonts detected at configuration time, rather than failing it. * m4/groff.m4 (GROFF_GROPDF_PROGRAM_NOTICE, GROFF_URW_FONTS_NOTICE): Drop warnings of expected test failures. The tests no longer fail in the anticipated circumstances. diff --git a/ChangeLog b/ChangeLog index 0323d7c99..738f0bc51 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,20 @@ +2023-02-25 G. Branden Robinson <g.branden.robin...@gmail.com> + + [devpdf]: Revise tests. + + * font/devpdf/tests/check-default-foundry.sh.in: Test only the + base 14 fonts of the PDF standard unconditionally. Test the + remainder from the set of 35 commonly distributed only if a + Ghostscript interpreter was detected at configuration time, + because the latter fonts _must_ be embedded in PDF documents. + If they're not present, skip the test rather than failing it. + * font/devpdf/tests/check-urw-foundry.sh.in: Skip test if no URW + fonts detected at configuration time, rather than failing it. + * m4/groff.m4 (GROFF_GROPDF_PROGRAM_NOTICE) + (GROFF_URW_FONTS_NOTICE): Drop warnings of expected test + failures. The tests no longer fail in the anticipated + circumstances. + 2023-02-24 G. Branden Robinson <g.branden.robin...@gmail.com> [devpdf]: Generate tests from template files, so we can populate diff --git a/font/devpdf/tests/check-default-foundry.sh.in b/font/devpdf/tests/check-default-foundry.sh.in index 1ddd83d0b..026cc012a 100755 --- a/font/devpdf/tests/check-default-foundry.sh.in +++ b/font/devpdf/tests/check-default-foundry.sh.in @@ -18,19 +18,42 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. # -# Ensure that groff's PDF device has font description files for the -# default (unnamed) foundry's PostScript Level 2 base 35 fonts, plus -# groff's EURO. -# -# These font descriptions should be available in any gropdf -# configuration because they can be copied from the devps font -# descriptions even if the URW fonts are not available. -# -# Another test script checks the "U" (URW) foundry. - devpdf_fontbuilddir="${abs_top_builddir:-.}"/font/devpdf +ghostscript=@GHOSTSCRIPT@ + +wail () { + echo ...FAILED >&2 + fail=yes +} + +fail= + +# The are the base 14 fonts required by the PDF standard. They should +# _always_ be present and supported. If their corresponding Type 1 font +# files are available, they too can be embedded in a PDF using gropdf's +# "-e" option. groff's "EURO" font is always available; we ship it. +mandatory_fonts='CB +CBI +CI +CR +HB +HBI +HI +HR +S +TB +TBI +TI +TR +ZD' -fonts='AB +# These fonts are commonly, but not universally, available; if used, +# their corresponding Type 1 font files must be embedded in a document. +# +# Their groff font descriptions will always be available: we ship them. +# But they are not usable with gropdf(1) if the Type 1 files are absent. +# We thus will not test them if they are not expected to work. +supplementary_fonts='AB ABI AI AR @@ -38,19 +61,10 @@ BMB BMBI BMI BMR -CB -CBI -CI -CR -EURO -HB -HBI -HI HNB HNBI HNI HNR -HR NB NBI NI @@ -59,24 +73,25 @@ PB PBI PI PR -S -TB -TBI -TI -TR -ZCMI -ZD' +ZCMI' -fail= +for f in $mandatory_fonts +do + printf "checking for font description %s...\n" "$f" >&2 + test -f "$devpdf_fontbuilddir"/"$f" || wail +done + +if [ "$ghostscript" = no ] || [ "$ghostscript" = missing ] +then + echo "Ghostscript not available; skipping check for any further" \ + "fonts in the default foundry" >&2 + exit 77 # skip +fi -for f in $fonts +for f in $supplementary_fonts do printf "checking for font description %s...\n" "$f" >&2 - if ! [ -f "$devpdf_fontbuilddir"/"$f" ] - then - echo FAILED >&2 - fail=yes - fi + test -f "$devpdf_fontbuilddir"/"$f" || wail done test -z "$fail" diff --git a/font/devpdf/tests/check-urw-foundry.sh.in b/font/devpdf/tests/check-urw-foundry.sh.in index 9d4e514bf..d31b3aa3e 100755 --- a/font/devpdf/tests/check-urw-foundry.sh.in +++ b/font/devpdf/tests/check-urw-foundry.sh.in @@ -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. # @@ -19,8 +19,17 @@ # # Ensure that groff's PDF device has URW font descriptions it expects. +# These are generated at build time by afmtodit(1) if a URW font +# directory was discovered at configuration time. devpdf_fontbuilddir="${abs_top_builddir:-.}"/font/devpdf +urwfontsdir=@urwfontsdir@ + +if [ -z "$urwfontsdir" ] +then + echo "URW fonts not found at configuration time; skipping" >&2 + exit 77 # skip +fi fonts='AB ABI @@ -67,7 +76,7 @@ do if ! test -f "$devpdf_fontbuilddir"/$f then echo test -f "$devpdf_fontbuilddir"/$f - echo FAILED >&2 + echo ...FAILED >&2 fail=yes fi done diff --git a/m4/groff.m4 b/m4/groff.m4 index 06b32e159..617e16394 100644 --- a/m4/groff.m4 +++ b/m4/groff.m4 @@ -332,8 +332,6 @@ AC_DEFUN([GROFF_GROPDF_PROGRAM_NOTICE], [ base 14 fonts, plus the 'EURO' font groff supplies, and font embedding with its '-e' option (accessed via the 'groff' command with the option '-P -e') will not be possible. - - If you run "make check", an automated test for 'gropdf' will fail. ]) fi ]) @@ -416,8 +414,6 @@ AC_DEFUN([GROFF_URW_FONTS_NOTICE], [ the 'U' foundry in PDF documents generated by groff will not be possible. - If you run "make check", an automated test for 'gropdf' will fail. - You can obtain the URW base 35 fonts from their GitHub project. As of this writing (2023-02-15), you can find them in the 'fonts' directory of the following archives (choose one). Attaching typescript of 3 build configurations in Debian bullseye chroot. (file #54394) _______________________________________________________ Additional Item Attachment: File name: typescript-gbr-groff-1.23.0.rc3.31-a887a-debian-bullseye.txt Size:441 KB <https://file.savannah.gnu.org/file/typescript-gbr-groff-1.23.0.rc3.31-a887a-debian-bullseye.txt?file_id=54394> _______________________________________________________ Reply to this item at: <https://savannah.gnu.org/bugs/?63808> _______________________________________________ Message sent via Savannah https://savannah.gnu.org/