public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [tests/fonts] rhel9: default_fonts: Add new test case
@ 2026-08-13 10:29 Akira TAGOH
  0 siblings, 0 replies; only message in thread
From: Akira TAGOH @ 2026-08-13 10:29 UTC (permalink / raw)
  To: git-commits

A new commit has been pushed.

Repo   : tests/fonts
Branch : rhel9
Commit : f69b8c9963744e4820ed000223759c1caec4178c
Author : Akira TAGOH <akira@tagoh.org>
Date   : 2024-06-21T17:00:34+09:00
Stats  : +81/-0 in 3 file(s)
URL    : https://src.fedoraproject.org/tests/fonts/c/f69b8c9963744e4820ed000223759c1caec4178c?branch=rhel9

Log:
default_fonts: Add new test case

---
diff --git a/README.rst b/README.rst
index 5e7c335..fbb1640 100644
--- a/README.rst
+++ b/README.rst
@@ -38,6 +38,42 @@ Template
 Available test cases
 --------------------
 
+- Default fonts
+
+  A test case to check if the targeted font package affects various default
+  generic alias selection.
+  The following parameters are used in this test:
+
+  - DEFAULT_SANS (optional)
+
+    default value is 0. set 1 if the targeted font package is supposed to
+    be a default font for sans-serif on a certain language.
+
+  - DEFAULT_SERIF (optional)
+
+    default value is 0. set 1 if the targeted font package is supposed to
+    be a default font for serif on a certain language.
+
+  - DEFAULT_MONO (optional)
+
+    default value is 0. set 1 if the targeted font package is supposed to
+    be a default font for monospace on a certain language.
+
+  - DEFAULT_EMOJI (optional)
+
+    default value is 0. set 1 if the targeted font package is supposed to
+    be a default font for emoji.
+
+  - DEFAULT_MATH (optional)
+
+    default value is 0. set 1 if the targeted font package is supposed to
+    be a default font for math.
+
+  - FONT_FAMILY
+  - FONT_LANG (optional)
+
+    default value is en. en will be used for und-zsye (emoji) and und-zmth (math).
+
 - Generic alias
 
   A test case to check if the expected generic alias is properly assigned.

diff --git a/tests/default_fonts/main.fmf b/tests/default_fonts/main.fmf
new file mode 100644
index 0000000..3c3d5e1
--- /dev/null
+++ b/tests/default_fonts/main.fmf
@@ -0,0 +1,6 @@
+summary: Impact to default fonts
+description: >
+  This aims to avoid a brakage to default fonts selection
+  when installing the targeted package.
+require+:
+  - default-fonts

diff --git a/tests/default_fonts/test.sh b/tests/default_fonts/test.sh
new file mode 100755
index 0000000..1012a50
--- /dev/null
+++ b/tests/default_fonts/test.sh
@@ -0,0 +1,39 @@
+#!/bin/bash
+# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
+. /usr/share/beakerlib/beakerlib.sh || exit 1
+
+DEFAULT_SANS=${DEFAULT_SANS:-0}
+DEFAULT_SERIF=${DEFAULT_SERIF:-0}
+DEFAULT_MONO=${DEFAULT_MONO:-0}
+DEFAULT_EMOJI=${DEFAULT_EMOJI:-0}
+DEFAULT_MATH=${DEFAULT_MATH:-0}
+FONT_FAMILY=${FONT_FAMILY:-"family name"}
+FONT_LANG=${FONT_LANG:-"en"}
+
+rlJournalStart
+    rlPhaseStartSetup
+        rlRun "tmp=\$(mktemp -d)" 0 "Create tmp directory"
+        rlRun "pushd $tmp"
+        rlRun "set -o pipefail"
+    rlPhaseEnd
+
+    rlPhaseStartTest
+        IFS=, read -ra langlist <<< "$FONT_LANG"
+        for g in sans serif mono emoji math; do
+            for l in "${langlist[@]}"; do
+                v="DEFAULT_${g^^}"
+                rlRun "fc-match -f \"%{family[0]}\" \":family=$g:lang=${l/und*/en}\" | tee output" 0 "Checking $g default font for lang $l"
+		if [ ${!v} -eq 1 ]; then
+                    rlAssertGrep "$FONT_FAMILY" "output"
+                else
+                    rlAssertNotGrep "$FONT_FAMILY" "output"
+                fi
+            done
+        done
+    rlPhaseEnd
+
+    rlPhaseStartCleanup
+        rlRun "popd"
+        rlRun "rm -r $tmp" 0 "Remove tmp directory"
+    rlPhaseEnd
+rlJournalEnd

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-08-13 10:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-13 10:29 [tests/fonts] rhel9: default_fonts: Add new test case Akira TAGOH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox