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: default_fonts: Add a feature to read variables from file
Date: Thu, 13 Aug 2026 10:29:16 GMT [thread overview]
Message-ID: <178661695621.1.16631886606546163294.tests-fonts-478f539b1142@fedoraproject.org> (raw)
A new commit has been pushed.
Repo : tests/fonts
Branch : rhel9
Commit : 478f539b114220b39a62c583f62d02893f0e0068
Author : Akira TAGOH <akira@tagoh.org>
Date : 2024-07-05T16:52:32+09:00
Stats : +35/-10 in 1 file(s)
URL : https://src.fedoraproject.org/tests/fonts/c/478f539b114220b39a62c583f62d02893f0e0068?branch=rhel9
Log:
default_fonts: Add a feature to read variables from file
---
diff --git a/tests/default_fonts/test.sh b/tests/default_fonts/test.sh
index 207581a..99c2ded 100755
--- a/tests/default_fonts/test.sh
+++ b/tests/default_fonts/test.sh
@@ -1,5 +1,8 @@
#!/bin/bash
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
+
+basedir=$(pwd)
+
. /usr/share/beakerlib/beakerlib.sh || exit 1
DEFAULT_SANS=${DEFAULT_SANS:-0}
@@ -9,21 +12,25 @@ DEFAULT_EMOJI=${DEFAULT_EMOJI:-0}
DEFAULT_MATH=${DEFAULT_MATH:-0}
FONT_FAMILY=${FONT_FAMILY:-"family name"}
FONT_LANG=${FONT_LANG:-"en"}
+VARLIST=${VARLIST:-}
-rlJournalStart
- rlPhaseStartSetup
- rlRun "tmp=\$(mktemp -d)" 0 "Create tmp directory"
- rlRun "pushd $tmp"
- rlRun "set -o pipefail"
- rlPhaseEnd
+function test_default_fonts {
+ local pkg=${1:-"unknown package"}
+ local fcfamily=${2:-"unknown family"}
+ local fclang=${3:-"en"}
+ local defaultsans=${4:-0}
+ local defaultserif=${5:-0}
+ local defaultmono=${6:-0}
+ local defaultemoji=${7:-0}
+ local defaultmath=${8:-0}
- rlPhaseStartTest
- IFS=, read -ra langlist <<< "$FONT_LANG"
+ 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
- v="DEFAULT_${g^^}"
+ v="default$g"
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
+ if [ ${!v} -eq 1 ]; then
rlAssertGrep "^$FONT_FAMILY\$" "output"
else
rlAssertNotGrep "^$FONT_FAMILY\$" "output"
@@ -31,9 +38,27 @@ rlJournalStart
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 "$basedir/../../plans/$VARLIST" ]; then
+ rlLogInfo "Reading variables from $VARLIST"
+ cat "$basedir/../../plans/$VARLIST" | grep -E -v "^#" | while IFS=";" read -r PACKAGE FONT_ALIAS FONT_LANG FONT_WIDTH FONT_FAMILY DEFAULT_SANS DEFAULT_SERIF DEFAULT_MONO DEFAULT_EMOJI DEFAULT_MATH dummy; do
+ test_default_fonts "$PACKAGE" "$FONT_FAMILY" "$FONT_LANG" "$DEFAULT_SANS" "$DEFAULT_SERIF" "$DEFAULT_MONO" "$DEFAULT_EMOJI" "$DEFAULT_MATH"
+ done
+ else
+ test_default_fonts "$PACKAGE" "$FONT_FAMILY" "$FONT_LANG" "$DEFAULT_SANS" "$DEFAULT_SERIF" "$DEFAULT_MONO" "$DEFAULT_EMOJI" "$DEFAULT_MATH"
+ fi
rlPhaseStartCleanup
rlRun "popd"
rlRun "rm -r $tmp" 0 "Remove tmp directory"
rlPhaseEnd
+
rlJournalEnd
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=178661695621.1.16631886606546163294.tests-fonts-478f539b1142@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