update testcase for testsuite texlive-feynmf

This commit is contained in:
2026-04-21 23:32:57 +08:00
parent b93b668e94
commit 92fc788ab2
5 changed files with 0 additions and 421 deletions

View File

@@ -7,25 +7,9 @@
"desc": "测试texlive-feynmf软件包的安装功能验证是否能正确安装到系统中",
"machine num": 1
},
{
"name": "test_texlive-feynmf_function_install",
"desc": "测试texlive-feynmf软件包能否被正确安装到系统中验证其作为LaTeX宏包的基本可用性。"
},
{
"name": "test_texlive-feynmf_function_remove",
"desc": "测试texlive-feynmf软件包能否被完全、干净地卸载不残留关键文件。"
},
{
"name": "test_texlive-feynmf_function_feynmf",
"desc": "测试feynmf宏包的核心功能编译包含简单费曼图的LaTeX文档验证是否能生成正确图形。"
},
{
"name": "test_texlive-feynmf_function_feynmfv",
"desc": "测试feynmfv宏包的垂直对齐功能编译使用垂直布局费曼图的LaTeX文档。"
},
{
"name": "test_texlive-feynmf_function_feynmp",
"desc": "测试feynmp宏包的元字体Metafont/MetaPost驱动功能编译使用Metapost的LaTeX文档验证图形生成。"
}
]
}

View File

@@ -1,92 +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-02-25
# @License : Mulan PSL v2
# @Desc : 测试feynmf宏包的核心功能编译包含简单费曼图的LaTeX文档验证是否能生成正确图形。
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
LOG_INFO "开始测试feynmf宏包的核心功能编译包含简单费曼图的LaTeX文档验证是否能生成正确图形。"
LOG_INFO "步骤1检查是否已经安装texlive-feynmf软件包"
if rpm -q texlive-feynmf &>/dev/null; then
LOG_INFO "texlive-feynmf已经安装测试结束后将保持安装状态"
INSTALLED=1
else
LOG_INFO "texlive-feynmf未安装将在测试过程中安装并在测试结束后卸载"
INSTALLED=0
fi
LOG_INFO "步骤2检查yum源中是否有texlive-feynmf软件包"
if ! dnf list available texlive-feynmf &>/dev/null; then
LOG_ERROR "yum源中未找到texlive-feynmf软件包"
exit 255
fi
if [ $INSTALLED -eq 0 ]; then
LOG_INFO "步骤3安装texlive-feynmf软件包"
dnf install -y texlive-feynmf
CHECK_RESULT $? 0 0 "安装texlive-feynmf失败"
fi
LOG_INFO "步骤4创建测试LaTeX文档"
cat > test_feynmf.tex << "EOF"
\documentclass{article}
\usepackage{feynmf}
\begin{document}
\begin{fmffile}{test_diagram}
\begin{fmfgraph*}(100,50)
\fmfleft{i1,i2}
\fmfright{o1,o2}
\fmf{fermion}{i1,v1,o1}
\fmf{fermion}{i2,v2,o2}
\fmf{photon}{v1,v2}
\fmflabel{$e^-$}{i1}
\fmflabel{$e^+$}{i2}
\fmflabel{$e^-$}{o1}
\fmflabel{$e^+$}{o2}
\end{fmfgraph*}
\end{fmffile}
\end{document}
EOF
CHECK_RESULT $? 0 0 "创建测试LaTeX文档失败"
LOG_INFO "步骤5编译LaTeX文档生成DVI文件"
pdflatex -interaction=nonstopmode test_feynmf.tex
CHECK_RESULT $? 0 0 "编译LaTeX文档失败"
LOG_INFO "步骤6检查生成的PDF文件是否存在"
if [ -f test_feynmf.pdf ]; then
LOG_INFO "成功生成包含费曼图的PDF文件"
else
LOG_ERROR "未生成PDF文件费曼图功能可能异常"
exit 1
fi
LOG_INFO "步骤7清理生成的中间文件"
rm -f test_feynmf.aux test_feynmf.log test_feynmf.out test_feynmf.fmf test_feynmf.dvi test_feynmf.pdf test_feynmf.tex
if [ $INSTALLED -eq 0 ]; then
LOG_INFO "步骤8卸载texlive-feynmf软件包"
dnf remove -y texlive-feynmf
CHECK_RESULT $? 0 0 "卸载texlive-feynmf失败"
fi
LOG_INFO "测试完成,环境已恢复"
}
main "$@"

