From: Ben Harris Date: Fri, 29 Nov 2024 21:08:43 +0000 (+0000) Subject: Add a superficial autopkgtest for X fonts X-Git-Tag: debian/3.246-1_7~3 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~bjharris/git?a=commitdiff_plain;h=66d50ce67170bd5b8eb614fa942aab39010d4cb8;p=bedstead-debian.git Add a superficial autopkgtest for X fonts --- diff --git a/debian/tests/control b/debian/tests/control index a5d9f5f..42aebef 100644 --- a/debian/tests/control +++ b/debian/tests/control @@ -4,3 +4,7 @@ Restrictions: superficial Tests: rom Depends: @, ghostscript + +Tests: xlsfonts +Depends: @, x11-utils +Restrictions: superficial diff --git a/debian/tests/xlsfonts b/debian/tests/xlsfonts new file mode 100644 index 0000000..605500c --- /dev/null +++ b/debian/tests/xlsfonts @@ -0,0 +1,41 @@ +#! /bin/bash + +# Check that the X server can find all of the Bedstead fonts that +# should be installed. This doesn't check the precise output of +# xlsfonts just in case there are extra fonts that match. + +set -euo pipefail + +cd -- "${AUTOPKGTEST_TMP}" + +sort >expected <actual + +echo "xlsfonts output:" +cat actual + +comm -13 actual expected >missing + +if [ -s missing ]; then + echo "Missing from xlsfonts output:" + cat missing + exit 1 +fi + +# Check that each alias maps to precisely one font. +for a in bedstead-10 bedstead-20 bedstead-bold-20; do + count="$(xlsfonts "$a" | wc -l)" + if [ "$count" -eq 1 ]; then + echo "xlsfonts $a correctly returned one result" + else + echo "xlsfonts $a returned $count results, not 1" >&2 + exit 1 + fi +done