chiark / gitweb /
Add a simple autopkgtest to check fc-list can see Bedstead
authorBen Harris <bjh21@bjh21.me.uk>
Sat, 12 Oct 2024 13:47:33 +0000 (14:47 +0100)
committerBen Harris <bjh21@bjh21.me.uk>
Sat, 12 Oct 2024 14:45:13 +0000 (15:45 +0100)
This is marked as superficial because it only checks that the fonts
exist, and not what they look like.

debian/tests/control [new file with mode: 0644]
debian/tests/fc-list [new file with mode: 0644]

diff --git a/debian/tests/control b/debian/tests/control
new file mode 100644 (file)
index 0000000..d94a2a6
--- /dev/null
@@ -0,0 +1,3 @@
+Tests: fc-list
+Depends: @, fontconfig
+Restrictions: superficial
diff --git a/debian/tests/fc-list b/debian/tests/fc-list
new file mode 100644 (file)
index 0000000..327d811
--- /dev/null
@@ -0,0 +1,38 @@
+#! /bin/bash
+
+# Check that Fontconfig can find all of the Bedstead fonts that should
+# be installed.  This doesn't check the precise output of fc-list
+# because the test system might contain additional fonts that match
+# "Bedstead".
+
+set -euo pipefail
+
+cd -- "${AUTOPKGTEST_TMP}"
+
+sort >expected <<EOF
+/usr/share/fonts/opentype/bedstead/bedstead-ultracondensed.otf: Bedstead,Bedstead Ultra Condensed:style=Ultra Condensed,Regular
+/usr/share/fonts/opentype/bedstead/bedstead.otf: Bedstead:style=Regular
+/usr/share/fonts/opentype/bedstead/bedstead-semicondensed.otf: Bedstead,Bedstead Semi Condensed:style=Semi Condensed,Regular
+/usr/share/fonts/opentype/bedstead/bedstead-boldsemicondensed.otf: Bedstead,Bedstead Semi Condensed:style=Bold Semi Condensed,Bold
+/usr/share/fonts/opentype/bedstead/bedstead-boldextended.otf: Bedstead,Bedstead Extended:style=Bold Extended,Bold
+/usr/share/fonts/opentype/bedstead/bedstead-condensed.otf: Bedstead,Bedstead Condensed:style=Condensed,Regular
+/usr/share/fonts/opentype/bedstead/bedstead-boldultracondensed.otf: Bedstead,Bedstead Ultra Condensed:style=Bold Ultra Condensed,Bold
+/usr/share/fonts/opentype/bedstead/bedstead-extended.otf: Bedstead,Bedstead Extended:style=Extended,Regular
+/usr/share/fonts/opentype/bedstead/bedstead-boldextracondensed.otf: Bedstead,Bedstead Extra Condensed:style=Bold Extra Condensed,Bold
+/usr/share/fonts/opentype/bedstead/bedstead-extracondensed.otf: Bedstead,Bedstead Extra Condensed:style=Extra Condensed,Regular
+/usr/share/fonts/opentype/bedstead/bedstead-bold.otf: Bedstead:style=Bold
+/usr/share/fonts/opentype/bedstead/bedstead-boldcondensed.otf: Bedstead,Bedstead Condensed:style=Bold Condensed,Bold
+EOF
+
+fc-list Bedstead | sort >actual
+
+echo "fc-list output:"
+cat actual
+
+comm -13 actual expected >missing
+
+if [ -s missing ]; then
+    echo "Missing from fc-list output:"
+    cat missing
+    exit 1
+fi