View File

@@ -1,94 +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-02-25
# @License : Mulan PSL v2
# @Desc : 测试feynmfv宏包的垂直对齐功能编译使用垂直布局费曼图的LaTeX文档。
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
LOG_INFO "开始测试feynmfv宏包的垂直对齐功能编译使用垂直布局费曼图的LaTeX文档。"
LOG_INFO "步骤1检查texlive-feynmf软件包是否在yum源中。"
dnf list available texlive-feynmf &> /dev/null
if [ $? -ne 0 ]; then
LOG_ERROR "yum源中未找到texlive-feynmf软件包。"
exit 255
fi
LOG_INFO "步骤2检查当前环境是否已安装texlive-feynmf软件包。"
if rpm -q texlive-feynmf &> /dev/null; then
LOG_INFO "texlive-feynmf软件包已安装测试结束后将保持安装状态。"
INSTALLED_BEFORE_TEST=true
else
LOG_INFO "texlive-feynmf软件包未安装将作为测试步骤进行安装。"
INSTALLED_BEFORE_TEST=false
fi
if [ "$INSTALLED_BEFORE_TEST" = false ]; then
LOG_INFO "步骤3安装texlive-feynmf软件包。"
dnf install -y texlive-feynmf
CHECK_RESULT $? 0 0 "安装texlive-feynmf软件包失败。"
fi
LOG_INFO "步骤4创建测试LaTeX文档使用feynmfv宏包绘制垂直布局费曼图。"
cat > test_feynmfv.tex << "EOF"
\documentclass{article}
\usepackage{feynmf}
\begin{document}
\begin{fmffile}{test_diag}
\begin{fmfgraph*}(40,30)
\fmfleft{i1,i2}
\fmfright{o1,o2}
\fmf{fermion}{i1,v1,o1}
\fmf{fermion}{i2,v2,o2}
\fmf{photon}{v1,v2}
\fmfv{label=$e^-$,label.angle=90}{i1}
\fmfv{label=$e^+$,label.angle=90}{i2}
\fmfv{label=$\gamma$,label.angle=90}{v1}
\fmfv{label=$\gamma$,label.angle=90}{v2}
\end{fmfgraph*}
\end{fmffile}
\end{document}
EOF
CHECK_RESULT $? 0 0 "创建测试LaTeX文档失败。"
LOG_INFO "步骤5使用latex命令编译LaTeX文档。"
latex test_feynmfv.tex &> compile.log
CHECK_RESULT $? 0 0 "latex命令编译失败请检查LaTeX文档语法或feynmfv宏包功能。"
LOG_INFO "步骤6检查是否成功生成DVI文件。"
if [ -f test_feynmfv.dvi ]; then
LOG_INFO "成功生成DVI文件feynmfv宏包垂直对齐功能测试通过。"
else
LOG_ERROR "未生成DVI文件feynmfv宏包垂直对齐功能测试失败。"
exit 1
fi
LOG_INFO "步骤7清理测试生成的临时文件。"
rm -f test_feynmfv.tex test_feynmfv.aux test_feynmfv.log test_feynmfv.dvi compile.log test_feynmfv.fmf
if [ "$INSTALLED_BEFORE_TEST" = false ]; then
LOG_INFO "步骤8卸载测试安装的texlive-feynmf软件包。"
dnf remove -y texlive-feynmf
CHECK_RESULT $? 0 0 "卸载texlive-feynmf软件包失败。"
else
LOG_INFO "步骤8测试前已安装texlive-feynmf保持安装状态不进行卸载。"
fi
LOG_INFO "测试完成,环境已恢复。"
}
main "$@"

