Merge branch 'pkg' of http://10.30.190.190:54866/redrsoe2100/os-autotest into pkg
This commit is contained in:
@@ -1,10 +0,0 @@
|
||||
{
|
||||
"path": "$OET_PATH/testcases/function_test/pkg_test/glassfish-jsp/glassfish-jsp-help",
|
||||
"machine num": 1,
|
||||
"cases": [
|
||||
{
|
||||
"name": "test_glassfish-jsp-help_function_parse",
|
||||
"desc": "Test parsing functionality"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -14,10 +14,6 @@
|
||||
"name": "test_guice-bom_function_check_install",
|
||||
"desc": "Check if guice-bom package is installed in the system"
|
||||
},
|
||||
{
|
||||
"name": "test_guice-bom_function_list_versions",
|
||||
"desc": "List available versions of guice-bom"
|
||||
},
|
||||
{
|
||||
"name": "test_guice-bom_function_show_info",
|
||||
"desc": "Display detailed information of guice-bom package"
|
||||
@@ -25,10 +21,6 @@
|
||||
{
|
||||
"name": "test_guice-bom_function_verify_integrity",
|
||||
"desc": "Verify the integrity of installed guice-bom package"
|
||||
},
|
||||
{
|
||||
"name": "test_guice-bom_function_usage_in_pom",
|
||||
"desc": "Test using guice-bom as a BOM in a Maven project"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
{
|
||||
"path": "$OET_PATH/testcases/function_test/pkg_test/libwmf/libwmf-devel",
|
||||
"machine num": 1,
|
||||
"cases": [
|
||||
{
|
||||
"name": "test_libwmf-devel_function_install",
|
||||
"desc": "Test package installation"
|
||||
},
|
||||
{
|
||||
"name": "test_libwmf-devel_function_basic",
|
||||
"desc": "Test basic library functionality"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -7,10 +7,6 @@
|
||||
"desc": "测试软件包qt5-qtscxml-devel的安装功能,验证是否能够成功安装到系统中。",
|
||||
"machine num": 1
|
||||
},
|
||||
{
|
||||
"name": "test_qt5-qtscxml-devel_function_parsing",
|
||||
"desc": "测试软件包qt5-qtscxml-devel的XML解析功能,验证是否能正确解析SCXML文件。"
|
||||
},
|
||||
{
|
||||
"name": "test_qt5-qtscxml-devel_uninstall",
|
||||
"desc": "测试软件包qt5-qtscxml-devel的卸载功能,验证是否能够从系统中完全移除。"
|
||||
@@ -18,22 +14,6 @@
|
||||
{
|
||||
"name": "test_qt5-qtscxml-devel_check_install",
|
||||
"desc": "检查软件包qt5-qtscxml-devel是否已正确安装并包含必要的头文件和库文件。"
|
||||
},
|
||||
{
|
||||
"name": "test_qt5-qtscxml-devel_function_validation",
|
||||
"desc": "测试软件包qt5-qtscxml-devel对SCXML文件的语法和结构验证功能。"
|
||||
},
|
||||
{
|
||||
"name": "test_qt5-qtscxml-devel_function_state_machine",
|
||||
"desc": "测试基于qt5-qtscxml-devel创建和运行状态机的基本功能。"
|
||||
},
|
||||
{
|
||||
"name": "test_qt5-qtscxml-devel_function_compilation",
|
||||
"desc": "测试使用qt5-qtscxml-devel提供的工具(如qscxmlc)编译SCXML文件为C++代码的功能。"
|
||||
},
|
||||
{
|
||||
"name": "test_qt5-qtscxml-devel_function_integration",
|
||||
"desc": "测试将生成的SCXML状态机代码与Qt应用程序集成的功能。"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
{
|
||||
"path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-o/texlive-mathpartir",
|
||||
"machine num": 1,
|
||||
"cases": [
|
||||
{
|
||||
"name": "test_texlive-mathpartir_function_install",
|
||||
"desc": "Test package installation"
|
||||
},
|
||||
{
|
||||
"name": "test_texlive-mathpartir_function_usage",
|
||||
"desc": "Test basic usage"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -2,30 +2,10 @@
|
||||
"path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-v/texlive-soul",
|
||||
"machine num": 1,
|
||||
"cases": [
|
||||
{
|
||||
"name": "test_texlive-soul_function_spacing",
|
||||
"desc": "Test the spacing adjustment feature of the soul package"
|
||||
},
|
||||
{
|
||||
"name": "test_texlive-soul_function_install",
|
||||
"desc": "Test if the texlive-soul package can be successfully installed via package manager"
|
||||
},
|
||||
{
|
||||
"name": "test_texlive-soul_function_letter_spacing",
|
||||
"desc": "Test the letter-spacing feature of the soul package"
|
||||
},
|
||||
{
|
||||
"name": "test_texlive-soul_function_word_spacing",
|
||||
"desc": "Test the word-spacing feature of the soul package"
|
||||
},
|
||||
{
|
||||
"name": "test_texlive-soul_function_underlining",
|
||||
"desc": "Test the text underlining feature of the soul package"
|
||||
},
|
||||
{
|
||||
"name": "test_texlive-soul_function_strikeout",
|
||||
"desc": "Test the text strikeout feature of the soul package"
|
||||
},
|
||||
{
|
||||
"name": "test_texlive-soul_function_uninstall",
|
||||
"desc": "Test if the texlive-soul package can be cleanly uninstalled"
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
{
|
||||
"path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-y/texlive-withargs-doc",
|
||||
"machine num": 1,
|
||||
"cases": [
|
||||
{
|
||||
"name": "test_texlive-withargs-doc_function_install",
|
||||
"desc": "Test installation of texlive-withargs-doc"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -13,14 +13,6 @@
|
||||
{
|
||||
"name": "test_tpm2-abrmd-help_function_uninstall",
|
||||
"desc": "测试软件包能够成功卸载。"
|
||||
},
|
||||
{
|
||||
"name": "test_tpm2-abrmd-help_function_help",
|
||||
"desc": "测试软件包提供的帮助信息是否正确。"
|
||||
},
|
||||
{
|
||||
"name": "test_tpm2-abrmd-help_function_version",
|
||||
"desc": "测试查询软件包的版本信息。"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,71 +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 : 2025-12-10
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : Test parsing functionality
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
LOG_INFO "开始测试:Test parsing functionality"
|
||||
|
||||
# 检查软件包是否已安装
|
||||
LOG_INFO "检查glassfish-jsp-help软件包是否已安装"
|
||||
if dnf list installed glassfish-jsp-help &>/dev/null; then
|
||||
LOG_INFO "glassfish-jsp-help软件包已安装,测试结束后保持安装状态"
|
||||
INSTALLED=true
|
||||
else
|
||||
LOG_INFO "glassfish-jsp-help软件包未安装,测试结束后将卸载"
|
||||
INSTALLED=false
|
||||
fi
|
||||
|
||||
# 检查yum源中是否有该软件包
|
||||
LOG_INFO "检查yum源中是否有glassfish-jsp-help软件包"
|
||||
if ! dnf list available glassfish-jsp-help &>/dev/null; then
|
||||
LOG_ERROR "yum源中未找到glassfish-jsp-help软件包"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 如果未安装,则安装软件包
|
||||
if [ "$INSTALLED" = false ]; then
|
||||
LOG_INFO "开始安装glassfish-jsp-help软件包"
|
||||
dnf install -y glassfish-jsp-help
|
||||
CHECK_RESULT $? 0 0 "安装glassfish-jsp-help失败"
|
||||
fi
|
||||
|
||||
# 测试解析功能
|
||||
LOG_INFO "测试glassfish-jsp-help的解析功能"
|
||||
output=$(glassfish-jsp-help --help)
|
||||
CHECK_RESULT $? 0 0 "执行glassfish-jsp-help --help失败"
|
||||
|
||||
# 检查参数是否支持
|
||||
LOG_INFO "检查--help参数是否支持"
|
||||
if [[ "$output" != *"--help"* ]]; then
|
||||
LOG_ERROR "--help参数不支持或不存在"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 清理环境
|
||||
if [ "$INSTALLED" = false ]; then
|
||||
LOG_INFO "卸载glassfish-jsp-help软件包"
|
||||
dnf remove -y glassfish-jsp-help
|
||||
CHECK_RESULT $? 0 0 "卸载glassfish-jsp-help失败"
|
||||
fi
|
||||
|
||||
LOG_INFO "测试完成:Test parsing functionality"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -1,53 +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-05
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : List available versions of guice-bom
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
LOG_INFO "开始测试:List available versions of guice-bom"
|
||||
LOG_INFO "步骤1:检查guice-bom是否已安装"
|
||||
if dnf list installed | grep -q guice-bom; then
|
||||
LOG_INFO "guice-bom已安装,测试结束后保持安装状态"
|
||||
INSTALLED=1
|
||||
else
|
||||
LOG_INFO "guice-bom未安装,将在测试中安装"
|
||||
INSTALLED=0
|
||||
fi
|
||||
LOG_INFO "步骤2:检查yum源中是否有guice-bom软件包"
|
||||
if ! dnf list available guice-bom &>/dev/null; then
|
||||
LOG_ERROR "yum源中未找到guice-bom软件包"
|
||||
exit 255
|
||||
fi
|
||||
if [ $INSTALLED -eq 0 ]; then
|
||||
LOG_INFO "步骤3:安装guice-bom"
|
||||
dnf install -y guice-bom
|
||||
CHECK_RESULT $? 0 0 "安装guice-bom失败"
|
||||
fi
|
||||
LOG_INFO "步骤4:执行命令列出guice-bom可用版本"
|
||||
guice-bom --list-versions
|
||||
CHECK_RESULT $? 0 0 "列出guice-bom版本失败"
|
||||
if [ $INSTALLED -eq 0 ]; then
|
||||
LOG_INFO "步骤5:卸载guice-bom"
|
||||
dnf remove -y guice-bom
|
||||
CHECK_RESULT $? 0 0 "卸载guice-bom失败"
|
||||
fi
|
||||
LOG_INFO "测试完成:List available versions of guice-bom"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -1,104 +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-05
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : Test using guice-bom as a BOM in a Maven project
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
LOG_INFO "开始测试:Test using guice-bom as a BOM in a Maven project"
|
||||
|
||||
LOG_INFO "步骤1:检查环境是否已安装guice-bom"
|
||||
if dnf list installed | grep -q guice-bom; then
|
||||
LOG_INFO "guice-bom已安装,保持安装状态"
|
||||
INSTALLED="true"
|
||||
else
|
||||
LOG_INFO "guice-bom未安装,将在测试过程中安装"
|
||||
INSTALLED="false"
|
||||
fi
|
||||
|
||||
LOG_INFO "步骤2:检查yum源中是否有guice-bom软件包"
|
||||
if ! dnf list available | grep -q guice-bom; then
|
||||
LOG_ERROR "yum源中未找到guice-bom软件包"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
LOG_INFO "步骤3:安装guice-bom软件包(如果未安装)"
|
||||
if [ "$INSTALLED" = "false" ]; then
|
||||
dnf install -y guice-bom
|
||||
CHECK_RESULT $? 0 0 "安装guice-bom失败"
|
||||
LOG_INFO "guice-bom安装成功"
|
||||
fi
|
||||
|
||||
LOG_INFO "步骤4:创建测试Maven项目"
|
||||
mkdir -p /tmp/test-guice-bom
|
||||
cd /tmp/test-guice-bom
|
||||
cat > pom.xml <<EOF
|
||||
<project>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>com.example</groupId>
|
||||
<artifactId>test-guice-bom</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.google.inject</groupId>
|
||||
<artifactId>guice-bom</artifactId>
|
||||
<version>5.0.1</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.google.inject</groupId>
|
||||
<artifactId>guice</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
EOF
|
||||
CHECK_RESULT $? 0 0 "创建pom.xml失败"
|
||||
|
||||
LOG_INFO "步骤5:使用Maven验证依赖解析"
|
||||
if command -v mvn &> /dev/null; then
|
||||
mvn dependency:resolve
|
||||
CHECK_RESULT $? 0 0 "Maven依赖解析失败"
|
||||
LOG_INFO "Maven依赖解析成功"
|
||||
else
|
||||
LOG_INFO "未安装Maven,跳过依赖解析步骤"
|
||||
fi
|
||||
|
||||
LOG_INFO "步骤6:清理测试项目"
|
||||
cd /
|
||||
rm -rf /tmp/test-guice-bom
|
||||
CHECK_RESULT $? 0 0 "清理测试项目失败"
|
||||
|
||||
LOG_INFO "步骤7:恢复环境状态"
|
||||
if [ "$INSTALLED" = "false" ]; then
|
||||
LOG_INFO "卸载测试安装的guice-bom软件包"
|
||||
dnf remove -y guice-bom
|
||||
CHECK_RESULT $? 0 0 "卸载guice-bom失败"
|
||||
LOG_INFO "guice-bom卸载成功"
|
||||
else
|
||||
LOG_INFO "保持guice-bom安装状态"
|
||||
fi
|
||||
|
||||
LOG_INFO "测试完成:Test using guice-bom as a BOM in a Maven project"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -1,66 +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 : 2025-12-10
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : Test basic library functionality
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
|
||||
# 检查libwmf-devel软件包是否已安装
|
||||
LOG_INFO "检查libwmf-devel软件包是否已安装"
|
||||
rpm -q libwmf-devel > /dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
LOG_INFO "libwmf-devel软件包已安装,脚本结束时将保持安装状态"
|
||||
INSTALLED=true
|
||||
else
|
||||
LOG_INFO "libwmf-devel软件包未安装,脚本结束前将卸载该软件包"
|
||||
INSTALLED=false
|
||||
fi
|
||||
|
||||
# 检查yum源中是否有libwmf-devel软件包
|
||||
LOG_INFO "检查yum源中是否有libwmf-devel软件包"
|
||||
dnf list available libwmf-devel > /dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
LOG_ERROR "yum源中未找到libwmf-devel软件包"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 安装libwmf-devel软件包(如果未安装)
|
||||
if [ "$INSTALLED" = false ]; then
|
||||
LOG_INFO "正在安装libwmf-devel软件包"
|
||||
dnf install -y libwmf-devel > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "安装libwmf-devel软件包失败"
|
||||
fi
|
||||
|
||||
# 测试基本库功能
|
||||
LOG_INFO "测试libwmf库的基本功能"
|
||||
wmftopnm --version > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "测试libwmf库功能失败"
|
||||
|
||||
# 清理环境(如果之前未安装)
|
||||
if [ "$INSTALLED" = false ]; then
|
||||
LOG_INFO "正在卸载libwmf-devel软件包"
|
||||
dnf remove -y libwmf-devel > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "卸载libwmf-devel软件包失败"
|
||||
fi
|
||||
|
||||
LOG_INFO "测试脚本执行完成,环境已恢复"
|
||||
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -1,59 +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 : 2025-10-18
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : Test package installation
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
# 检查是否已经安装了libwmf-devel软件包
|
||||
LOG_INFO "检查是否已经安装了libwmf-devel软件包"
|
||||
rpm -q libwmf-devel > /dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
LOG_INFO "libwmf-devel已经安装,脚本结束时保持安装状态"
|
||||
installed=true
|
||||
else
|
||||
LOG_INFO "libwmf-devel未安装,将在脚本结束前卸载"
|
||||
installed=false
|
||||
fi
|
||||
|
||||
# 检查yum源中是否有libwmf-devel软件包
|
||||
LOG_INFO "检查yum源中是否有libwmf-devel软件包"
|
||||
dnf list available libwmf-devel > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 255 "yum源中没有libwmf-devel软件包"
|
||||
|
||||
# 安装libwmf-devel软件包
|
||||
LOG_INFO "安装libwmf-devel软件包"
|
||||
dnf install -y libwmf-devel
|
||||
CHECK_RESULT $? 0 0 "安装libwmf-devel失败"
|
||||
|
||||
# 验证安装是否成功
|
||||
LOG_INFO "验证libwmf-devel是否安装成功"
|
||||
rpm -q libwmf-devel > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "libwmf-devel未成功安装"
|
||||
|
||||
# 如果之前未安装,则在脚本结束前卸载
|
||||
if [ "$installed" = false ]; then
|
||||
LOG_INFO "卸载libwmf-devel软件包"
|
||||
dnf remove -y libwmf-devel
|
||||
CHECK_RESULT $? 0 0 "卸载libwmf-devel失败"
|
||||
fi
|
||||
|
||||
LOG_INFO "测试完成,环境已恢复"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -1,110 +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-03-24
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : 测试使用qt5-qtscxml-devel提供的工具(如qscxmlc)编译SCXML文件为C++代码的功能。
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
set -e
|
||||
|
||||
LOG_INFO "开始测试qt5-qtscxml-devel提供的工具编译SCXML文件为C++代码的功能"
|
||||
|
||||
LOG_INFO "步骤1:检查yum源中是否存在qt5-qtscxml-devel软件包"
|
||||
if ! dnf list available qt5-qtscxml-devel &>/dev/null; then
|
||||
LOG_ERROR "yum源中未找到qt5-qtscxml-devel软件包"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
LOG_INFO "步骤2:检查系统是否已安装qt5-qtscxml-devel"
|
||||
if rpm -q qt5-qtscxml-devel &>/dev/null; then
|
||||
LOG_INFO "qt5-qtscxml-devel已安装,标记为无需清理"
|
||||
NEED_CLEANUP=0
|
||||
else
|
||||
LOG_INFO "qt5-qtscxml-devel未安装,将在测试过程中安装"
|
||||
NEED_CLEANUP=1
|
||||
fi
|
||||
|
||||
LOG_INFO "步骤3:检查qscxmlc命令是否可用或需要安装"
|
||||
if ! command -v qscxmlc &>/dev/null; then
|
||||
if [ $NEED_CLEANUP -eq 1 ]; then
|
||||
LOG_INFO "安装qt5-qtscxml-devel软件包"
|
||||
dnf install -y qt5-qtscxml-devel
|
||||
CHECK_RESULT $? 0 0 "安装qt5-qtscxml-devel失败"
|
||||
else
|
||||
LOG_ERROR "qscxmlc命令不存在且软件包已安装,可能安装不完整"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
LOG_INFO "步骤4:检查qscxmlc命令支持的参数"
|
||||
if ! qscxmlc --help &>/dev/null; then
|
||||
LOG_ERROR "qscxmlc命令不支持--help参数或执行失败"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
LOG_INFO "步骤5:创建一个简单的SCXML测试文件"
|
||||
TEST_SCXML_FILE="/tmp/test_state_machine.scxml"
|
||||
cat > "$TEST_SCXML_FILE" << "EOF"
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<scxml xmlns="http://www.w3.org/2005/07/scxml" version="1.0" initial="off">
|
||||
<state id="off">
|
||||
<transition event="switch.on" target="on"/>
|
||||
</state>
|
||||
<state id="on">
|
||||
<transition event="switch.off" target="off"/>
|
||||
</state>
|
||||
</scxml>
|
||||
EOF
|
||||
CHECK_RESULT $? 0 0 "创建SCXML测试文件失败"
|
||||
|
||||
LOG_INFO "步骤6:使用qscxmlc编译SCXML文件为C++代码"
|
||||
OUTPUT_HEADER="/tmp/test_state_machine.h"
|
||||
OUTPUT_SOURCE="/tmp/test_state_machine.cpp"
|
||||
qscxmlc "$TEST_SCXML_FILE" -o "$OUTPUT_HEADER" -impl "$OUTPUT_SOURCE"
|
||||
CHECK_RESULT $? 0 0 "使用qscxmlc编译SCXML文件失败"
|
||||
|
||||
LOG_INFO "步骤7:验证生成的C++头文件和源文件"
|
||||
if [ -f "$OUTPUT_HEADER" ] && [ -f "$OUTPUT_SOURCE" ]; then
|
||||
LOG_INFO "成功生成C++头文件和源文件"
|
||||
if grep -q "class.*StateMachine" "$OUTPUT_HEADER"; then
|
||||
LOG_INFO "生成的头文件包含预期的类定义"
|
||||
else
|
||||
LOG_ERROR "生成的头文件内容不符合预期"
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
LOG_ERROR "未成功生成C++头文件或源文件"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
LOG_INFO "步骤8:清理测试生成的文件"
|
||||
rm -f "$TEST_SCXML_FILE" "$OUTPUT_HEADER" "$OUTPUT_SOURCE"
|
||||
CHECK_RESULT $? 0 0 "清理测试文件失败"
|
||||
|
||||
if [ $NEED_CLEANUP -eq 1 ]; then
|
||||
LOG_INFO "步骤9:卸载测试安装的qt5-qtscxml-devel软件包"
|
||||
dnf remove -y qt5-qtscxml-devel
|
||||
CHECK_RESULT $? 0 0 "卸载qt5-qtscxml-devel失败"
|
||||
else
|
||||
LOG_INFO "步骤9:保持原有安装状态,无需卸载"
|
||||
fi
|
||||
|
||||
LOG_INFO "qt5-qtscxml-devel编译功能测试完成"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -1,154 +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-03-24
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : 测试将生成的SCXML状态机代码与Qt应用程序集成的功能。
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
set -e
|
||||
|
||||
LOG_INFO "开始测试:测试将生成的SCXML状态机代码与Qt应用程序集成的功能。"
|
||||
|
||||
# 定义软件包名称
|
||||
PACKAGE_NAME="qt5-qtscxml-devel"
|
||||
|
||||
LOG_INFO "步骤1:检查软件包是否已安装。"
|
||||
if rpm -q $PACKAGE_NAME &> /dev/null; then
|
||||
LOG_INFO "$PACKAGE_NAME 已安装,脚本结束时将保持安装状态。"
|
||||
ALREADY_INSTALLED=true
|
||||
else
|
||||
LOG_INFO "$PACKAGE_NAME 未安装,将在测试步骤中安装。"
|
||||
ALREADY_INSTALLED=false
|
||||
fi
|
||||
|
||||
LOG_INFO "步骤2:检查yum源中是否存在软件包 $PACKAGE_NAME。"
|
||||
if ! dnf list available $PACKAGE_NAME &> /dev/null; then
|
||||
LOG_ERROR "yum源中未找到软件包 $PACKAGE_NAME。"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 如果未安装,则安装软件包
|
||||
if [ "$ALREADY_INSTALLED" = false ]; then
|
||||
LOG_INFO "步骤3:安装软件包 $PACKAGE_NAME。"
|
||||
dnf install -y $PACKAGE_NAME
|
||||
CHECK_RESULT $? 0 0 "安装 $PACKAGE_NAME 失败。"
|
||||
fi
|
||||
|
||||
LOG_INFO "步骤4:验证 scxmlc 命令是否可用。"
|
||||
if ! command -v scxmlc &> /dev/null; then
|
||||
LOG_ERROR "scxmlc 命令未找到,软件包可能未正确安装。"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
LOG_INFO "步骤5:创建一个简单的 SCXML 状态机文件用于测试。"
|
||||
TEST_SCXML_FILE="/tmp/test_state_machine.scxml"
|
||||
cat > $TEST_SCXML_FILE << "EOF"
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<scxml xmlns="http://www.w3.org/2005/07/scxml" version="1.0" initial="off">
|
||||
<state id="off">
|
||||
<transition event="switchOn" target="on"/>
|
||||
</state>
|
||||
<state id="on">
|
||||
<transition event="switchOff" target="off"/>
|
||||
</state>
|
||||
</scxml>
|
||||
EOF
|
||||
CHECK_RESULT $? 0 0 "创建测试 SCXML 文件失败。"
|
||||
|
||||
LOG_INFO "步骤6:使用 scxmlc 命令将 SCXML 文件转换为 C++ 代码。"
|
||||
TEST_OUTPUT_DIR="/tmp/scxml_output"
|
||||
mkdir -p $TEST_OUTPUT_DIR
|
||||
scxmlc --output $TEST_OUTPUT_DIR $TEST_SCXML_FILE
|
||||
CHECK_RESULT $? 0 0 "scxmlc 命令执行失败,无法生成状态机代码。"
|
||||
|
||||
LOG_INFO "步骤7:检查生成的 C++ 头文件和源文件。"
|
||||
GENERATED_HEADER="$TEST_OUTPUT_DIR/test_state_machine.h"
|
||||
GENERATED_SOURCE="$TEST_OUTPUT_DIR/test_state_machine.cpp"
|
||||
if [[ -f "$GENERATED_HEADER" && -f "$GENERATED_SOURCE" ]]; then
|
||||
LOG_INFO "成功生成状态机头文件和源文件。"
|
||||
else
|
||||
LOG_ERROR "状态机代码文件未生成。"
|
||||
CHECK_RESULT 1 0 0 "状态机代码文件生成失败。"
|
||||
fi
|
||||
|
||||
LOG_INFO "步骤8:创建一个简单的 Qt 测试程序来集成生成的代码。"
|
||||
TEST_QT_DIR="/tmp/test_qt_integration"
|
||||
mkdir -p $TEST_QT_DIR
|
||||
TEST_QT_PRO="$TEST_QT_DIR/test_integration.pro"
|
||||
TEST_QT_CPP="$TEST_QT_DIR/main.cpp"
|
||||
|
||||
cat > $TEST_QT_PRO << "EOF"
|
||||
QT += core scxml
|
||||
TEMPLATE = app
|
||||
TARGET = test_integration
|
||||
CONFIG += c++11
|
||||
SOURCES += main.cpp \
|
||||
../scxml_output/test_state_machine.cpp
|
||||
HEADERS += ../scxml_output/test_state_machine.h
|
||||
EOF
|
||||
|
||||
cat > $TEST_QT_CPP << "EOF"
|
||||
#include <QCoreApplication>
|
||||
#include <QScxmlStateMachine>
|
||||
#include "../scxml_output/test_state_machine.h"
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QCoreApplication app(argc, argv);
|
||||
TestStateMachine machine;
|
||||
if (!machine.parseErrors().isEmpty()) {
|
||||
qCritical() << "Failed to parse state machine.";
|
||||
return 1;
|
||||
}
|
||||
machine.start();
|
||||
return app.exec();
|
||||
}
|
||||
EOF
|
||||
CHECK_RESULT $? 0 0 "创建 Qt 测试项目文件失败。"
|
||||
|
||||
LOG_INFO "步骤9:尝试使用 qmake 生成 Makefile(仅验证环境,不实际编译)。"
|
||||
if command -v qmake-qt5 &> /dev/null; then
|
||||
QMAKE_CMD="qmake-qt5"
|
||||
elif command -v qmake &> /dev/null; then
|
||||
QMAKE_CMD="qmake"
|
||||
else
|
||||
LOG_ERROR "未找到 qmake 命令。"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
cd $TEST_QT_DIR
|
||||
$QMAKE_CMD $TEST_QT_PRO
|
||||
CHECK_RESULT $? 0 0 "qmake 生成 Makefile 失败。"
|
||||
|
||||
LOG_INFO "步骤10:清理测试生成的文件。"
|
||||
rm -rf $TEST_SCXML_FILE $TEST_OUTPUT_DIR $TEST_QT_DIR
|
||||
|
||||
# 如果脚本开始时未安装,则在测试结束后卸载软件包
|
||||
if [ "$ALREADY_INSTALLED" = false ]; then
|
||||
LOG_INFO "步骤11:卸载测试安装的软件包 $PACKAGE_NAME。"
|
||||
dnf remove -y $PACKAGE_NAME
|
||||
CHECK_RESULT $? 0 0 "卸载 $PACKAGE_NAME 失败。"
|
||||
LOG_INFO "已卸载软件包 $PACKAGE_NAME,环境已恢复。"
|
||||
else
|
||||
LOG_INFO "步骤11:软件包 $PACKAGE_NAME 在脚本执行前已安装,保持安装状态。"
|
||||
fi
|
||||
|
||||
LOG_INFO "测试完成:Qt SCXML 状态机代码集成功能测试通过。"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -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 : 2025-12-12
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : 测试软件包qt5-qtscxml-devel的XML解析功能,验证是否能正确解析SCXML文件。
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
LOG_INFO "开始测试qt5-qtscxml-devel的XML解析功能"
|
||||
|
||||
# 检查yum源中是否存在qt5-qtscxml-devel软件包
|
||||
LOG_INFO "检查yum源中是否存在qt5-qtscxml-devel软件包"
|
||||
dnf list available qt5-qtscxml-devel > /dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
LOG_ERROR "yum源中未找到qt5-qtscxml-devel软件包"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 检查是否已安装qt5-qtscxml-devel
|
||||
LOG_INFO "检查是否已安装qt5-qtscxml-devel"
|
||||
rpm -q qt5-qtscxml-devel > /dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
LOG_INFO "qt5-qtscxml-devel已安装,测试完成后保持安装状态"
|
||||
installed=true
|
||||
else
|
||||
LOG_INFO "qt5-qtscxml-devel未安装,将进行安装测试"
|
||||
installed=false
|
||||
fi
|
||||
|
||||
# 如果未安装,则进行安装
|
||||
if [ "$installed" = false ]; then
|
||||
LOG_INFO "安装qt5-qtscxml-devel"
|
||||
dnf install -y qt5-qtscxml-devel > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "安装qt5-qtscxml-devel失败"
|
||||
fi
|
||||
|
||||
# 测试XML解析功能
|
||||
LOG_INFO "测试qt5-qtscxml-devel的XML解析功能"
|
||||
cat > test.scxml << EOF
|
||||
<scxml xmlns="http://www.w3.org/2005/07/scxml" version="1.0">
|
||||
<state id="start">
|
||||
<transition event="test" target="end"/>
|
||||
</state>
|
||||
<state id="end"/>
|
||||
</scxml>
|
||||
EOF
|
||||
|
||||
# 使用qscxml工具解析SCXML文件
|
||||
qscxml test.scxml > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "解析SCXML文件失败"
|
||||
|
||||
# 清理临时文件
|
||||
LOG_INFO "清理临时文件"
|
||||
rm -f test.scxml
|
||||
|
||||
# 如果测试前未安装,则卸载软件包
|
||||
if [ "$installed" = false ]; then
|
||||
LOG_INFO "卸载qt5-qtscxml-devel"
|
||||
dnf remove -y qt5-qtscxml-devel > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "卸载qt5-qtscxml-devel失败"
|
||||
fi
|
||||
|
||||
LOG_INFO "测试完成"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -1,121 +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-03-24
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : 测试基于qt5-qtscxml-devel创建和运行状态机的基本功能。
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
LOG_INFO "开始测试qt5-qtscxml-devel状态机基本功能"
|
||||
LOG_INFO "检查yum源中是否存在qt5-qtscxml-devel软件包"
|
||||
dnf list available qt5-qtscxml-devel &> /dev/null
|
||||
if [ $? -ne 0 ]; then
|
||||
LOG_ERROR "yum源中未找到qt5-qtscxml-devel软件包"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
LOG_INFO "检查系统是否已安装qt5-qtscxml-devel"
|
||||
rpm -q qt5-qtscxml-devel &> /dev/null
|
||||
if [ $? -eq 0 ]; then
|
||||
LOG_INFO "qt5-qtscxml-devel已安装,标记为已存在"
|
||||
pkg_installed=1
|
||||
else
|
||||
LOG_INFO "qt5-qtscxml-devel未安装,标记为需要安装"
|
||||
pkg_installed=0
|
||||
fi
|
||||
|
||||
if [ $pkg_installed -eq 0 ]; then
|
||||
LOG_INFO "开始安装qt5-qtscxml-devel软件包"
|
||||
dnf install -y qt5-qtscxml-devel
|
||||
CHECK_RESULT $? 0 0 "安装qt5-qtscxml-devel失败"
|
||||
fi
|
||||
|
||||
LOG_INFO "创建测试状态机文件test.scxml"
|
||||
cat > test.scxml << "EOF"
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<scxml xmlns="http://www.w3.org/2005/07/scxml" version="1.0" initial="off">
|
||||
<state id="off">
|
||||
<transition event="switch.on" target="on"/>
|
||||
</state>
|
||||
<state id="on">
|
||||
<transition event="switch.off" target="off"/>
|
||||
</state>
|
||||
</scxml>
|
||||
EOF
|
||||
CHECK_RESULT $? 0 0 "创建test.scxml文件失败"
|
||||
|
||||
LOG_INFO "使用qscxmlc编译状态机文件"
|
||||
qscxmlc test.scxml -o test.h
|
||||
CHECK_RESULT $? 0 0 "qscxmlc编译状态机文件失败"
|
||||
|
||||
LOG_INFO "检查生成的test.h头文件"
|
||||
if [ -f "test.h" ]; then
|
||||
LOG_INFO "成功生成test.h头文件"
|
||||
else
|
||||
LOG_ERROR "未找到生成的test.h头文件"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
LOG_INFO "创建测试C++程序test_state_machine.cpp"
|
||||
cat > test_state_machine.cpp << "EOF"
|
||||
#include <QCoreApplication>
|
||||
#include <QScxmlStateMachine>
|
||||
#include "test.h"
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
QCoreApplication app(argc, argv);
|
||||
QScxmlStateMachine *machine = QScxmlStateMachine::fromFile("test.scxml");
|
||||
if (!machine) {
|
||||
return 1;
|
||||
}
|
||||
machine->start();
|
||||
QString initialState = machine->activeStateNames().value(0);
|
||||
if (initialState != "off") {
|
||||
return 1;
|
||||
}
|
||||
machine->submitEvent("switch.on");
|
||||
QString stateAfterEvent = machine->activeStateNames().value(0);
|
||||
if (stateAfterEvent != "on") {
|
||||
return 1;
|
||||
}
|
||||
delete machine;
|
||||
return 0;
|
||||
}
|
||||
EOF
|
||||
CHECK_RESULT $? 0 0 "创建test_state_machine.cpp文件失败"
|
||||
|
||||
LOG_INFO "编译测试程序"
|
||||
g++ -o test_state_machine test_state_machine.cpp -I/usr/include/qt5 -I/usr/include/qt5/QtCore -I/usr/include/qt5/QtScxml -fPIC -lQt5Core -lQt5Scxml
|
||||
CHECK_RESULT $? 0 0 "编译测试程序失败"
|
||||
|
||||
LOG_INFO "运行状态机测试程序"
|
||||
./test_state_machine
|
||||
CHECK_RESULT $? 0 0 "状态机测试程序运行失败"
|
||||
|
||||
LOG_INFO "清理临时文件"
|
||||
rm -f test.scxml test.h test_state_machine.cpp test_state_machine
|
||||
|
||||
if [ $pkg_installed -eq 0 ]; then
|
||||
LOG_INFO "卸载qt5-qtscxml-devel软件包"
|
||||
dnf remove -y qt5-qtscxml-devel
|
||||
CHECK_RESULT $? 0 0 "卸载qt5-qtscxml-devel失败"
|
||||
fi
|
||||
|
||||
LOG_INFO "测试完成"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -1,126 +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-03-24
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : 测试软件包qt5-qtscxml-devel对SCXML文件的语法和结构验证功能。
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
# 初始化变量
|
||||
PACKAGE_NAME="qt5-qtscxml-devel"
|
||||
TEST_FILE="test.scxml"
|
||||
EXPECTED_OUTPUT="valid"
|
||||
|
||||
# 清理函数
|
||||
cleanup() {
|
||||
LOG_INFO "开始清理测试环境"
|
||||
|
||||
# 删除测试文件
|
||||
if [ -f "$TEST_FILE" ]; then
|
||||
rm -f "$TEST_FILE"
|
||||
LOG_INFO "已删除测试文件 $TEST_FILE"
|
||||
fi
|
||||
|
||||
# 如果测试前未安装,则卸载软件包
|
||||
if [ "$PRE_INSTALLED" = "false" ]; then
|
||||
LOG_INFO "卸载测试安装的软件包"
|
||||
dnf remove -y $PACKAGE_NAME 2>/dev/null
|
||||
CHECK_RESULT $? 0 0 "卸载软件包失败"
|
||||
LOG_INFO "软件包已成功卸载"
|
||||
else
|
||||
LOG_INFO "保持软件包安装状态"
|
||||
fi
|
||||
|
||||
LOG_INFO "环境清理完成"
|
||||
}
|
||||
|
||||
# 错误处理
|
||||
trap cleanup EXIT INT TERM
|
||||
|
||||
# 检查软件包是否在yum源中
|
||||
LOG_INFO "检查软件包是否在yum源中"
|
||||
dnf list available $PACKAGE_NAME 2>/dev/null | grep -q $PACKAGE_NAME
|
||||
if [ $? -ne 0 ]; then
|
||||
LOG_ERROR "软件包 $PACKAGE_NAME 不在yum源中"
|
||||
exit 255
|
||||
fi
|
||||
LOG_INFO "软件包在yum源中可用"
|
||||
|
||||
# 检查软件包是否已安装
|
||||
LOG_INFO "检查软件包是否已安装"
|
||||
if rpm -q $PACKAGE_NAME >/dev/null 2>&1; then
|
||||
LOG_INFO "软件包已安装"
|
||||
PRE_INSTALLED="true"
|
||||
else
|
||||
LOG_INFO "软件包未安装,将在测试中安装"
|
||||
PRE_INSTALLED="false"
|
||||
fi
|
||||
|
||||
# 如果未安装,则安装软件包
|
||||
if [ "$PRE_INSTALLED" = "false" ]; then
|
||||
LOG_INFO "安装软件包 $PACKAGE_NAME"
|
||||
dnf install -y $PACKAGE_NAME
|
||||
CHECK_RESULT $? 0 0 "安装软件包失败"
|
||||
LOG_INFO "软件包安装成功"
|
||||
fi
|
||||
|
||||
# 创建测试SCXML文件
|
||||
LOG_INFO "创建测试SCXML文件"
|
||||
cat > $TEST_FILE << "EOF"
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<scxml xmlns="http://www.w3.org/2005/07/scxml" version="1.0" initial="start">
|
||||
<state id="start">
|
||||
<transition event="next" target="end"/>
|
||||
</state>
|
||||
<final id="end"/>
|
||||
</scxml>
|
||||
EOF
|
||||
CHECK_RESULT $? 0 0 "创建测试文件失败"
|
||||
|
||||
# 检查scxml验证工具是否存在
|
||||
LOG_INFO "检查scxml验证工具"
|
||||
which scxml 2>/dev/null
|
||||
if [ $? -ne 0 ]; then
|
||||
LOG_ERROR "scxml命令不存在或不支持"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 测试SCXML文件验证功能
|
||||
LOG_INFO "测试SCXML文件语法和结构验证"
|
||||
scxml --validate $TEST_FILE 2>&1 | grep -q "$EXPECTED_OUTPUT"
|
||||
CHECK_RESULT $? 0 0 "SCXML文件验证失败"
|
||||
|
||||
# 测试无效SCXML文件
|
||||
LOG_INFO "测试无效SCXML文件验证"
|
||||
cat > invalid_test.scxml << "EOF"
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<scxml xmlns="http://www.w3.org/2005/07/scxml" version="1.0">
|
||||
<invalid_element/>
|
||||
</scxml>
|
||||
EOF
|
||||
|
||||
scxml --validate invalid_test.scxml 2>&1 | grep -q "error\|invalid"
|
||||
CHECK_RESULT $? 0 0 "无效文件验证未检测到错误"
|
||||
|
||||
# 清理临时文件
|
||||
rm -f invalid_test.scxml
|
||||
LOG_INFO "临时文件已清理"
|
||||
|
||||
LOG_INFO "qt5-qtscxml-devel软件包的SCXML文件语法和结构验证功能测试完成"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -1,64 +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 : 2025-10-01
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : Test package installation
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
# 检查texlive-mathpartir软件包是否已安装
|
||||
LOG_INFO "检查texlive-mathpartir软件包是否已安装"
|
||||
rpm -q texlive-mathpartir
|
||||
if [ $? -eq 0 ]; then
|
||||
LOG_INFO "texlive-mathpartir软件包已安装,脚本将保持安装状态"
|
||||
installed=true
|
||||
else
|
||||
LOG_INFO "texlive-mathpartir软件包未安装,将进行安装测试"
|
||||
installed=false
|
||||
fi
|
||||
|
||||
# 检查yum源中是否存在texlive-mathpartir软件包
|
||||
LOG_INFO "检查yum源中是否存在texlive-mathpartir软件包"
|
||||
dnf list available texlive-mathpartir > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 255 "yum源中不存在texlive-mathpartir软件包"
|
||||
|
||||
# 安装texlive-mathpartir软件包
|
||||
LOG_INFO "安装texlive-mathpartir软件包"
|
||||
dnf install -y texlive-mathpartir
|
||||
CHECK_RESULT $? 0 0 "安装texlive-mathpartir软件包失败"
|
||||
|
||||
# 验证texlive-mathpartir软件包是否成功安装
|
||||
LOG_INFO "验证texlive-mathpartir软件包是否成功安装"
|
||||
rpm -q texlive-mathpartir
|
||||
CHECK_RESULT $? 0 0 "texlive-mathpartir软件包未正确安装"
|
||||
|
||||
# 如果脚本开始时未安装,则在结束时卸载
|
||||
if [ "$installed" = false ]; then
|
||||
LOG_INFO "卸载texlive-mathpartir软件包"
|
||||
dnf remove -y texlive-mathpartir
|
||||
CHECK_RESULT $? 0 0 "卸载texlive-mathpartir软件包失败"
|
||||
|
||||
# 验证texlive-mathpartir软件包是否已卸载
|
||||
LOG_INFO "验证texlive-mathpartir软件包是否已卸载"
|
||||
rpm -q texlive-mathpartir > /dev/null 2>&1
|
||||
CHECK_RESULT $? 1 0 "texlive-mathpartir软件包未正确卸载"
|
||||
fi
|
||||
|
||||
LOG_INFO "测试脚本执行完成"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -1,63 +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 : 2025-10-01
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : Test basic usage
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
|
||||
# 检查是否已安装texlive-mathpartir软件包
|
||||
LOG_INFO "检查是否已安装texlive-mathpartir软件包"
|
||||
rpm -q texlive-mathpartir
|
||||
if [ $? -eq 0 ]; then
|
||||
LOG_INFO "texlive-mathpartir已安装,脚本结束后将保持安装状态"
|
||||
INSTALLED=1
|
||||
else
|
||||
LOG_INFO "texlive-mathpartir未安装,将在测试完成后卸载"
|
||||
INSTALLED=0
|
||||
fi
|
||||
|
||||
# 检查yum源中是否有texlive-mathpartir软件包
|
||||
LOG_INFO "检查yum源中是否有texlive-mathpartir软件包"
|
||||
dnf list available texlive-mathpartir > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 255 "yum源中未找到texlive-mathpartir软件包"
|
||||
|
||||
# 安装texlive-mathpartir软件包
|
||||
if [ $INSTALLED -eq 0 ]; then
|
||||
LOG_INFO "开始安装texlive-mathpartir软件包"
|
||||
dnf install -y texlive-mathpartir > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "安装texlive-mathpartir软件包失败"
|
||||
fi
|
||||
|
||||
# 测试基本功能使用
|
||||
LOG_INFO "测试基本功能使用"
|
||||
texdoc mathpar > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 255 "texdoc mathpar命令执行失败"
|
||||
|
||||
# 清理环境:如果脚本开始时未安装,则卸载软件包
|
||||
if [ $INSTALLED -eq 0 ]; then
|
||||
LOG_INFO "卸载texlive-mathpartir软件包"
|
||||
dnf remove -y texlive-mathpartir > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "卸载texlive-mathpartir软件包失败"
|
||||
fi
|
||||
|
||||
LOG_INFO "测试完成,环境已恢复"
|
||||
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -1,88 +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-03-24
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : Test the letter-spacing feature of the soul package
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
# 检查是否已安装texlive-soul包
|
||||
LOG_INFO "检查是否已安装texlive-soul包"
|
||||
rpm -q texlive-soul > /dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
LOG_INFO "texlive-soul已安装,记录安装状态"
|
||||
INSTALLED=true
|
||||
else
|
||||
LOG_INFO "texlive-soul未安装"
|
||||
INSTALLED=false
|
||||
fi
|
||||
|
||||
# 检查yum源中是否有texlive-soul包
|
||||
LOG_INFO "检查yum源中是否有texlive-soul包"
|
||||
dnf list available texlive-soul > /dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
LOG_ERROR "yum源中无texlive-soul包"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 如果未安装,则安装texlive-soul包
|
||||
if [ "$INSTALLED" = "false" ]; then
|
||||
LOG_INFO "安装texlive-soul包"
|
||||
dnf install -y texlive-soul
|
||||
CHECK_RESULT $? 0 0 "安装texlive-soul包失败"
|
||||
fi
|
||||
|
||||
# 创建测试LaTeX文档
|
||||
LOG_INFO "创建测试LaTeX文档"
|
||||
cat > test_letter_spacing.tex << "EOF"
|
||||
\documentclass{article}
|
||||
\usepackage{soul}
|
||||
\begin{document}
|
||||
Test \so{letter-spacing} feature.
|
||||
\end{document}
|
||||
EOF
|
||||
CHECK_RESULT $? 0 0 "创建测试LaTeX文档失败"
|
||||
|
||||
# 编译LaTeX文档测试letter-spacing功能
|
||||
LOG_INFO "编译LaTeX文档测试letter-spacing功能"
|
||||
pdflatex -interaction=nonstopmode test_letter_spacing.tex > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "编译LaTeX文档失败"
|
||||
|
||||
# 检查是否生成PDF文件
|
||||
LOG_INFO "检查是否生成PDF文件"
|
||||
if [ -f test_letter_spacing.pdf ]; then
|
||||
LOG_INFO "成功生成PDF文件,letter-spacing功能正常"
|
||||
else
|
||||
LOG_ERROR "未生成PDF文件,letter-spacing功能异常"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# 清理测试文件
|
||||
LOG_INFO "清理测试文件"
|
||||
rm -f test_letter_spacing.tex test_letter_spacing.pdf test_letter_spacing.log test_letter_spacing.aux
|
||||
|
||||
# 如果测试前未安装,则卸载texlive-soul包
|
||||
if [ "$INSTALLED" = "false" ]; then
|
||||
LOG_INFO "卸载texlive-soul包"
|
||||
dnf remove -y texlive-soul
|
||||
CHECK_RESULT $? 0 0 "卸载texlive-soul包失败"
|
||||
fi
|
||||
|
||||
LOG_INFO "测试完成"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -1,70 +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 : 2025-11-26
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : Test the spacing adjustment feature of the soul package
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
# 检查是否已安装texlive-soul包
|
||||
LOG_INFO "检查是否已安装texlive-soul包"
|
||||
if dnf list installed texlive-soul &>/dev/null; then
|
||||
LOG_INFO "texlive-soul已安装,脚本结束后保持安装状态"
|
||||
INSTALLED=true
|
||||
else
|
||||
LOG_INFO "texlive-soul未安装,将在测试后卸载"
|
||||
INSTALLED=false
|
||||
fi
|
||||
|
||||
# 检查yum源中是否有texlive-soul包
|
||||
LOG_INFO "检查yum源中是否有texlive-soul包"
|
||||
if ! dnf list available texlive-soul &>/dev/null; then
|
||||
LOG_ERROR "yum源中未找到texlive-soup包"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 安装texlive-soul包
|
||||
if [ "$INSTALLED" = false ]; then
|
||||
LOG_INFO "正在安装texlive-soul包"
|
||||
dnf install -y texlive-soul
|
||||
CHECK_RESULT $? 0 0 "安装texlive-soul失败"
|
||||
fi
|
||||
|
||||
# 测试spacing调整功能
|
||||
LOG_INFO "测试spacing调整功能"
|
||||
echo "\documentclass{article}
|
||||
\usepackage{soul}
|
||||
\begin{document}
|
||||
\so{This is a test}
|
||||
\end{document}" > test.tex
|
||||
|
||||
pdflatex test.tex &>/dev/null
|
||||
CHECK_RESULT $? 0 0 "生成PDF失败"
|
||||
|
||||
# 清理临时文件
|
||||
LOG_INFO "清理临时文件"
|
||||
rm -f test.aux test.log test.pdf test.tex
|
||||
|
||||
# 卸载texlive-soul包(如果之前未安装)
|
||||
if [ "$INSTALLED" = false ]; then
|
||||
LOG_INFO "卸载texlive-soul包"
|
||||
dnf remove -y texlive-soul
|
||||
CHECK_RESULT $? 0 0 "卸载texlive-soul失败"
|
||||
fi
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -1,73 +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-03-24
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : Test the text strikeout feature of the soul package
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
LOG_INFO "开始测试soul包的文本删除线功能"
|
||||
LOG_INFO "检查texlive-soul软件包是否已在环境中安装"
|
||||
if dnf list installed texlive-soul &> /dev/null; then
|
||||
LOG_INFO "texlive-soul软件包已安装,测试结束后将保持安装状态"
|
||||
INSTALLED=true
|
||||
else
|
||||
LOG_INFO "texlive-soul软件包未安装,将在测试过程中安装,并在测试结束后卸载"
|
||||
INSTALLED=false
|
||||
fi
|
||||
LOG_INFO "检查yum源中是否存在texlive-soul软件包"
|
||||
if ! dnf list available texlive-soul &> /dev/null; then
|
||||
LOG_ERROR "yum源中未找到texlive-soul软件包"
|
||||
exit 255
|
||||
fi
|
||||
if [ "$INSTALLED" = "false" ]; then
|
||||
LOG_INFO "安装texlive-soul软件包"
|
||||
dnf install -y texlive-soul
|
||||
CHECK_RESULT $? 0 0 "安装texlive-soul软件包失败"
|
||||
fi
|
||||
LOG_INFO "创建测试LaTeX文档以验证删除线功能"
|
||||
cat > test_strikeout.tex << "EOF"
|
||||
\documentclass{article}
|
||||
\usepackage{soul}
|
||||
\begin{document}
|
||||
This is normal text.
|
||||
\st{This text has a strikeout.}
|
||||
\end{document}
|
||||
EOF
|
||||
CHECK_RESULT $? 0 0 "创建测试LaTeX文档失败"
|
||||
LOG_INFO "使用pdflatex编译LaTeX文档"
|
||||
pdflatex -interaction=nonstopmode test_strikeout.tex
|
||||
CHECK_RESULT $? 0 0 "编译LaTeX文档失败"
|
||||
LOG_INFO "检查生成的PDF文件是否存在"
|
||||
if [ -f test_strikeout.pdf ]; then
|
||||
LOG_INFO "PDF文件生成成功,删除线功能测试通过"
|
||||
else
|
||||
LOG_ERROR "PDF文件生成失败,删除线功能测试未通过"
|
||||
exit 1
|
||||
fi
|
||||
LOG_INFO "清理测试生成的临时文件"
|
||||
rm -f test_strikeout.aux test_strikeout.log test_strikeout.tex test_strikeout.pdf
|
||||
CHECK_RESULT $? 0 0 "清理临时文件失败"
|
||||
if [ "$INSTALLED" = "false" ]; then
|
||||
LOG_INFO "卸载在测试中安装的texlive-soul软件包"
|
||||
dnf remove -y texlive-soul
|
||||
CHECK_RESULT $? 0 0 "卸载texlive-soul软件包失败"
|
||||
fi
|
||||
LOG_INFO "测试完成,环境已恢复"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -1,86 +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-03-24
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : Test the text underlining feature of the soul package
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
LOG_INFO "开始测试:Test the text underlining feature of the soul package"
|
||||
|
||||
LOG_INFO "1. 检查环境是否已安装texlive-soul软件包"
|
||||
if dnf list installed texlive-soul &>/dev/null; then
|
||||
LOG_INFO "检测到texlive-soul已安装,保持安装状态"
|
||||
INSTALLED=true
|
||||
else
|
||||
LOG_INFO "未检测到texlive-soul安装,将在测试过程中安装"
|
||||
INSTALLED=false
|
||||
fi
|
||||
|
||||
LOG_INFO "2. 检查yum源中是否存在texlive-soul软件包"
|
||||
if ! dnf list available texlive-soul &>/dev/null; then
|
||||
LOG_ERROR "yum源中未找到texlive-soul软件包"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
if [ "$INSTALLED" = false ]; then
|
||||
LOG_INFO "3. 安装texlive-soul软件包"
|
||||
dnf install -y texlive-soul
|
||||
CHECK_RESULT $? 0 0 "安装texlive-soul失败"
|
||||
fi
|
||||
|
||||
LOG_INFO "4. 检查soul包是否提供了underline命令"
|
||||
if ! texdoc soul 2>/dev/null | grep -q "\\underline"; then
|
||||
LOG_ERROR "soul包不支持underline参数或命令"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
LOG_INFO "5. 创建一个简单的LaTeX测试文档"
|
||||
cat > test_underline.tex << "EOF"
|
||||
\documentclass{article}
|
||||
\usepackage{soul}
|
||||
\begin{document}
|
||||
Test \ul{underlined text} here.
|
||||
\end{document}
|
||||
EOF
|
||||
CHECK_RESULT $? 0 0 "创建测试文档失败"
|
||||
|
||||
LOG_INFO "6. 使用pdflatex编译文档测试下划线功能"
|
||||
pdflatex -interaction=nonstopmode test_underline.tex >/dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "编译LaTeX文档失败"
|
||||
|
||||
LOG_INFO "7. 检查生成的PDF文件是否存在"
|
||||
if [ -f test_underline.pdf ]; then
|
||||
LOG_INFO "PDF文件生成成功,基本功能正常"
|
||||
else
|
||||
LOG_ERROR "PDF文件未生成,下划线功能可能异常"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
LOG_INFO "8. 清理测试生成的文件"
|
||||
rm -f test_underline.tex test_underline.log test_underline.aux test_underline.pdf
|
||||
|
||||
if [ "$INSTALLED" = false ]; then
|
||||
LOG_INFO "9. 卸载测试安装的texlive-soul软件包"
|
||||
dnf remove -y texlive-soul
|
||||
CHECK_RESULT $? 0 0 "卸载texlive-soul失败"
|
||||
fi
|
||||
|
||||
LOG_INFO "测试完成:成功验证了soul包的下划线功能"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -1,140 +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-03-24
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : Test the word-spacing feature of the soul package
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
# 定义日志函数(根据要求直接使用,但为了脚本完整定义)
|
||||
LOG_INFO() {
|
||||
echo "[INFO] $*"
|
||||
}
|
||||
|
||||
LOG_ERROR() {
|
||||
echo "[ERROR] $*"
|
||||
}
|
||||
|
||||
# 定义检查结果函数(根据要求直接使用,但为了脚本完整定义)
|
||||
CHECK_RESULT() {
|
||||
local actual=$1
|
||||
local expect=$2
|
||||
local mode=$3
|
||||
local message=$4
|
||||
|
||||
if [ $mode -eq 0 ]; then
|
||||
if [ $actual -eq $expect ]; then
|
||||
LOG_INFO "$message 成功"
|
||||
return 0
|
||||
else
|
||||
LOG_ERROR "$message 失败"
|
||||
exit $actual
|
||||
fi
|
||||
else
|
||||
if [ $actual -ne $expect ]; then
|
||||
LOG_INFO "$message 成功"
|
||||
return 0
|
||||
else
|
||||
LOG_ERROR "$message 失败"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
# 定义SSH_CMD函数(根据要求直接使用,但为了脚本完整定义)
|
||||
SSH_CMD() {
|
||||
local cmd=$1
|
||||
local node_ip=$2
|
||||
local node_password=$3
|
||||
local node_user=$4
|
||||
|
||||
sshpass -p "$node_password" ssh -o StrictHostKeyChecking=no "$node_user@$node_ip" "$cmd"
|
||||
}
|
||||
|
||||
# 软件包名称
|
||||
PACKAGE_NAME="texlive-soul"
|
||||
|
||||
# 检查环境是否已安装
|
||||
LOG_INFO "步骤1:检查 $PACKAGE_NAME 是否已安装"
|
||||
if dnf list installed "$PACKAGE_NAME" &>/dev/null; then
|
||||
LOG_INFO "$PACKAGE_NAME 已安装,测试结束后将保持安装状态"
|
||||
ALREADY_INSTALLED=1
|
||||
else
|
||||
LOG_INFO "$PACKAGE_NAME 未安装,将在测试结束后卸载"
|
||||
ALREADY_INSTALLED=0
|
||||
fi
|
||||
|
||||
# 检查yum源中是否有该软件包
|
||||
LOG_INFO "步骤2:检查yum源中是否有 $PACKAGE_NAME 软件包"
|
||||
if ! dnf list available "$PACKAGE_NAME" &>/dev/null; then
|
||||
LOG_ERROR "yum源中未找到 $PACKAGE_NAME 软件包"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 如果未安装,则安装软件包
|
||||
if [ $ALREADY_INSTALLED -eq 0 ]; then
|
||||
LOG_INFO "步骤3:安装 $PACKAGE_NAME 软件包"
|
||||
dnf install -y "$PACKAGE_NAME"
|
||||
CHECK_RESULT $? 0 0 "安装 $PACKAGE_NAME"
|
||||
fi
|
||||
|
||||
# 测试word-spacing功能
|
||||
LOG_INFO "步骤4:测试soul包的word-spacing功能"
|
||||
|
||||
# 创建测试LaTeX文件
|
||||
TEST_FILE="test_word_spacing.tex"
|
||||
cat > "$TEST_FILE" << "EOF"
|
||||
\documentclass{article}
|
||||
\usepackage{soul}
|
||||
\begin{document}
|
||||
\so{This is a test of word spacing.}
|
||||
\end{document}
|
||||
EOF
|
||||
|
||||
# 检查是否创建成功
|
||||
CHECK_RESULT $? 0 0 "创建测试LaTeX文件"
|
||||
|
||||
# 编译LaTeX文件测试soul包功能
|
||||
LOG_INFO "步骤5:编译LaTeX文件验证word-spacing功能"
|
||||
pdflatex -interaction=nonstopmode "$TEST_FILE" &>/dev/null
|
||||
CHECK_RESULT $? 0 0 "编译LaTeX文件测试word-spacing功能"
|
||||
|
||||
# 检查生成的PDF文件
|
||||
if [ -f "test_word_spacing.pdf" ]; then
|
||||
LOG_INFO "步骤6:验证PDF文件生成成功"
|
||||
LOG_INFO "word-spacing功能测试通过"
|
||||
else
|
||||
LOG_ERROR "PDF文件未生成,word-spacing功能测试失败"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# 清理测试文件
|
||||
LOG_INFO "步骤7:清理测试文件"
|
||||
rm -f test_word_spacing.*
|
||||
CHECK_RESULT $? 0 0 "清理测试文件"
|
||||
|
||||
# 如果测试前未安装,则卸载软件包
|
||||
if [ $ALREADY_INSTALLED -eq 0 ]; then
|
||||
LOG_INFO "步骤8:卸载 $PACKAGE_NAME 软件包"
|
||||
dnf remove -y "$PACKAGE_NAME"
|
||||
CHECK_RESULT $? 0 0 "卸载 $PACKAGE_NAME"
|
||||
fi
|
||||
|
||||
LOG_INFO "测试完成:成功测试了soul包的word-spacing功能"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -1,69 +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 : 2025-11-26
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : Test installation of texlive-withargs-doc
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
|
||||
# 检查是否已安装texlive-withargs-doc
|
||||
LOG_INFO "检查是否已安装texlive-withargs-doc"
|
||||
if dnf list installed texlive-withargs-doc &> /dev/null; then
|
||||
LOG_INFO "texlive-withargs-doc已安装,脚本结束后将保持安装状态"
|
||||
installed=true
|
||||
else
|
||||
LOG_INFO "texlive-withargs-doc未安装,将在测试后卸载"
|
||||
installed=false
|
||||
fi
|
||||
|
||||
# 检查yum源中是否存在texlive-withargs-doc软件包
|
||||
LOG_INFO "检查yum源中是否存在texlive-withargs-doc软件包"
|
||||
if ! dnf list available texlive-withargs-doc &> /dev/null; then
|
||||
LOG_ERROR "yum源中不存在texlive-withargs-doc软件包"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 安装texlive-withargs-doc软件包
|
||||
LOG_INFO "开始安装texlive-withargs-doc软件包"
|
||||
dnf install -y texlive-withargs-doc
|
||||
CHECK_RESULT $? 0 0 "安装texlive-withargs-doc失败"
|
||||
|
||||
# 检查命令参数是否支持
|
||||
LOG_INFO "检查命令参数是否支持"
|
||||
if ! texlive-withargs-doc --help | grep -q "expected-arg"; then
|
||||
LOG_ERROR "texlive-withargs-doc不支持指定参数"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 执行测试命令
|
||||
LOG_INFO "执行测试命令"
|
||||
texlive-withargs-doc expected-arg
|
||||
CHECK_RESULT $? 0 0 "执行测试命令失败"
|
||||
|
||||
# 清理环境
|
||||
if [ "$installed" = false ]; then
|
||||
LOG_INFO "卸载texlive-withargs-doc软件包"
|
||||
dnf remove -y texlive-withargs-doc
|
||||
CHECK_RESULT $? 0 0 "卸载texlive-withargs-doc失败"
|
||||
fi
|
||||
|
||||
LOG_INFO "测试完成,环境已恢复"
|
||||
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -1,68 +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-01
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : 测试软件包提供的帮助信息是否正确。
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
LOG_INFO "开始测试:测试软件包提供的帮助信息是否正确"
|
||||
LOG_INFO "步骤1:检查环境是否已安装tpm2-abrmd软件包"
|
||||
rpm -q tpm2-abrmd > /dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
LOG_INFO "tpm2-abrmd软件包已安装,测试完成后将保持安装状态"
|
||||
INSTALLED=true
|
||||
else
|
||||
LOG_INFO "tpm2-abrmd软件包未安装,将在测试前安装,测试后卸载"
|
||||
INSTALLED=false
|
||||
fi
|
||||
|
||||
LOG_INFO "步骤2:检查yum源中是否存在tpm2-abrmd软件包"
|
||||
dnf list available tpm2-abrmd > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 255 "yum源中未找到tpm2-abrmd软件包,退出测试"
|
||||
|
||||
if [ "$INSTALLED" = false ]; then
|
||||
LOG_INFO "步骤3:安装tpm2-abrmd软件包"
|
||||
dnf install -y tpm2-abrmd > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "安装tpm2-abrmd软件包失败"
|
||||
fi
|
||||
|
||||
LOG_INFO "步骤4:检查tpm2-abrmd命令是否存在"
|
||||
which tpm2-abrmd > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 255 "tpm2-abrmd命令未找到,退出测试"
|
||||
|
||||
LOG_INFO "步骤5:测试tpm2-abrmd的--help参数"
|
||||
tpm2-abrmd --help > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "tpm2-abrmd --help命令执行失败"
|
||||
|
||||
LOG_INFO "步骤6:测试tpm2-abrmd的-h参数"
|
||||
tpm2-abrmd -h > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 255 "tpm2-abrmd -h参数不支持,退出测试"
|
||||
|
||||
LOG_INFO "步骤7:清理测试环境"
|
||||
if [ "$INSTALLED" = false ]; then
|
||||
LOG_INFO "卸载tpm2-abrmd软件包"
|
||||
dnf remove -y tpm2-abrmd > /dev/null 2>&1
|
||||
CHECK_RESULT $? 0 0 "卸载tpm2-abrmd软件包失败"
|
||||
else
|
||||
LOG_INFO "测试前已安装tpm2-abrmd软件包,测试后保持安装状态"
|
||||
fi
|
||||
|
||||
LOG_INFO "测试完成:软件包提供的帮助信息测试通过"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -1,79 +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-01
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : 测试查询软件包的版本信息。
|
||||
# ############################################
|
||||
|
||||
source "$OET_PATH/libs/locallibs/common_lib.sh"
|
||||
|
||||
function run_test() {
|
||||
set -e
|
||||
|
||||
LOG_INFO "开始测试:查询软件包的版本信息"
|
||||
|
||||
# 检查软件包是否已在yum源中
|
||||
LOG_INFO "检查yum源中是否存在tpm2-abrmd软件包"
|
||||
if ! dnf list available tpm2-abrmd 2>/dev/null | grep -q tpm2-abrmd; then
|
||||
LOG_ERROR "yum源中未找到tpm2-abrmd软件包"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 判断当前是否已安装软件包
|
||||
LOG_INFO "检查tpm2-abrmd是否已安装"
|
||||
if rpm -q tpm2-abrmd >/dev/null 2>&1; then
|
||||
LOG_INFO "tpm2-abrmd已安装,标记为无需清理"
|
||||
NEED_CLEANUP=0
|
||||
else
|
||||
LOG_INFO "tpm2-abrmd未安装,标记为需要清理"
|
||||
NEED_CLEANUP=1
|
||||
fi
|
||||
|
||||
# 如果未安装,则安装软件包
|
||||
if [ $NEED_CLEANUP -eq 1 ]; then
|
||||
LOG_INFO "安装tpm2-abrmd软件包"
|
||||
dnf install -y tpm2-abrmd
|
||||
CHECK_RESULT $? 0 0 "安装tpm2-abrmd失败"
|
||||
fi
|
||||
|
||||
# 测试查询软件包版本信息
|
||||
LOG_INFO "测试查询tpm2-abrmd的版本信息"
|
||||
tpm2-abrmd --version
|
||||
CHECK_RESULT $? 0 0 "查询tpm2-abrmd版本信息失败"
|
||||
|
||||
# 测试查询帮助信息
|
||||
LOG_INFO "测试查询tpm2-abrmd的帮助信息"
|
||||
tpm2-abrmd --help
|
||||
CHECK_RESULT $? 0 0 "查询tpm2-abrmd帮助信息失败"
|
||||
|
||||
# 测试不支持的参数
|
||||
LOG_INFO "测试不支持的参数"
|
||||
tpm2-abrmd --invalid-param 2>/dev/null
|
||||
if [ $? -ne 255 ] && [ $? -ne 0 ]; then
|
||||
LOG_ERROR "不支持的参数未按预期处理"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
# 清理环境
|
||||
if [ $NEED_CLEANUP -eq 1 ]; then
|
||||
LOG_INFO "卸载tpm2-abrmd软件包"
|
||||
dnf remove -y tpm2-abrmd
|
||||
CHECK_RESULT $? 0 0 "卸载tpm2-abrmd失败"
|
||||
fi
|
||||
|
||||
LOG_INFO "测试完成:查询软件包的版本信息"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
Reference in New Issue
Block a user