update testcase for testsuite texlive-yinit-otf

This commit is contained in:
2026-04-17 01:32:56 +08:00
parent 912fdf4495
commit 8cc3e3753e
2 changed files with 0 additions and 84 deletions

View File

@@ -17,10 +17,6 @@
{
"name": "test_texlive-yinit-otf_function_list_files",
"desc": "Test listing package files"
},
{
"name": "test_texlive-yinit-otf_function_font_usage",
"desc": "Test font usage in LaTeX"
}
]
}

View File

@@ -1,80 +0,0 @@
#!/usr/bin/bash
# Copyright (c) 2024 ISCAS .ALL rights reserved.
# This program is licensed under Mulan PSL v2.
# You can use it according to the terms and conditions of the Mulan PSL v2.
# http://license.coscl.org.cn/MulanPSL2
# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
# See the Mulan PSL v2 for more details.
# #############################################
# @Author : honghua
# @Contact : honghua@iscas.ac.cn
# @Date : 2026-04-03
# @License : Mulan PSL v2
# @Desc : Test font usage in LaTeX
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
# 判断是否已安装texlive-yinit-otf
LOG_INFO "检查texlive-yinit-otf是否已安装"
rpm -q texlive-yinit-otf > /dev/null 2>&1
if [ $? -eq 0 ]; then
LOG_INFO "texlive-yinit-otf已安装测试结束后将保持安装状态"
INSTALLED=1
else
LOG_INFO "texlive-yinit-otf未安装将在测试结束后卸载"
INSTALLED=0
fi
# 检查yum源中是否有texlive-yinit-otf软件包
LOG_INFO "检查yum源中是否有texlive-yinit-otf软件包"
dnf list available texlive-yinit-otf > /dev/null 2>&1
if [ $? -ne 0 ]; then
LOG_ERROR "yum源中未找到texlive-yinit-otf软件包"
exit 255
fi
# 如果未安装,则安装软件包
if [ $INSTALLED -eq 0 ]; then
LOG_INFO "开始安装texlive-yinit-otf软件包"
dnf install -y texlive-yinit-otf
CHECK_RESULT $? 0 0 "安装texlive-yinit-otf失败"
fi
# 测试字体在LaTeX中的使用
LOG_INFO "测试字体在LaTeX中的使用"
# 创建测试LaTeX文档
cat > test_font.tex << "EOF"
\documentclass{article}
\usepackage{yinit-otf}
\begin{document}
\yinit{测试字体使用}
\end{document}
EOF
# 编译LaTeX文档测试字体
pdflatex test_font.tex > /dev/null 2>&1
CHECK_RESULT $? 0 0 "LaTeX文档编译失败字体使用测试未通过"
# 清理测试文件
LOG_INFO "清理测试文件"
rm -f test_font.tex test_font.aux test_font.log test_font.pdf
# 环境恢复
if [ $INSTALLED -eq 0 ]; then
LOG_INFO "卸载texlive-yinit-otf软件包"
dnf remove -y texlive-yinit-otf
CHECK_RESULT $? 0 0 "卸载texlive-yinit-otf失败"
else
LOG_INFO "保持texlive-yinit-otf安装状态"
fi
LOG_INFO "测试完成"
}
main "$@"