View File

@@ -1,119 +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-02-25
# @License : Mulan PSL v2
# @Desc : 测试feynmp宏包的元字体Metafont/MetaPost驱动功能编译使用Metapost的LaTeX文档验证图形生成。
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
set -e
LOG_INFO "开始测试feynmp宏包的元字体驱动功能"
LOG_INFO "检查texlive-feynmf软件包是否在yum源中"
if ! dnf list available texlive-feynmf &>/dev/null; then
LOG_ERROR "yum源中未找到texlive-feynmf软件包"
exit 255
fi
LOG_INFO "检查环境是否已安装texlive-feynmf"
if rpm -q texlive-feynmf &>/dev/null; then
LOG_INFO "检测到texlive-feynmf已安装测试结束后将保持安装状态"
INSTALLED=true
else
LOG_INFO "未检测到texlive-feynmf安装将进行安装"
INSTALLED=false
fi
if [ "$INSTALLED" = false ]; then
LOG_INFO "安装texlive-feynmf软件包"
dnf install -y texlive-feynmf
CHECK_RESULT $? 0 0 "安装texlive-feynmf失败"
fi
LOG_INFO "创建测试LaTeX文档"
cat > test_feynmp.tex << "EOF"
\documentclass{article}
\usepackage{feynmp}
\DeclareGraphicsRule{*}{mps}{*}{}
\begin{document}
\begin{fmffile}{testgraph}
\begin{fmfgraph}(40,25)
\fmfleft{i1,i2}
\fmfright{o1,o2}
\fmf{fermion}{i1,v1,o1}
\fmf{fermion}{i2,v2,o2}
\fmf{photon}{v1,v2}
\fmflabel{$e^-$}{i1}
\fmflabel{$e^+$}{i2}
\fmflabel{$e^-$}{o1}
\fmflabel{$e^+$}{o2}
\end{fmfgraph}
\end{fmffile}
\end{document}
EOF
CHECK_RESULT $? 0 0 "创建测试LaTeX文档失败"
LOG_INFO "使用latex编译文档生成dvi文件"
latex test_feynmp.tex
CHECK_RESULT $? 0 0 "latex编译失败"
LOG_INFO "检查是否生成了Metapost文件"
if [ -f testgraph.1 ]; then
LOG_INFO "成功生成Metapost文件testgraph.1"
else
LOG_ERROR "未生成Metapost文件testgraph.1"
exit 1
fi
LOG_INFO "使用mpost处理Metapost文件生成图形"
mpost testgraph.1
CHECK_RESULT $? 0 0 "mpost处理失败"
LOG_INFO "检查是否生成了图形文件"
if [ -f testgraph.1 ]; then
LOG_INFO "成功生成图形文件testgraph.1"
else
LOG_ERROR "未生成图形文件testgraph.1"
exit 1
fi
LOG_INFO "使用latex再次编译文档"
latex test_feynmp.tex
CHECK_RESULT $? 0 0 "latex再次编译失败"
LOG_INFO "检查是否生成了dvi文件"
if [ -f test_feynmp.dvi ]; then
LOG_INFO "成功生成dvi文件test_feynmp.dvi"
else
LOG_ERROR "未生成dvi文件test_feynmp.dvi"
exit 1
fi
LOG_INFO "清理测试生成的文件"
rm -f test_feynmp.aux test_feynmp.log test_feynmp.dvi testgraph.*
if [ "$INSTALLED" = false ]; then
LOG_INFO "卸载texlive-feynmf软件包"
dnf remove -y texlive-feynmf
CHECK_RESULT $? 0 0 "卸载texlive-feynmf失败"
fi
LOG_INFO "测试完成,环境已恢复"
}
main "$@"

