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

Log:
generic_alias: Add some tips to debug

---
diff --git a/tests/generic_alias/test.sh b/tests/generic_alias/test.sh
index 4ed433b..4e0d2c6 100755
--- a/tests/generic_alias/test.sh
+++ b/tests/generic_alias/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
@@ -45,8 +46,10 @@ _E_" 0 "Create fonts.conf for $pkg"
 function test_pkg {
     local pkg=$1
 
-    rlPhaseStartTest "Package installation test for $pkg" #{
-        rlRun "rpm -q $pkg" 0 "Package installation test" #}
+    rlPhaseStartTest "Package installation test for $pkg"
+    {
+        rlAssertRpm $pkg
+    }
     rlPhaseEnd
 }
 
@@ -59,25 +62,34 @@ function test_generic_alias {
     local fcexpat=${6:-}
 
     rlPhaseStartTest "Generic alias test for $pkg"
+    {
         prepare_test $pkg $fcexpat
         rlRun "cat $tmpconfd/$pkg.conf"
-	if [ "$fclang" == "-" ]; then
+        if [ "$fclang" == "-" ]; then
             rlLogInfo "$pkg:$fcfamily: Skipped."
         else
             rlRun "FONTCONFIG_FILE=$tmpconfd/$pkg.conf fc-match -f \"%{family[0]}\\n\" \":family=$fcfamily:lang=$fclang:width=$fcwidth\" > output" 0 "Matching a font"
-	    rlLogInfo "echo \"Actual result: $(cat output)\""
+            rlLogInfo "    Actual result: $(cat output)"
             rlAssertGrep "^$fcresult\$" "output"
-        fi
+            if [ $? -ne 0 ]; then
+                rlLogInfo "    Hints:"
+                rlLogInfo "      This failed because of:"
+                rlLogInfo "        1) There are no generic alias rule in fontconfig file."
+            fi
+    }
     rlPhaseEnd
 }
 
 rlJournalStart
+{
     rlPhaseStartSetup
+    {
         rlRun "tmp=\$(mktemp -d)" 0 "Create tmp directory"
         rlRun "pushd $tmp"
         rlRun "set -o pipefail"
         rlRun "cachedir=\$(pkg-config --variable cachedir fontconfig)" 0 "Set cachedir"
         rlRun "tmpconfd=\$(mktemp -d)" 0 "Create tmp conf.d directory"
+    }
     rlPhaseEnd
 
     if [ -n "$VARLIST" ] && [ -f "$TMT_TREE/plans/$VARLIST" ]; then
@@ -92,8 +104,10 @@ rlJournalStart
     fi
 
     rlPhaseStartCleanup
+    {
         rlRun "popd"
         rlRun "rm -r $tmpconfd $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: generic_alias: 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