Debian Codegraph @

debian/tests/xlsfonts

raw
1 #! /bin/bash
2
3 set -xeuo pipefail
4
5 if [ -z "${DISPLAY-}" ]; then
6 exec xvfb-run -a "$0"
7 fi
8
9 # Check that the X server can find all of the Bedstead fonts that
10 # should be installed. This doesn't check the precise output of
11 # xlsfonts just in case there are extra fonts that match.
12
13 cd -- "${AUTOPKGTEST_TMP}"
14
15 sort >expected <<EOF
16 -bjh21-bedstead-bold-r-normal--0-0-75-75-c-0-iso10646-1
17 -bjh21-bedstead-bold-r-normal--193-20-75-75-c-120-iso10646-1
18 -bjh21-bedstead-medium-r-normal--0-0-75-75-c-0-iso10646-1
19 -bjh21-bedstead-medium-r-normal--193-20-75-75-c-120-iso10646-1
20 -bjh21-bedstead-medium-r-normal--96-10-75-75-c-60-iso10646-1
21 EOF
22
23 xlsfonts -fn '-bjh21-bedstead-*' | sort >actual
24
25 cat actual
26
27 comm -13 actual expected >missing
28
29 if [ -s missing ]; then
30 cat missing
31 exit 1
32 fi
33
34 # Check that each alias maps to precisely one font.
35 for a in bedstead-10 bedstead-20 bedstead-bold-20; do
36 count="$(xlsfonts "$a" | wc -l)"
37 if [ "$count" -eq 1 ]; then
38 : "xlsfonts $a correctly returned one result"
39 else
40 : "xlsfonts $a returned $count results, not 1"
41 exit 1
42 fi
43 done