View File

@@ -1,100 +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-02-25
# @License : Mulan PSL v2
# @Desc : 测试texlive-feynmf软件包能否被正确安装到系统中验证其作为LaTeX宏包的基本可用性。
# ############################################
source "$OET_PATH/libs/locallibs/common_lib.sh"
function run_test() {
LOG_INFO "开始测试texlive-feynmf软件包能否被正确安装到系统中验证其作为LaTeX宏包的基本可用性。"
LOG_INFO "1. 检查texlive-feynmf软件包是否已在yum源中"
dnf list available texlive-feynmf > /dev/null 2>&1
if [ $? -ne 0 ]; then
LOG_ERROR "yum源中未找到texlive-feynmf软件包"
exit 255
fi
LOG_INFO "texlive-feynmf软件包在yum源中存在"
LOG_INFO "2. 检查系统是否已安装texlive-feynmf软件包"
rpm -q texlive-feynmf > /dev/null 2>&1
if [ $? -eq 0 ]; then
LOG_INFO "texlive-feynmf软件包已安装测试将保持安装状态"
INSTALLED=1
else
LOG_INFO "texlive-feynmf软件包未安装将进行安装测试"
INSTALLED=0
fi
if [ $INSTALLED -eq 0 ]; then
LOG_INFO "3. 安装texlive-feynmf软件包"
dnf install -y texlive-feynmf
CHECK_RESULT $? 0 0 "安装texlive-feynmf软件包失败"
LOG_INFO "texlive-feynmf软件包安装成功"
fi
LOG_INFO "4. 验证texlive-feynmf作为LaTeX宏包的基本可用性"
LOG_INFO "4.1 检查feynmf宏包相关文件是否已安装"
if [ -d /usr/share/texlive/texmf-dist/tex/latex/feynmf ]; then
LOG_INFO "feynmf宏包目录存在"
ls /usr/share/texlive/texmf-dist/tex/latex/feynmf/*.sty > /dev/null 2>&1
CHECK_RESULT $? 0 0 "feynmf宏包样式文件不存在"
LOG_INFO "feynmf宏包样式文件存在"
else
LOG_ERROR "feynmf宏包目录不存在"
exit 1
fi
LOG_INFO "4.2 测试feynmf宏包文档是否可访问"
if [ -f /usr/share/texlive/texmf-dist/doc/latex/feynmf/feynmf.pdf ]; then
LOG_INFO "feynmf宏包文档存在"
else
LOG_ERROR "feynmf宏包文档不存在"
exit 1
fi
LOG_INFO "4.3 测试简单的LaTeX文件是否可编译使用feynmf宏包"
TEST_TEX_FILE="/tmp/test_feynmf.tex"
cat > $TEST_TEX_FILE << "EOF"
\documentclass{article}
\usepackage{feynmf}
\begin{document}
Test document with feynmf package.
\end{document}
EOF
pdflatex -interaction=nonstopmode $TEST_TEX_FILE > /dev/null 2>&1
CHECK_RESULT $? 0 0 "使用feynmf宏包的LaTeX文件编译失败"
LOG_INFO "使用feynmf宏包的LaTeX文件编译成功"
LOG_INFO "5. 清理测试生成的临时文件"
rm -f /tmp/test_feynmf.*
CHECK_RESULT $? 0 0 "清理临时文件失败"
if [ $INSTALLED -eq 0 ]; then
LOG_INFO "6. 卸载texlive-feynmf软件包恢复环境"
dnf remove -y texlive-feynmf
CHECK_RESULT $? 0 0 "卸载texlive-feynmf软件包失败"
LOG_INFO "texlive-feynmf软件包卸载成功环境已恢复"
else
LOG_INFO "6. 测试前已安装texlive-feynmf保持安装状态无需卸载"
fi
LOG_INFO "测试完成texlive-feynmf软件包能够正确安装并且作为LaTeX宏包基本可用"
}
main "$@"