public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [tests/fonts] rhel9: default_fonts: Add some tips to debug
@ 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 : 39c26cc5e3c948792f4eca3abdd42003193c703f
Author : Akira TAGOH <akira@tagoh.org>
Date   : 2024-11-15T17:03:58+09:00
Stats  : +22/-1 in 1 file(s)
URL    : https://src.fedoraproject.org/tests/fonts/c/39c26cc5e3c948792f4eca3abdd42003193c703f?branch=rhel9

Log:
default_fonts: Add some tips to debug

---
diff --git a/tests/default_fonts/test.sh b/tests/default_fonts/test.sh
index 28eeb2a..1c3a381 100755
--- a/tests/default_fonts/test.sh
+++ b/tests/default_fonts/test.sh
@@ -1,4 +1,5 @@
 #!/bin/bash
+# -*- tab-width: 4, indent-tabs-mode: nil -*-
 # vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
 
 . /usr/share/beakerlib/beakerlib.sh || exit 1
@@ -26,6 +27,7 @@ function test_default_fonts {
         fclang="en"
     fi
     rlPhaseStartTest "Default fonts test for $pkg"
+    {
         IFS=, read -ra langlist <<< "$fclang"
         for g in sans serif mono emoji math; do
             for l in "${langlist[@]}"; do
@@ -33,21 +35,38 @@ function test_default_fonts {
                 rlRun "fc-match -f \"%{family[0]}\\n\" \":family=$g:lang=${l/und*/en}\" | tee output" 0 "Checking $g default font for lang ${l/und*/en}"
                 if [ ${!v} -eq 1 ]; then
                     rlAssertGrep "^$FONT_FAMILY\$" "output"
+                    if [ $? -ne 0 ]; then
+                        rlLogInfo "    Hints:"
+                        rlLogInfo "      This failed because of:"
+                        rlLogInfo "        1) The actual result of font may have higher priority."
+                        rlLogInfo "        2) fontconfig file may be missing the generic alias rule for $g"
+                        rlLogInfo "        3) The value of DEFAULT_${g^^} may be wrong."
+                    fi
                 elif [ ${!v} -eq 0 ]; then
                     rlAssertNotGrep "^$FONT_FAMILY\$" "output"
+                    if [ $? -ne 0 ]; then
+                        rlLogInfo "    Hints:"
+                        rlLogInfo "      This failed because of:"
+                        rlLogInfo "        1) The actual result of font may have higher priority."
+                        rlLogInfo "        2) There are no default font for $g -> Consider adding DEFAULT_${g^^} with 2 tentatively"
+                    fi
                 else
                     rlLogWarning "Ignoring result, which means it isn't yet determined."
                 fi
             done
         done
+    }
     rlPhaseEnd
 }
 
 rlJournalStart
+{
     rlPhaseStartSetup
+    {
         rlRun "tmp=\$(mktemp -d)" 0 "Create tmp directory"
         rlRun "pushd $tmp"
         rlRun "set -o pipefail"
+    }
     rlPhaseEnd
 
     if [ -n "$VARLIST" ] && [ -f "$TMT_TREE/plans/$VARLIST" ]; then
@@ -60,8 +79,10 @@ rlJournalStart
     fi
 
     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 some tips to debug Akira TAGOH

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