public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Akira TAGOH <akira@tagoh.org>
To: git-commits@fedoraproject.org
Subject: [tests/fonts] rhel9: generic_alias: Add a feature to skip fontconfig files
Date: Thu, 13 Aug 2026 10:29:19 GMT	[thread overview]
Message-ID: <178661695987.1.15486731350483583168.tests-fonts-177244d0aec3@fedoraproject.org> (raw)

A new commit has been pushed.

Repo   : tests/fonts
Branch : rhel9
Commit : 177244d0aec3d337f751549cb533b22e10216bd3
Author : Akira TAGOH <akira@tagoh.org>
Date   : 2024-07-12T01:12:25+09:00
Stats  : +30/-6 in 2 file(s)
URL    : https://src.fedoraproject.org/tests/fonts/c/177244d0aec3d337f751549cb533b22e10216bd3?branch=rhel9

Log:
generic_alias: Add a feature to skip fontconfig files

---
diff --git a/README.rst b/README.rst
index e223e8c..df3469b 100644
--- a/README.rst
+++ b/README.rst
@@ -101,6 +101,10 @@ Available test cases
 
     default value is normal.
 
+  - FONT_CONF_EXCLUDE_FILES (optional)
+
+    Set a regex to skip some bogus fontconfig config files.
+
 - Language coverage
 
   A test case to check if a font in PACKAGE has sufficient coverage for FONT_LANG.
@@ -175,7 +179,7 @@ FAQ
   You can put required variables into a file on plans directory like the following format::
 
     # comment
-    PACKAGE;FONT_ALIAS;FONT_LANG;FONT_WIDTH;FONT_FAMILY;DEFAULT_SANS;DEFAULT_SERIF;DEFAULT_MONO;DEFAULT_EMOJI;DEFAULT_MATH;FONT_LANG_EXCLUDE_FILES;FONT_VALIDATE_EXCLUDE_FILES;
+    PACKAGE;FONT_ALIAS;FONT_LANG;FONT_WIDTH;FONT_FAMILY;DEFAULT_SANS;DEFAULT_SERIF;DEFAULT_MONO;DEFAULT_EMOJI;DEFAULT_MATH;FONT_LANG_EXCLUDE_FILES;FONT_VALIDATE_EXCLUDE_FILES;FONT_CONF_EXCLUDE_FILES;
     ...
 
   And then set a filename to VARLIST like::

diff --git a/tests/generic_alias/test.sh b/tests/generic_alias/test.sh
index b9cc12d..03b6869 100755
--- a/tests/generic_alias/test.sh
+++ b/tests/generic_alias/test.sh
@@ -7,13 +7,32 @@ FONT_ALIAS=${FONT_ALIAS:-"sans-serif"}
 FONT_FAMILY=${FONT_FAMILY:-"family name"}
 FONT_LANG=${FONT_LANG:-"en"}
 FONT_WIDTH=${FONT_WIDTH:-"normal"}
+FONT_CONF_EXCLUDE_FILES=${FONT_CONF_EXCLUDE_FILES:-}
 PACKAGE=${PACKAGE:-"blahblah-fonts"}
 VARLIST=${VARLIST:-}
 
+function check_exception {
+    local exregex=$1
+    local file=$2
+
+    if [ "x$exregex" == "x" ]; then
+        echo -n 1
+    else
+        echo $file | grep -E "$exregex" 2>&1 > /dev/null
+        echo -n $?
+    fi
+}
+
 function prepare_test {
     local pkg=$1
+    local fcexpat=${2:-}
+    local conffiles=()
 
-    rlRun "conffiles=\$(rpm -ql $pkg | grep conf.d | tr '\n' ' ')"
+    rlRun "_conffiles=\$(rpm -ql $pkg | grep conf.d | tr '\n' ' ')"
+    for f in $_conffiles; do
+        [[ $(check_exception $fcexpat $f) -ne 0 ]] && conffiles+=($f)
+    done
+    rlAssertNotEquals "Check if config is available" ${#conffiles[@]} 0
     rlRun "conf=\$(for i in $conffiles; do echo \"  <include>\$i</include>\"; done)"
     rlRun "cat <<_E_> $tmpconfd/$pkg.conf
 <fontconfig>
@@ -38,9 +57,10 @@ function test_generic_alias {
     local fclang=${3:-"en"}
     local fcwidth=${4:-"normal"}
     local fcresult=${5:-"unknown family"}
+    local fcexpat=${6:-}
 
     rlPhaseStartTest "Generic alias test for $pkg"
-        prepare_test $pkg
+        prepare_test $pkg $fcexpat
         rlRun "cat $tmpconfd/$pkg.conf"
 	if [ "$fclang" == "-" ]; then
             rlLogInfo "$pkg:$fcfamily: Skipped."
@@ -62,13 +82,13 @@ rlJournalStart
 
     if [ -n "$VARLIST" ] && [ -f "$TMT_TREE/plans/$VARLIST" ]; then
         rlLogInfo "Reading variables from $VARLIST"
-        cat "$TMT_TREE/plans/$VARLIST" | grep -E -v "^#" | while IFS=";" read -r PACKAGE FONT_ALIAS FONT_LANG FONT_WIDTH FONT_FAMILY dummy; do
+        cat "$TMT_TREE/plans/$VARLIST" | grep -E -v "^#" | while IFS=";" read -r PACKAGE FONT_ALIAS FONT_LANG FONT_WIDTH FONT_FAMILY SANS SERIF MONO EMOJI MATH FONT_LANG_EXCLUDE_FILES FONT_VALIDATE_EXCLUDE_FILES FONT_CONF_EXCLUDE_FILES dummy; do
             test_pkg "$PACKAGE"
-            test_generic_alias "$PACKAGE" "$FONT_ALIAS" "$FONT_LANG" "$FONT_WIDTH" "$FONT_FAMILY"
+            test_generic_alias "$PACKAGE" "$FONT_ALIAS" "$FONT_LANG" "$FONT_WIDTH" "$FONT_FAMILY" "$FONT_CONF_EXCLUDE_FILES"
         done
     else
         test_pkg "$PACKAGE"
-        test_generic_alias "$PACKAGE" "$FONT_ALIAS" "$FONT_LANG" "$FONT_WIDTH" "$FONT_FAMILY"
+        test_generic_alias "$PACKAGE" "$FONT_ALIAS" "$FONT_LANG" "$FONT_WIDTH" "$FONT_FAMILY" "$FONT_CONF_EXCLUDE_FILES"
     fi
 
     rlPhaseStartCleanup

                 reply	other threads:[~2026-08-13 10:29 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=178661695987.1.15486731350483583168.tests-fonts-177244d0aec3@fedoraproject.org \
    --to=akira@tagoh.org \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox