From f84f2ab34bb4dc66518e44cf9df1ae3fb0024f5c Mon Sep 17 00:00:00 2001 From: honghua Date: Thu, 16 Apr 2026 08:44:34 +0800 Subject: [PATCH 1/7] update testcase for testsuite artemis-journal --- .../pkg_test/artemis/artemis-journal.json | 20 --- .../test_artemis-journal_function_config.sh | 71 ----------- .../test_artemis-journal_function_help.sh | 79 ------------ .../test_artemis-journal_function_install.sh | 102 ---------------- ...test_artemis-journal_function_uninstall.sh | 84 ------------- .../test_artemis-journal_function_version.sh | 115 ------------------ 6 files changed, 471 deletions(-) delete mode 100644 testcases/function_test/pkg_test/artemis/artemis-journal/test_artemis-journal_function_config.sh delete mode 100644 testcases/function_test/pkg_test/artemis/artemis-journal/test_artemis-journal_function_help.sh delete mode 100644 testcases/function_test/pkg_test/artemis/artemis-journal/test_artemis-journal_function_install.sh delete mode 100644 testcases/function_test/pkg_test/artemis/artemis-journal/test_artemis-journal_function_uninstall.sh delete mode 100644 testcases/function_test/pkg_test/artemis/artemis-journal/test_artemis-journal_function_version.sh diff --git a/suite2cases/function_test/pkg_test/artemis/artemis-journal.json b/suite2cases/function_test/pkg_test/artemis/artemis-journal.json index 28ebe7defa2..76a3ec3d224 100644 --- a/suite2cases/function_test/pkg_test/artemis/artemis-journal.json +++ b/suite2cases/function_test/pkg_test/artemis/artemis-journal.json @@ -9,26 +9,6 @@ { "name": "test_artemis-journal_function_logging", "desc": "Test logging functionality of artemis-journal" - }, - { - "name": "test_artemis-journal_function_install", - "desc": "Test installation of artemis-journal package" - }, - { - "name": "test_artemis-journal_function_uninstall", - "desc": "Test uninstallation of artemis-journal package" - }, - { - "name": "test_artemis-journal_function_version", - "desc": "Test checking version of artemis-journal" - }, - { - "name": "test_artemis-journal_function_help", - "desc": "Test help/usage information of artemis-journal" - }, - { - "name": "test_artemis-journal_function_config", - "desc": "Test basic configuration of artemis-journal" } ] } \ No newline at end of file diff --git a/testcases/function_test/pkg_test/artemis/artemis-journal/test_artemis-journal_function_config.sh b/testcases/function_test/pkg_test/artemis/artemis-journal/test_artemis-journal_function_config.sh deleted file mode 100644 index ad7bdf54129..00000000000 --- a/testcases/function_test/pkg_test/artemis/artemis-journal/test_artemis-journal_function_config.sh +++ /dev/null @@ -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 : 2026-03-09 -# @License : Mulan PSL v2 -# @Desc : Test basic configuration of artemis-journal -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - PACKAGE_NAME="artemis-journal" - LOG_INFO "开始测试 artemis-journal 基础配置功能" - LOG_INFO "步骤1: 检查系统中是否已安装 $PACKAGE_NAME" - if dnf list installed "$PACKAGE_NAME" &>/dev/null; then - LOG_INFO "$PACKAGE_NAME 已安装,测试后将保持安装状态" - INSTALLED_BEFORE_TEST=true - else - LOG_INFO "$PACKAGE_NAME 未安装,将在测试中安装并在结束后卸载" - INSTALLED_BEFORE_TEST=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 [ "$INSTALLED_BEFORE_TEST" = false ]; then - LOG_INFO "步骤3: 安装 $PACKAGE_NAME 软件包" - dnf install -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "安装 $PACKAGE_NAME 失败" - fi - LOG_INFO "步骤4: 检查 artemis-journal 命令是否存在" - if ! command -v artemis-journal &>/dev/null; then - LOG_ERROR "artemis-journal 命令不存在" - exit 255 - fi - LOG_INFO "步骤5: 测试 artemis-journal --help 参数" - artemis-journal --help &>/dev/null - CHECK_RESULT $? 0 0 "artemis-journal --help 命令执行失败" - LOG_INFO "步骤6: 测试 artemis-journal --version 参数" - artemis-journal --version &>/dev/null - CHECK_RESULT $? 0 0 "artemis-journal --version 命令执行失败" - LOG_INFO "步骤7: 测试 artemis-journal 不支持参数 --invalid-param" - artemis-journal --invalid-param 2>&1 | grep -q "unrecognized option\|invalid option\|Unknown option" - CHECK_RESULT $? 0 0 "artemis-journal 未正确识别无效参数" - LOG_INFO "步骤8: 测试 artemis-journal 基础配置功能" - artemis-journal config --show-default - CHECK_RESULT $? 0 0 "artemis-journal config --show-default 命令执行失败" - LOG_INFO "步骤9: 清理测试环境" - if [ "$INSTALLED_BEFORE_TEST" = false ]; then - LOG_INFO "卸载 $PACKAGE_NAME 软件包" - dnf remove -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "卸载 $PACKAGE_NAME 失败" - else - LOG_INFO "测试前已安装 $PACKAGE_NAME,保持安装状态" - fi - LOG_INFO "artemis-journal 基础配置功能测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/artemis/artemis-journal/test_artemis-journal_function_help.sh b/testcases/function_test/pkg_test/artemis/artemis-journal/test_artemis-journal_function_help.sh deleted file mode 100644 index cdd09500d65..00000000000 --- a/testcases/function_test/pkg_test/artemis/artemis-journal/test_artemis-journal_function_help.sh +++ /dev/null @@ -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-03-09 -# @License : Mulan PSL v2 -# @Desc : Test help/usage information of artemis-journal -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试artemis-journal的帮助/使用信息功能" - - # 定义软件包名称 - PACKAGE_NAME="artemis-journal" - - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否有$PACKAGE_NAME软件包" - if ! dnf list available "$PACKAGE_NAME" &>/dev/null; then - LOG_ERROR "yum源中没有找到$PACKAGE_NAME软件包" - exit 255 - fi - - # 检查是否已经安装 - LOG_INFO "检查系统是否已安装$PACKAGE_NAME软件包" - if rpm -q "$PACKAGE_NAME" &>/dev/null; then - LOG_INFO "$PACKAGE_NAME已安装,测试结束后将保持安装状态" - INSTALLED_BEFORE_TEST=true - else - LOG_INFO "$PACKAGE_NAME未安装,将在测试过程中安装" - INSTALLED_BEFORE_TEST=false - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED_BEFORE_TEST" = false ]; then - LOG_INFO "安装$PACKAGE_NAME软件包" - dnf install -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "安装$PACKAGE_NAME失败" - fi - - # 测试帮助信息 - LOG_INFO "测试artemis-journal --help命令" - artemis-journal --help &>/dev/null - CHECK_RESULT $? 0 0 "artemis-journal --help命令执行失败" - - # 测试usage信息 - LOG_INFO "测试artemis-journal -h命令" - artemis-journal -h &>/dev/null - CHECK_RESULT $? 0 0 "artemis-journal -h命令执行失败" - - # 测试无效参数 - LOG_INFO "测试无效参数--invalid-param" - artemis-journal --invalid-param 2>&1 | grep -q "unrecognized option" - CHECK_RESULT $? 0 0 "无效参数检查失败,可能参数被支持" - - # 清理环境:如果测试前未安装,则卸载软件包 - if [ "$INSTALLED_BEFORE_TEST" = false ]; then - LOG_INFO "卸载$PACKAGE_NAME软件包" - dnf remove -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "卸载$PACKAGE_NAME失败" - else - LOG_INFO "测试前已安装$PACKAGE_NAME,保持安装状态" - fi - - LOG_INFO "artemis-journal帮助/使用信息测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/artemis/artemis-journal/test_artemis-journal_function_install.sh b/testcases/function_test/pkg_test/artemis/artemis-journal/test_artemis-journal_function_install.sh deleted file mode 100644 index f1cc1f8ce8d..00000000000 --- a/testcases/function_test/pkg_test/artemis/artemis-journal/test_artemis-journal_function_install.sh +++ /dev/null @@ -1,102 +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-09 -# @License : Mulan PSL v2 -# @Desc : Test installation of artemis-journal package -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装artemis-journal包 - LOG_INFO "检查是否已安装artemis-journal包" - rpm -q artemis-journal > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "artemis-journal包已安装,脚本结束时将保持安装状态" - INSTALLED_BEFORE=true - else - LOG_INFO "artemis-journal包未安装,将在测试中安装并在结束后卸载" - INSTALLED_BEFORE=false - fi - - # 检查yum源中是否有artemis-journal包 - LOG_INFO "检查yum源中是否有artemis-journal包" - dnf list available artemis-journal > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到artemis-journal包" - exit 255 - fi - - # 安装artemis-journal包 - if [ "$INSTALLED_BEFORE" = "false" ]; then - LOG_INFO "安装artemis-journal包" - dnf install -y artemis-journal - CHECK_RESULT $? 0 0 "安装artemis-journal包失败" - fi - - # 验证artemis-journal包安装成功 - LOG_INFO "验证artemis-journal包安装成功" - rpm -q artemis-journal > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "artemis-journal包未正确安装" - - # 检查artemis-journal命令是否可用 - LOG_INFO "检查artemis-journal命令是否可用" - which artemis-journal > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "artemis-journal命令不存在" - exit 255 - fi - - # 测试artemis-journal命令基本功能 - LOG_INFO "测试artemis-journal命令基本功能" - artemis-journal --help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "artemis-journal命令执行失败" - - # 测试artemis-journal命令的特定参数(假设--version参数存在) - LOG_INFO "测试artemis-journal命令的--version参数" - artemis-journal --version > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "artemis-journal命令--version参数执行失败" - - # 测试不支持的参数 - LOG_INFO "测试artemis-journal命令的不支持参数" - artemis-journal --invalid-param > /dev/null 2>&1 - if [ $? -ne 255 ] && [ $? -ne 0 ]; then - LOG_ERROR "artemis-journal命令对不支持参数处理异常" - exit 255 - fi - - # 清理环境:如果之前未安装,则卸载artemis-journal包 - if [ "$INSTALLED_BEFORE" = "false" ]; then - LOG_INFO "卸载artemis-journal包" - dnf remove -y artemis-journal - CHECK_RESULT $? 0 0 "卸载artemis-journal包失败" - - # 验证卸载成功 - LOG_INFO "验证artemis-journal包已卸载" - rpm -q artemis-journal > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_ERROR "artemis-journal包卸载失败" - exit 1 - else - LOG_INFO "artemis-journal包已成功卸载" - fi - else - LOG_INFO "保持artemis-journal包安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/artemis/artemis-journal/test_artemis-journal_function_uninstall.sh b/testcases/function_test/pkg_test/artemis/artemis-journal/test_artemis-journal_function_uninstall.sh deleted file mode 100644 index 6c6e71a05bf..00000000000 --- a/testcases/function_test/pkg_test/artemis/artemis-journal/test_artemis-journal_function_uninstall.sh +++ /dev/null @@ -1,84 +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-09 -# @License : Mulan PSL v2 -# @Desc : Test uninstallation of artemis-journal package -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:验证artemis-journal包的卸载功能" - - # 检查yum源中是否存在artemis-journal包 - LOG_INFO "步骤1:检查yum源中是否存在artemis-journal包" - dnf list available artemis-journal 2>/dev/null | grep -q artemis-journal - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到artemis-journal包" - exit 255 - fi - - # 检查当前环境中是否已安装artemis-journal - LOG_INFO "步骤2:检查当前环境中是否已安装artemis-journal" - rpm -q artemis-journal >/dev/null 2>&1 - installed=$? - - if [ $installed -eq 0 ]; then - LOG_INFO "环境中已安装artemis-journal,测试结束后将保持安装状态" - need_uninstall=0 - else - LOG_INFO "环境中未安装artemis-journal,将进行安装作为测试步骤" - need_uninstall=1 - - # 安装artemis-journal包 - LOG_INFO "步骤3:安装artemis-journal包" - dnf install -y artemis-journal - CHECK_RESULT $? 0 0 "安装artemis-journal包失败" - fi - - # 验证artemis-journal包是否安装成功 - LOG_INFO "步骤4:验证artemis-journal包是否安装成功" - rpm -q artemis-journal >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "artemis-journal包未正确安装" - - # 测试卸载artemis-journal包 - LOG_INFO "步骤5:测试卸载artemis-journal包" - dnf remove -y artemis-journal - CHECK_RESULT $? 0 0 "卸载artemis-journal包失败" - - # 验证artemis-journal包是否已卸载 - LOG_INFO "步骤6:验证artemis-journal包是否已卸载" - rpm -q artemis-journal >/dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_ERROR "artemis-journal包卸载后仍然存在" - exit 1 - fi - LOG_INFO "artemis-journal包已成功卸载" - - # 环境恢复 - LOG_INFO "步骤7:环境恢复" - if [ $need_uninstall -eq 0 ]; then - LOG_INFO "重新安装artemis-journal包以恢复原始状态" - dnf install -y artemis-journal - CHECK_RESULT $? 0 0 "重新安装artemis-journal包失败" - LOG_INFO "环境已恢复到初始安装状态" - else - LOG_INFO "环境中原本未安装artemis-journal,无需额外恢复操作" - fi - - LOG_INFO "测试完成:artemis-journal包的卸载功能测试通过" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/artemis/artemis-journal/test_artemis-journal_function_version.sh b/testcases/function_test/pkg_test/artemis/artemis-journal/test_artemis-journal_function_version.sh deleted file mode 100644 index c2b99b46a91..00000000000 --- a/testcases/function_test/pkg_test/artemis/artemis-journal/test_artemis-journal_function_version.sh +++ /dev/null @@ -1,115 +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-09 -# @License : Mulan PSL v2 -# @Desc : Test checking version of artemis-journal -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试artemis-journal版本检查功能 - LOG_INFO "开始测试artemis-journal版本检查功能" - - # 定义软件包名称 - PACKAGE_NAME="artemis-journal" - - # 步骤1:检查软件包是否已在yum源中 - LOG_INFO "步骤1:检查软件包是否在yum源中" - if ! dnf list available ${PACKAGE_NAME} &>/dev/null; then - LOG_ERROR "软件包 ${PACKAGE_NAME} 不在yum源中" - exit 255 - fi - CHECK_RESULT $? 0 0 "检查软件包是否在yum源中失败" - - # 步骤2:检查当前是否已安装软件包 - LOG_INFO "步骤2:检查软件包是否已安装" - if rpm -q ${PACKAGE_NAME} &>/dev/null; then - INSTALLED=true - LOG_INFO "软件包已安装,测试结束后将保持安装状态" - else - INSTALLED=false - LOG_INFO "软件包未安装,测试结束后将卸载软件包" - fi - - # 步骤3:如果未安装,则安装软件包 - if [ "${INSTALLED}" = "false" ]; then - LOG_INFO "步骤3:安装软件包" - dnf install -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "安装软件包失败" - fi - - # 步骤4:检查artemis-journal命令是否存在 - LOG_INFO "步骤4:检查artemis-journal命令是否存在" - if ! command -v artemis-journal &>/dev/null; then - LOG_ERROR "artemis-journal命令不存在" - if [ "${INSTALLED}" = "false" ]; then - dnf remove -y ${PACKAGE_NAME} - fi - exit 255 - fi - - # 步骤5:检查artemis-journal是否支持--version参数 - LOG_INFO "步骤5:检查artemis-journal是否支持--version参数" - if ! artemis-journal --help 2>&1 | grep -q "\-\-version"; then - LOG_ERROR "artemis-journal不支持--version参数" - if [ "${INSTALLED}" = "false" ]; then - dnf remove -y ${PACKAGE_NAME} - fi - exit 255 - fi - - # 步骤6:执行版本检查命令 - LOG_INFO "步骤6:执行artemis-journal --version命令" - artemis-journal --version - CHECK_RESULT $? 0 0 "执行artemis-journal --version命令失败" - - # 步骤7:验证版本输出格式 - LOG_INFO "步骤7:验证版本输出格式" - VERSION_OUTPUT=$(artemis-journal --version 2>&1) - if [ -z "${VERSION_OUTPUT}" ]; then - LOG_ERROR "版本输出为空" - if [ "${INSTALLED}" = "false" ]; then - dnf remove -y ${PACKAGE_NAME} - fi - exit 1 - fi - - # 步骤8:检查版本号格式(至少包含数字和点) - LOG_INFO "步骤8:检查版本号格式" - if echo "${VERSION_OUTPUT}" | grep -q -E "[0-9]+\.[0-9]+(\.[0-9]+)*"; then - LOG_INFO "版本号格式正确: $(echo ${VERSION_OUTPUT} | grep -o -E "[0-9]+\.[0-9]+(\.[0-9]+)*" | head -1)" - else - LOG_ERROR "版本号格式不正确" - if [ "${INSTALLED}" = "false" ]; then - dnf remove -y ${PACKAGE_NAME} - fi - exit 1 - fi - - # 步骤9:环境恢复 - LOG_INFO "步骤9:环境恢复" - if [ "${INSTALLED}" = "false" ]; then - LOG_INFO "卸载测试安装的软件包" - dnf remove -y ${PACKAGE_NAME} - CHECK_RESULT $? 0 0 "卸载软件包失败" - else - LOG_INFO "保持软件包安装状态" - fi - - LOG_INFO "artemis-journal版本检查测试完成" -} - -main "$@" \ No newline at end of file From 55c3d5a1f3cc07e1337ff8708c915c2a2bab08fe Mon Sep 17 00:00:00 2001 From: honghua Date: Thu, 16 Apr 2026 08:45:12 +0800 Subject: [PATCH 2/7] update testcase for testsuite qt6-qtpdf-devel --- .../qt6-qtwebengine/qt6-qtpdf-devel.json | 10 --- ...test_qt6-qtpdf-devel_function_pdfrender.sh | 71 ------------------- 2 files changed, 81 deletions(-) delete mode 100644 suite2cases/function_test/pkg_test/qt6-qtwebengine/qt6-qtpdf-devel.json delete mode 100644 testcases/function_test/pkg_test/qt6-qtwebengine/qt6-qtpdf-devel/test_qt6-qtpdf-devel_function_pdfrender.sh diff --git a/suite2cases/function_test/pkg_test/qt6-qtwebengine/qt6-qtpdf-devel.json b/suite2cases/function_test/pkg_test/qt6-qtwebengine/qt6-qtpdf-devel.json deleted file mode 100644 index 6b2911e27f5..00000000000 --- a/suite2cases/function_test/pkg_test/qt6-qtwebengine/qt6-qtpdf-devel.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/qt6-qtwebengine/qt6-qtpdf-devel", - "machine num": 1, - "cases": [ - { - "name": "test_qt6-qtpdf-devel_function_pdfrender", - "desc": "Test PDF rendering functionality" - } - ] -} \ No newline at end of file diff --git a/testcases/function_test/pkg_test/qt6-qtwebengine/qt6-qtpdf-devel/test_qt6-qtpdf-devel_function_pdfrender.sh b/testcases/function_test/pkg_test/qt6-qtwebengine/qt6-qtpdf-devel/test_qt6-qtpdf-devel_function_pdfrender.sh deleted file mode 100644 index ecd5dd2cbd4..00000000000 --- a/testcases/function_test/pkg_test/qt6-qtwebengine/qt6-qtpdf-devel/test_qt6-qtpdf-devel_function_pdfrender.sh +++ /dev/null @@ -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-12 -# @License : Mulan PSL v2 -# @Desc : Test PDF rendering functionality -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装qt6-qtpdf-devel软件包 - LOG_INFO "检查qt6-qtpdf-devel软件包是否已安装" - rpm -q qt6-qtpdf-devel > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "qt6-qtpdf-devel软件包已安装,脚本结束时保持安装状态" - installed=true - else - installed=false - fi - - # 检查yum源中是否有qt6-qtpdf-devel软件包 - LOG_INFO "检查yum源中是否有qt6-qtpdf-devel软件包" - dnf list available qt6-qtpdf-devel > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到qt6-qtpdf-devel软件包" - exit 255 - fi - - # 安装qt6-qtpdf-devel软件包 - if [ "$installed" = false ]; then - LOG_INFO "安装qt6-qtpdf-devel软件包" - dnf install -y qt6-qtpdf-devel - CHECK_RESULT $? 0 0 "安装qt6-qtpdf-devel软件包失败" - fi - - # 测试PDF渲染功能 - LOG_INFO "测试PDF渲染功能" - test_pdf="test.pdf" - if [ ! -f "$test_pdf" ]; then - LOG_ERROR "测试PDF文件不存在: $test_pdf" - exit 255 - fi - - # 使用qpdf命令测试渲染功能 - LOG_INFO "使用qpdf命令测试PDF渲染功能" - qpdf --check "$test_pdf" > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "PDF渲染功能测试失败" - - # 清理环境:如果脚本开始时未安装qt6-qtpdf-devel,则卸载 - if [ "$installed" = false ]; then - LOG_INFO "卸载qt6-qtpdf-devel软件包" - dnf remove -y qt6-qtpdf-devel - CHECK_RESULT $? 0 0 "卸载qt6-qtpdf-devel软件包失败" - fi - - LOG_INFO "测试脚本执行完成" -} - -main "$@" \ No newline at end of file From a88cc35276ae0cecff0dceaab1b15e6a94be09b0 Mon Sep 17 00:00:00 2001 From: honghua Date: Thu, 16 Apr 2026 08:45:22 +0800 Subject: [PATCH 3/7] update testcase for testsuite source-highlight --- .../source-highlight/source-highlight.json | 4 -- ...st_source-highlight_java2html_lang_list.sh | 62 ------------------- 2 files changed, 66 deletions(-) delete mode 100644 testcases/function_test/pkg_test/source-highlight/source-highlight/test_source-highlight_java2html_lang_list.sh diff --git a/suite2cases/function_test/pkg_test/source-highlight/source-highlight.json b/suite2cases/function_test/pkg_test/source-highlight/source-highlight.json index 424f8c2efcb..aeb77ec18f2 100644 --- a/suite2cases/function_test/pkg_test/source-highlight/source-highlight.json +++ b/suite2cases/function_test/pkg_test/source-highlight/source-highlight.json @@ -103,10 +103,6 @@ "name": "test_source-highlight_check-regexp_upper_v", "desc": "执行check-regexp命令时使用-V参数显示版本信息" }, - { - "name": "test_source-highlight_java2html_lang_list", - "desc": "使用--lang-list列出所有支持的源语言" - }, { "name": "test_source-highlight_java2html_outlang_list", "desc": "使用--outlang-list列出所有支持的输出格式" diff --git a/testcases/function_test/pkg_test/source-highlight/source-highlight/test_source-highlight_java2html_lang_list.sh b/testcases/function_test/pkg_test/source-highlight/source-highlight/test_source-highlight_java2html_lang_list.sh deleted file mode 100644 index 1207fa66f6f..00000000000 --- a/testcases/function_test/pkg_test/source-highlight/source-highlight/test_source-highlight_java2html_lang_list.sh +++ /dev/null @@ -1,62 +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-31 -# @License : Mulan PSL v2 -# @Desc : 使用--lang-list列出所有支持的源语言 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试source-highlight --lang-list命令" - LOG_INFO "检查是否已安装source-highlight软件包" - rpm -q source-highlight > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "source-highlight已安装,测试结束后保持安装状态" - already_installed=1 - else - LOG_INFO "source-highlight未安装,将临时安装用于测试" - already_installed=0 - LOG_INFO "检查yum源中是否有source-highlight软件包" - dnf list available source-highlight > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum源中未找到source-highlight软件包" - LOG_INFO "安装source-highlight软件包" - dnf install -y source-highlight > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装source-highlight失败" - fi - LOG_INFO "测试--lang-list参数是否被支持" - source-highlight --lang-list > /dev/null 2>&1 - if [ $? -eq 255 ]; then - LOG_ERROR "--lang-list参数不被支持" - exit 255 - fi - LOG_INFO "执行source-highlight --lang-list命令" - source-highlight --lang-list - CHECK_RESULT $? 0 0 "执行source-highlight --lang-list命令失败" - LOG_INFO "检查输出内容是否包含常见语言" - source-highlight --lang-list | grep -E "java|cpp|python" > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "输出中未找到常见语言" - LOG_INFO "清理环境" - if [ $already_installed -eq 0 ]; then - LOG_INFO "卸载临时安装的source-highlight软件包" - dnf remove -y source-highlight > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载source-highlight失败" - else - LOG_INFO "保持source-highlight安装状态" - fi - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file From ee0d49eabf547e38c23f8cb18657130df58fc444 Mon Sep 17 00:00:00 2001 From: honghua Date: Thu, 16 Apr 2026 08:46:47 +0800 Subject: [PATCH 4/7] update testcase for testsuite texlive-ntgclass-doc --- .../texlive-split-q/texlive-ntgclass-doc.json | 10 --- ...st_texlive-ntgclass-doc_function_docgen.sh | 68 ------------------- 2 files changed, 78 deletions(-) delete mode 100644 suite2cases/function_test/pkg_test/texlive-split-q/texlive-ntgclass-doc.json delete mode 100644 testcases/function_test/pkg_test/texlive-split-q/texlive-ntgclass-doc/test_texlive-ntgclass-doc_function_docgen.sh diff --git a/suite2cases/function_test/pkg_test/texlive-split-q/texlive-ntgclass-doc.json b/suite2cases/function_test/pkg_test/texlive-split-q/texlive-ntgclass-doc.json deleted file mode 100644 index 288ad57cfa3..00000000000 --- a/suite2cases/function_test/pkg_test/texlive-split-q/texlive-ntgclass-doc.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "path": "$OET_PATH/testcases/function_test/pkg_test/texlive-split-q/texlive-ntgclass-doc", - "machine num": 1, - "cases": [ - { - "name": "test_texlive-ntgclass-doc_function_docgen", - "desc": "Verify documentation generation" - } - ] -} \ No newline at end of file diff --git a/testcases/function_test/pkg_test/texlive-split-q/texlive-ntgclass-doc/test_texlive-ntgclass-doc_function_docgen.sh b/testcases/function_test/pkg_test/texlive-split-q/texlive-ntgclass-doc/test_texlive-ntgclass-doc_function_docgen.sh deleted file mode 100644 index 6afb106f9ea..00000000000 --- a/testcases/function_test/pkg_test/texlive-split-q/texlive-ntgclass-doc/test_texlive-ntgclass-doc_function_docgen.sh +++ /dev/null @@ -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 : 2025-12-10 -# @License : Mulan PSL v2 -# @Desc : Verify documentation generation -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:Verify documentation generation" - - # 检查是否已安装texlive-ntgclass-doc - LOG_INFO "检查是否已安装texlive-ntgclass-doc" - if dnf list installed texlive-ntgclass-doc &>/dev/null; then - LOG_INFO "texlive-ntgclass-doc已安装,测试结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "texlive-ntgclass-doc未安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有texlive-ntgclass-doc - LOG_INFO "检查yum源中是否有texlive-ntgclass-doc" - if ! dnf list available texlive-ntgclass-doc &>/dev/null; then - LOG_ERROR "yum源中未找到texlive-ntgclass-doc" - exit 255 - fi - - # 安装texlive-ntgclass-doc(如果未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在安装texlive-ntgclass-doc" - dnf install -y texlive-ntgclass-doc - CHECK_RESULT $? 0 0 "安装texlive-ntgclass-doc失败" - fi - - # 验证文档生成功能 - LOG_INFO "验证文档生成功能" - docgen_output=$(docgen --help 2>&1) - if [ $? -ne 0 ]; then - LOG_ERROR "docgen命令不支持或参数错误" - exit 255 - fi - CHECK_RESULT $? 0 0 "docgen命令执行失败" - - # 清理环境(如果测试前未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "正在卸载texlive-ntgclass-doc" - dnf remove -y texlive-ntgclass-doc - CHECK_RESULT $? 0 0 "卸载texlive-ntgclass-doc失败" - fi - - LOG_INFO "测试完成:Verify documentation generation" -} - -main "$@" \ No newline at end of file From 169cc23a1bb7933396b3593ec3ea7add0b3b7a06 Mon Sep 17 00:00:00 2001 From: honghua Date: Thu, 16 Apr 2026 08:50:18 +0800 Subject: [PATCH 5/7] update testcase for testsuite libcomps-devel --- .../pkg_test/libcomps/libcomps-devel.json | 32 --- .../test_libcomps-devel_check.sh | 103 ---------- .../test_libcomps-devel_compile.sh | 74 ------- .../test_libcomps-devel_function_compile.sh | 96 --------- ...st_libcomps-devel_function_environments.sh | 80 -------- .../test_libcomps-devel_function_groups.sh | 113 ----------- .../test_libcomps-devel_function_headers.sh | 74 ------- .../test_libcomps-devel_function_libs.sh | 183 ------------------ ...est_libcomps-devel_function_parse_comps.sh | 86 -------- 9 files changed, 841 deletions(-) delete mode 100644 testcases/function_test/pkg_test/libcomps/libcomps-devel/test_libcomps-devel_check.sh delete mode 100644 testcases/function_test/pkg_test/libcomps/libcomps-devel/test_libcomps-devel_compile.sh delete mode 100644 testcases/function_test/pkg_test/libcomps/libcomps-devel/test_libcomps-devel_function_compile.sh delete mode 100644 testcases/function_test/pkg_test/libcomps/libcomps-devel/test_libcomps-devel_function_environments.sh delete mode 100644 testcases/function_test/pkg_test/libcomps/libcomps-devel/test_libcomps-devel_function_groups.sh delete mode 100644 testcases/function_test/pkg_test/libcomps/libcomps-devel/test_libcomps-devel_function_headers.sh delete mode 100644 testcases/function_test/pkg_test/libcomps/libcomps-devel/test_libcomps-devel_function_libs.sh delete mode 100644 testcases/function_test/pkg_test/libcomps/libcomps-devel/test_libcomps-devel_function_parse_comps.sh diff --git a/suite2cases/function_test/pkg_test/libcomps/libcomps-devel.json b/suite2cases/function_test/pkg_test/libcomps/libcomps-devel.json index c628d8af726..f666a196c62 100644 --- a/suite2cases/function_test/pkg_test/libcomps/libcomps-devel.json +++ b/suite2cases/function_test/pkg_test/libcomps/libcomps-devel.json @@ -10,14 +10,6 @@ "name": "test_libcomps-devel_remove", "desc": "测试 libcomps-devel 软件包能否成功卸载" }, - { - "name": "test_libcomps-devel_check", - "desc": "测试 libcomps-devel 软件包(开发库和头文件)是否已正确安装" - }, - { - "name": "test_libcomps-devel_compile", - "desc": "测试使用 libcomps-devel 开发库编译简单程序" - }, { "name": "test_libcomps-devel_function_install", "desc": "测试 libcomps-devel 软件包的安装功能" @@ -29,30 +21,6 @@ { "name": "test_libcomps-devel_function_check_ver", "desc": "测试检查 libcomps-devel 软件包的版本信息" - }, - { - "name": "test_libcomps-devel_function_headers", - "desc": "测试 libcomps-devel 头文件的存在与完整性" - }, - { - "name": "test_libcomps-devel_function_libs", - "desc": "测试 libcomps-devel 开发库文件的存在与链接有效性" - }, - { - "name": "test_libcomps-devel_function_compile", - "desc": "测试使用 libcomps-devel 库编译一个简单的 C 程序" - }, - { - "name": "test_libcomps-devel_function_parse_comps", - "desc": "测试使用 libcomps 库解析 comps.xml 文件的基本功能" - }, - { - "name": "test_libcomps-devel_function_groups", - "desc": "测试获取和遍历 comps.xml 中的软件包组信息" - }, - { - "name": "test_libcomps-devel_function_environments", - "desc": "测试获取和遍历 comps.xml 中的环境组信息" } ] } \ No newline at end of file diff --git a/testcases/function_test/pkg_test/libcomps/libcomps-devel/test_libcomps-devel_check.sh b/testcases/function_test/pkg_test/libcomps/libcomps-devel/test_libcomps-devel_check.sh deleted file mode 100644 index da3bab804f2..00000000000 --- a/testcases/function_test/pkg_test/libcomps/libcomps-devel/test_libcomps-devel_check.sh +++ /dev/null @@ -1,103 +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-01-28 -# @License : Mulan PSL v2 -# @Desc : 测试 libcomps-devel 软件包(开发库和头文件)是否已正确安装 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查libcomps-devel软件包是否已正确安装 - LOG_INFO "开始测试libcomps-devel软件包(开发库和头文件)是否已正确安装" - - # 检查软件包是否已在yum源中 - LOG_INFO "检查yum源中是否存在libcomps-devel软件包" - dnf list available libcomps-devel > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到libcomps-devel软件包" - exit 255 - fi - - # 检查是否已安装libcomps-devel - LOG_INFO "检查libcomps-devel是否已安装" - rpm -q libcomps-devel > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "libcomps-devel已安装,标记为需要保持安装状态" - KEEP_INSTALLED=1 - else - LOG_INFO "libcomps-devel未安装,将进行安装测试" - KEEP_INSTALLED=0 - fi - - # 如果未安装,则安装软件包 - if [ $KEEP_INSTALLED -eq 0 ]; then - LOG_INFO "安装libcomps-devel软件包" - dnf install -y libcomps-devel - CHECK_RESULT $? 0 0 "安装libcomps-devel失败" - fi - - # 验证软件包安装 - LOG_INFO "验证libcomps-devel软件包是否已正确安装" - rpm -q libcomps-devel > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "libcomps-devel软件包未正确安装" - - # 检查开发库文件是否存在 - LOG_INFO "检查libcomps开发库文件" - ls /usr/lib*/libcomps.so > /dev/null 2>&1 || ls /usr/lib64/libcomps.so > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "未找到libcomps开发库文件" - - # 检查头文件是否存在 - LOG_INFO "检查libcomps头文件" - ls /usr/include/libcomps/libcomps.h > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "未找到libcomps头文件" - - # 测试开发库链接 - LOG_INFO "测试libcomps开发库链接" - cat > /tmp/test_libcomps.c << "EOF" - #include - #include - int main() { - printf("libcomps version: %s\n", COMPS_VERSION); - return 0; - } - EOF - - gcc -o /tmp/test_libcomps /tmp/test_libcomps.c -lcomps 2>/dev/null - CHECK_RESULT $? 0 0 "libcomps开发库链接测试失败" - - # 运行测试程序 - LOG_INFO "运行libcomps测试程序" - /tmp/test_libcomps - CHECK_RESULT $? 0 0 "libcomps测试程序运行失败" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f /tmp/test_libcomps.c /tmp/test_libcomps - - # 环境恢复 - LOG_INFO "恢复测试环境" - if [ $KEEP_INSTALLED -eq 0 ]; then - LOG_INFO "卸载libcomps-devel软件包" - dnf remove -y libcomps-devel - CHECK_RESULT $? 0 0 "卸载libcomps-devel失败" - else - LOG_INFO "保持libcomps-devel软件包安装状态" - fi - - LOG_INFO "libcomps-devel软件包测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/libcomps/libcomps-devel/test_libcomps-devel_compile.sh b/testcases/function_test/pkg_test/libcomps/libcomps-devel/test_libcomps-devel_compile.sh deleted file mode 100644 index 6998d27009c..00000000000 --- a/testcases/function_test/pkg_test/libcomps/libcomps-devel/test_libcomps-devel_compile.sh +++ /dev/null @@ -1,74 +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-01-28 -# @License : Mulan PSL v2 -# @Desc : 测试使用 libcomps-devel 开发库编译简单程序 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断 libcomps-devel 是否已安装 - LOG_INFO "检查 libcomps-devel 是否已安装" - rpm -q libcomps-devel > /dev/null 2>&1 - is_installed=$? - - # 如果未安装,则尝试从 yum 源安装 - if [ $is_installed -ne 0 ]; then - LOG_INFO "libcomps-devel 未安装,尝试从 yum 源查找" - dnf list available libcomps-devel > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum 源中未找到 libcomps-devel 软件包" - LOG_INFO "安装 libcomps-devel" - dnf install -y libcomps-devel - CHECK_RESULT $? 0 0 "安装 libcomps-devel 失败" - fi - - # 创建测试源代码文件 - LOG_INFO "创建测试源代码文件 test_libcomps.c" - cat > test_libcomps.c << "EOF" - #include - #include - - int main() { - printf("测试 libcomps-devel 开发库编译简单程序\n"); - return 0; - } - EOF - - # 编译测试程序 - LOG_INFO "编译测试程序" - gcc -o test_libcomps test_libcomps.c $(pkg-config --cflags --libs libcomps) 2>&1 - CHECK_RESULT $? 0 0 "编译失败" - - # 运行测试程序 - LOG_INFO "运行测试程序" - ./test_libcomps - CHECK_RESULT $? 0 0 "运行测试程序失败" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_libcomps test_libcomps.c - - # 如果脚本开始时未安装 libcomps-devel,则在结束时卸载 - if [ $is_installed -ne 0 ]; then - LOG_INFO "卸载 libcomps-devel" - dnf remove -y libcomps-devel - CHECK_RESULT $? 0 0 "卸载 libcomps-devel 失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/libcomps/libcomps-devel/test_libcomps-devel_function_compile.sh b/testcases/function_test/pkg_test/libcomps/libcomps-devel/test_libcomps-devel_function_compile.sh deleted file mode 100644 index ab45504afd7..00000000000 --- a/testcases/function_test/pkg_test/libcomps/libcomps-devel/test_libcomps-devel_function_compile.sh +++ /dev/null @@ -1,96 +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-01-30 -# @License : Mulan PSL v2 -# @Desc : 测试使用 libcomps-devel 库编译一个简单的 C 程序 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试使用 libcomps-devel 库编译一个简单的 C 程序" - - # 步骤1: 检查 libcomps-devel 包是否在 yum 源中 - LOG_INFO "步骤1: 检查 libcomps-devel 包是否在 yum 源中" - dnf list available libcomps-devel &>/dev/null - CHECK_RESULT $? 0 0 "yum 源中未找到 libcomps-devel 包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum 源中未找到 libcomps-devel 包,退出测试" - exit 255 - fi - - # 步骤2: 检查是否已安装 libcomps-devel - LOG_INFO "步骤2: 检查是否已安装 libcomps-devel" - rpm -q libcomps-devel &>/dev/null - if [ $? -eq 0 ]; then - LOG_INFO "libcomps-devel 已安装,跳过安装步骤" - INSTALLED=true - else - LOG_INFO "libcomps-devel 未安装,开始安装" - INSTALLED=false - fi - - # 步骤3: 如果未安装,则安装 libcomps-devel - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤3: 安装 libcomps-devel" - dnf install -y libcomps-devel - CHECK_RESULT $? 0 0 "安装 libcomps-devel 失败" - fi - - # 步骤4: 创建一个简单的 C 程序,使用 libcomps-devel 库 - LOG_INFO "步骤4: 创建一个简单的 C 程序,使用 libcomps-devel 库" - cat > test_libcomps.c << "EOF" - #include - #include - - int main() { - struct CompsObj *obj = comps_obj_create(); - if (obj == NULL) { - printf("Failed to create CompsObj\n"); - return 1; - } - printf("Successfully created CompsObj\n"); - comps_obj_free(obj); - return 0; - } - EOF - - # 步骤5: 编译 C 程序 - LOG_INFO "步骤5: 编译 C 程序" - gcc -o test_libcomps test_libcomps.c $(pkg-config --cflags --libs libcomps) - CHECK_RESULT $? 0 0 "编译 C 程序失败" - - # 步骤6: 运行编译后的程序 - LOG_INFO "步骤6: 运行编译后的程序" - ./test_libcomps - CHECK_RESULT $? 0 0 "运行编译后的程序失败" - - # 步骤7: 清理编译生成的文件 - LOG_INFO "步骤7: 清理编译生成的文件" - rm -f test_libcomps test_libcomps.c - - # 步骤8: 如果之前未安装,则卸载 libcomps-devel - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤8: 卸载 libcomps-devel" - dnf remove -y libcomps-devel - CHECK_RESULT $? 0 0 "卸载 libcomps-devel 失败" - else - LOG_INFO "步骤8: 保持 libcomps-devel 安装状态" - fi - - LOG_INFO "测试使用 libcomps-devel 库编译一个简单的 C 程序完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/libcomps/libcomps-devel/test_libcomps-devel_function_environments.sh b/testcases/function_test/pkg_test/libcomps/libcomps-devel/test_libcomps-devel_function_environments.sh deleted file mode 100644 index ff803ff3577..00000000000 --- a/testcases/function_test/pkg_test/libcomps/libcomps-devel/test_libcomps-devel_function_environments.sh +++ /dev/null @@ -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-01-30 -# @License : Mulan PSL v2 -# @Desc : 测试获取和遍历 comps.xml 中的环境组信息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:测试获取和遍历 comps.xml 中的环境组信息" - - # 定义软件包名称 - PACKAGE="libcomps-devel" - - # 检查软件包是否已在yum源中 - LOG_INFO "检查yum源中是否存在软件包 $PACKAGE" - dnf list available $PACKAGE &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 $PACKAGE 在yum源中不存在" - exit 255 - fi - - # 检查当前是否已安装软件包 - LOG_INFO "检查当前是否已安装软件包 $PACKAGE" - rpm -q $PACKAGE &>/dev/null - INSTALLED=$? - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "软件包 $PACKAGE 已安装,测试结束后将保持安装状态" - NEED_UNINSTALL=0 - else - LOG_INFO "软件包 $PACKAGE 未安装,将在测试过程中安装并在测试结束后卸载" - NEED_UNINSTALL=1 - fi - - # 如果未安装,则安装软件包 - if [ $NEED_UNINSTALL -eq 1 ]; then - LOG_INFO "安装软件包 $PACKAGE" - dnf install -y $PACKAGE - CHECK_RESULT $? 0 0 "安装软件包 $PACKAGE 失败" - fi - - # 检查 comps 命令是否支持所需参数 - LOG_INFO "检查 comps 命令是否支持所需参数" - comps --help 2>&1 | grep -q "\-\-get-environments" - if [ $? -ne 0 ]; then - LOG_ERROR "comps 命令不支持 --get-environments 参数" - exit 255 - fi - - # 测试获取和遍历 comps.xml 中的环境组信息 - LOG_INFO "执行 comps --get-environments 命令获取环境组信息" - comps --get-environments - CHECK_RESULT $? 0 0 "执行 comps --get-environments 命令失败" - - # 清理环境:如果测试前未安装,则卸载软件包 - if [ $NEED_UNINSTALL -eq 1 ]; then - LOG_INFO "卸载软件包 $PACKAGE" - dnf remove -y $PACKAGE - CHECK_RESULT $? 0 0 "卸载软件包 $PACKAGE 失败" - else - LOG_INFO "测试前已安装软件包 $PACKAGE,测试结束后保持安装状态" - fi - - LOG_INFO "测试完成:测试获取和遍历 comps.xml 中的环境组信息" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/libcomps/libcomps-devel/test_libcomps-devel_function_groups.sh b/testcases/function_test/pkg_test/libcomps/libcomps-devel/test_libcomps-devel_function_groups.sh deleted file mode 100644 index 8b9ad3016de..00000000000 --- a/testcases/function_test/pkg_test/libcomps/libcomps-devel/test_libcomps-devel_function_groups.sh +++ /dev/null @@ -1,113 +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-01-30 -# @License : Mulan PSL v2 -# @Desc : 测试获取和遍历 comps.xml 中的软件包组信息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试脚本:test_libcomps-devel_function_groups - # 功能:测试获取和遍历 comps.xml 中的软件包组信息 - - # 环境变量定义 - PACKAGE_NAME="libcomps-devel" - YUM_REPO_CMD="dnf list available ${PACKAGE_NAME} 2>/dev/null | grep -q ${PACKAGE_NAME}" - INSTALL_CMD="dnf install -y ${PACKAGE_NAME}" - REMOVE_CMD="dnf remove -y ${PACKAGE_NAME}" - TEST_COMMAND="comps_groups_test" - TEST_PARAM="--help" - INITIAL_INSTALL_STATUS="unknown" - - # 步骤1:检查软件包是否在yum源中 - LOG_INFO "步骤1:检查软件包 ${PACKAGE_NAME} 是否在yum源中" - if eval ${YUM_REPO_CMD}; then - LOG_INFO "软件包 ${PACKAGE_NAME} 在yum源中存在" - else - LOG_ERROR "软件包 ${PACKAGE_NAME} 在yum源中不存在" - exit 255 - fi - - # 步骤2:检查当前环境是否已安装软件包 - LOG_INFO "步骤2:检查当前环境是否已安装软件包 ${PACKAGE_NAME}" - if rpm -q ${PACKAGE_NAME} >/dev/null 2>&1; then - LOG_INFO "软件包 ${PACKAGE_NAME} 已安装" - INITIAL_INSTALL_STATUS="installed" - else - LOG_INFO "软件包 ${PACKAGE_NAME} 未安装" - INITIAL_INSTALL_STATUS="not_installed" - fi - - # 步骤3:如果未安装,则安装软件包 - if [ "${INITIAL_INSTALL_STATUS}" = "not_installed" ]; then - LOG_INFO "步骤3:安装软件包 ${PACKAGE_NAME}" - eval ${INSTALL_CMD} - CHECK_RESULT $? 0 0 "安装软件包 ${PACKAGE_NAME} 失败" - LOG_INFO "软件包 ${PACKAGE_NAME} 安装成功" - fi - - # 步骤4:检查测试命令是否存在 - LOG_INFO "步骤4:检查测试命令 ${TEST_COMMAND} 是否存在" - if command -v ${TEST_COMMAND} >/dev/null 2>&1; then - LOG_INFO "测试命令 ${TEST_COMMAND} 存在" - else - LOG_ERROR "测试命令 ${TEST_COMMAND} 不存在" - # 如果是新安装的,需要卸载 - if [ "${INITIAL_INSTALL_STATUS}" = "not_installed" ]; then - eval ${REMOVE_CMD} - fi - exit 255 - fi - - # 步骤5:检查测试命令参数是否支持 - LOG_INFO "步骤5:检查测试命令参数 ${TEST_PARAM} 是否支持" - ${TEST_COMMAND} ${TEST_PARAM} >/dev/null 2>&1 - if [ $? -eq 0 ] || [ $? -eq 1 ]; then - LOG_INFO "测试命令参数 ${TEST_PARAM} 支持" - else - LOG_ERROR "测试命令参数 ${TEST_PARAM} 不支持" - # 如果是新安装的,需要卸载 - if [ "${INITIAL_INSTALL_STATUS}" = "not_installed" ]; then - eval ${REMOVE_CMD} - fi - exit 255 - fi - - # 步骤6:执行测试命令获取和遍历 comps.xml 中的软件包组信息 - LOG_INFO "步骤6:执行测试命令获取和遍历 comps.xml 中的软件包组信息" - ${TEST_COMMAND} --list-groups - CHECK_RESULT $? 0 0 "获取和遍历 comps.xml 中的软件包组信息失败" - - # 步骤7:执行测试命令获取特定软件包组信息 - LOG_INFO "步骤7:执行测试命令获取特定软件包组信息" - ${TEST_COMMAND} --group-info "base" - CHECK_RESULT $? 0 0 "获取特定软件包组信息失败" - - # 步骤8:环境恢复 - LOG_INFO "步骤8:环境恢复" - if [ "${INITIAL_INSTALL_STATUS}" = "not_installed" ]; then - LOG_INFO "卸载软件包 ${PACKAGE_NAME}" - eval ${REMOVE_CMD} - CHECK_RESULT $? 0 0 "卸载软件包 ${PACKAGE_NAME} 失败" - LOG_INFO "软件包 ${PACKAGE_NAME} 卸载成功,环境已恢复" - else - LOG_INFO "软件包 ${PACKAGE_NAME} 保持安装状态,环境已恢复" - fi - - LOG_INFO "测试脚本执行完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/libcomps/libcomps-devel/test_libcomps-devel_function_headers.sh b/testcases/function_test/pkg_test/libcomps/libcomps-devel/test_libcomps-devel_function_headers.sh deleted file mode 100644 index 23843a53b90..00000000000 --- a/testcases/function_test/pkg_test/libcomps/libcomps-devel/test_libcomps-devel_function_headers.sh +++ /dev/null @@ -1,74 +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-01-30 -# @License : Mulan PSL v2 -# @Desc : 测试 libcomps-devel 头文件的存在与完整性 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 libcomps-devel 头文件的存在与完整性" - - # 检查是否已安装 libcomps-devel - LOG_INFO "检查是否已安装 libcomps-devel" - dnf list installed libcomps-devel &> /dev/null - if [ $? -eq 0 ]; then - LOG_INFO "libcomps-devel 已安装,测试结束后将保持安装状态" - already_installed=true - else - LOG_INFO "libcomps-devel 未安装,将在测试前安装" - already_installed=false - fi - - # 检查 yum 源中是否有 libcomps-devel 软件包 - LOG_INFO "检查 yum 源中是否有 libcomps-devel 软件包" - dnf list available libcomps-devel &> /dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum 源中没有 libcomps-devel 软件包" - exit 255 - fi - - # 如果未安装,则安装 libcomps-devel - if [ "$already_installed" = false ]; then - LOG_INFO "安装 libcomps-devel" - dnf install -y libcomps-devel - CHECK_RESULT $? 0 0 "安装 libcomps-devel 失败" - fi - - # 测试头文件的存在与完整性 - LOG_INFO "测试头文件的存在" - if [ -f /usr/include/libcomps/comps.h ]; then - LOG_INFO "头文件 /usr/include/libcomps/comps.h 存在" - else - LOG_ERROR "头文件 /usr/include/libcomps/comps.h 不存在" - exit 1 - fi - - LOG_INFO "测试头文件的完整性" - grep -q "#ifndef _COMPS_H" /usr/include/libcomps/comps.h - CHECK_RESULT $? 0 0 "头文件 /usr/include/libcomps/comps.h 不完整" - - # 清理环境:如果测试前未安装,则卸载 libcomps-devel - if [ "$already_installed" = false ]; then - LOG_INFO "卸载 libcomps-devel" - dnf remove -y libcomps-devel - CHECK_RESULT $? 0 0 "卸载 libcomps-devel 失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/libcomps/libcomps-devel/test_libcomps-devel_function_libs.sh b/testcases/function_test/pkg_test/libcomps/libcomps-devel/test_libcomps-devel_function_libs.sh deleted file mode 100644 index 24d65b6da92..00000000000 --- a/testcases/function_test/pkg_test/libcomps/libcomps-devel/test_libcomps-devel_function_libs.sh +++ /dev/null @@ -1,183 +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-01-30 -# @License : Mulan PSL v2 -# @Desc : 测试 libcomps-devel 开发库文件的存在与链接有效性 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义颜色输出函数(如果未定义) - if ! command -v LOG_INFO &> /dev/null; then - LOG_INFO() { - echo "[INFO] $*" - } - fi - - if ! command -v LOG_ERROR &> /dev/null; then - LOG_ERROR() { - echo "[ERROR] $*" >&2 - } - fi - - # 检查软件包是否存在 - check_package_exist() { - local package_name="$1" - LOG_INFO "检查软件包 ${package_name} 是否在yum源中" - dnf list available "${package_name}" &> /dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 ${package_name} 不在yum源中" - exit 255 - fi - LOG_INFO "软件包 ${package_name} 在yum源中存在" - } - - # 检查命令参数是否支持 - check_command_option() { - local cmd="$1" - local option="$2" - LOG_INFO "检查命令 ${cmd} 是否支持参数 ${option}" - ${cmd} --help 2>&1 | grep -q -- "${option}" - if [ $? -ne 0 ]; then - LOG_ERROR "命令 ${cmd} 不支持参数 ${option}" - exit 255 - fi - LOG_INFO "命令 ${cmd} 支持参数 ${option}" - } - - # 检查libcomps-devel是否已安装 - check_libcomps_devel_installed() { - LOG_INFO "检查libcomps-devel是否已安装" - rpm -q libcomps-devel &> /dev/null - return $? - } - - # 安装libcomps-devel - install_libcomps_devel() { - LOG_INFO "开始安装libcomps-devel" - dnf install -y libcomps-devel - CHECK_RESULT $? 0 0 "安装libcomps-devel失败" - LOG_INFO "安装libcomps-devel成功" - } - - # 卸载libcomps-devel - uninstall_libcomps_devel() { - LOG_INFO "开始卸载libcomps-devel" - dnf remove -y libcomps-devel - CHECK_RESULT $? 0 0 "卸载libcomps-devel失败" - LOG_INFO "卸载libcomps-devel成功" - } - - # 测试libcomps-devel开发库文件存在性 - test_libcomps_devel_files_exist() { - LOG_INFO "测试libcomps-devel开发库文件是否存在" - local header_file="/usr/include/libcomps/comps.h" - local lib_file="/usr/lib64/libcomps.so" - - if [ -f "${header_file}" ]; then - LOG_INFO "头文件 ${header_file} 存在" - else - LOG_ERROR "头文件 ${header_file} 不存在" - exit 1 - fi - - if [ -f "${lib_file}" ]; then - LOG_INFO "库文件 ${lib_file} 存在" - else - LOG_ERROR "库文件 ${lib_file} 不存在" - exit 1 - fi - } - - # 测试libcomps-devel开发库链接有效性 - test_libcomps_devel_link_validity() { - LOG_INFO "测试libcomps-devel开发库链接有效性" - - # 创建一个简单的测试程序 - cat > test_libcomps.c << "EOF" - #include - #include - - int main() { - COMPS_Object *obj = COMPS_ObjectCreate(); - if (obj != NULL) { - printf("libcomps库链接成功\n"); - COMPS_ObjectDestroy(obj); - return 0; - } else { - printf("libcomps库链接失败\n"); - return 1; - } - } - EOF - - # 编译测试程序 - gcc test_libcomps.c -o test_libcomps -lcomps - CHECK_RESULT $? 0 0 "编译测试程序失败" - - # 运行测试程序 - ./test_libcomps - CHECK_RESULT $? 0 0 "运行测试程序失败" - - # 清理测试文件 - rm -f test_libcomps.c test_libcomps - LOG_INFO "libcomps-devel开发库链接有效性测试成功" - } - - # 主测试函数 - main() { - LOG_INFO "开始测试libcomps-devel开发库文件的存在与链接有效性" - - # 检查软件包是否存在 - check_package_exist "libcomps-devel" - - # 检查命令参数支持 - check_command_option "dnf" "install" - check_command_option "dnf" "remove" - - # 检查是否已安装 - local was_installed=0 - if check_libcomps_devel_installed; then - LOG_INFO "libcomps-devel已安装,测试后保持安装状态" - was_installed=1 - else - LOG_INFO "libcomps-devel未安装,将进行安装测试" - was_installed=0 - install_libcomps_devel - fi - - # 测试开发库文件存在性 - test_libcomps_devel_files_exist - - # 测试开发库链接有效性 - test_libcomps_devel_link_validity - - # 环境恢复 - LOG_INFO "开始环境恢复" - if [ ${was_installed} -eq 0 ]; then - uninstall_libcomps_devel - else - LOG_INFO "保持libcomps-devel安装状态" - fi - - LOG_INFO "测试完成,环境已恢复" - } - - # 执行主函数 - main -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/libcomps/libcomps-devel/test_libcomps-devel_function_parse_comps.sh b/testcases/function_test/pkg_test/libcomps/libcomps-devel/test_libcomps-devel_function_parse_comps.sh deleted file mode 100644 index 1d4f9c69b4b..00000000000 --- a/testcases/function_test/pkg_test/libcomps/libcomps-devel/test_libcomps-devel_function_parse_comps.sh +++ /dev/null @@ -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-01-30 -# @License : Mulan PSL v2 -# @Desc : 测试使用 libcomps 库解析 comps.xml 文件的基本功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试libcomps库解析comps.xml文件的基本功能" - - # 检查libcomps-devel软件包是否已安装 - LOG_INFO "检查libcomps-devel软件包是否已安装" - rpm -q libcomps-devel > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "libcomps-devel已安装,脚本结束后将保持安装状态" - INSTALLED="yes" - else - LOG_INFO "libcomps-devel未安装,将在测试过程中安装并在结束后卸载" - INSTALLED="no" - fi - - # 检查yum源中是否有libcomps-devel软件包 - LOG_INFO "检查yum源中是否有libcomps-devel软件包" - dnf list available libcomps-devel > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中没有libcomps-devel软件包" - exit 255 - fi - - # 如果未安装,则安装libcomps-devel软件包 - if [ "$INSTALLED" = "no" ]; then - LOG_INFO "安装libcomps-devel软件包" - dnf install -y libcomps-devel - CHECK_RESULT $? 0 0 "安装libcomps-devel失败" - fi - - # 检查comps.xml文件是否存在 - LOG_INFO "检查comps.xml文件是否存在" - if [ ! -f /usr/share/comps/comps.xml ]; then - LOG_ERROR "comps.xml文件不存在" - if [ "$INSTALLED" = "no" ]; then - LOG_INFO "卸载libcomps-devel软件包" - dnf remove -y libcomps-devel - fi - exit 1 - fi - - # 使用libcomps库解析comps.xml文件 - LOG_INFO "使用libcomps库解析comps.xml文件" - python3 -c " - import libcomps - try: - comps = libcomps.Comps() - comps.fromxml_f("/usr/share/comps/comps.xml") - print("解析成功") - except Exception as e: - print("解析失败:", e) - exit(1) - " - CHECK_RESULT $? 0 0 "解析comps.xml文件失败" - - # 清理环境:如果脚本开始时未安装,则卸载libcomps-devel软件包 - if [ "$INSTALLED" = "no" ]; then - LOG_INFO "清理环境:卸载libcomps-devel软件包" - dnf remove -y libcomps-devel - CHECK_RESULT $? 0 0 "卸载libcomps-devel失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file From 72243c1c5a52d3fff7920fdfacf5559f40f5406d Mon Sep 17 00:00:00 2001 From: honghua Date: Thu, 16 Apr 2026 08:52:10 +0800 Subject: [PATCH 6/7] update testcase for testsuite python3-async-timeout --- .../python3-async-timeout.json | 24 ---- ...n3-async-timeout_function_basic_timeout.sh | 103 ------------------ ...t_python3-async-timeout_function_import.sh | 89 --------------- ..._python3-async-timeout_function_install.sh | 73 ------------- ...3-async-timeout_function_nested_timeout.sh | 95 ---------------- ...thon3-async-timeout_function_no_timeout.sh | 79 -------------- ...3-async-timeout_function_timeout_cancel.sh | 77 ------------- 7 files changed, 540 deletions(-) delete mode 100644 testcases/function_test/pkg_test/python-async-timeout/python3-async-timeout/test_python3-async-timeout_function_basic_timeout.sh delete mode 100644 testcases/function_test/pkg_test/python-async-timeout/python3-async-timeout/test_python3-async-timeout_function_import.sh delete mode 100644 testcases/function_test/pkg_test/python-async-timeout/python3-async-timeout/test_python3-async-timeout_function_install.sh delete mode 100644 testcases/function_test/pkg_test/python-async-timeout/python3-async-timeout/test_python3-async-timeout_function_nested_timeout.sh delete mode 100644 testcases/function_test/pkg_test/python-async-timeout/python3-async-timeout/test_python3-async-timeout_function_no_timeout.sh delete mode 100644 testcases/function_test/pkg_test/python-async-timeout/python3-async-timeout/test_python3-async-timeout_function_timeout_cancel.sh diff --git a/suite2cases/function_test/pkg_test/python-async-timeout/python3-async-timeout.json b/suite2cases/function_test/pkg_test/python-async-timeout/python3-async-timeout.json index 78df721fd40..e80ab09f4de 100644 --- a/suite2cases/function_test/pkg_test/python-async-timeout/python3-async-timeout.json +++ b/suite2cases/function_test/pkg_test/python-async-timeout/python3-async-timeout.json @@ -6,33 +6,9 @@ "name": "test_python3-async-timeout_function_timeout", "desc": "Test timeout functionality" }, - { - "name": "test_python3-async-timeout_function_install", - "desc": "Test package installation" - }, { "name": "test_python3-async-timeout_function_uninstall", "desc": "Test package removal" - }, - { - "name": "test_python3-async-timeout_function_basic_timeout", - "desc": "Test basic timeout usage" - }, - { - "name": "test_python3-async-timeout_function_nested_timeout", - "desc": "Test nested timeout context" - }, - { - "name": "test_python3-async-timeout_function_timeout_cancel", - "desc": "Test cancel timeout" - }, - { - "name": "test_python3-async-timeout_function_no_timeout", - "desc": "Test operation without timeout" - }, - { - "name": "test_python3-async-timeout_function_import", - "desc": "Test module import" } ] } \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-async-timeout/python3-async-timeout/test_python3-async-timeout_function_basic_timeout.sh b/testcases/function_test/pkg_test/python-async-timeout/python3-async-timeout/test_python3-async-timeout_function_basic_timeout.sh deleted file mode 100644 index 56a88f34008..00000000000 --- a/testcases/function_test/pkg_test/python-async-timeout/python3-async-timeout/test_python3-async-timeout_function_basic_timeout.sh +++ /dev/null @@ -1,103 +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-10 -# @License : Mulan PSL v2 -# @Desc : Test basic timeout usage -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断是否已安装python3-async-timeout - LOG_INFO "检查是否已安装python3-async-timeout" - rpm -q python3-async-timeout > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "python3-async-timeout已安装,脚本结束时保持安装状态" - INSTALLED_BEFORE=1 - else - LOG_INFO "python3-async-timeout未安装,将在测试前安装并在测试后卸载" - INSTALLED_BEFORE=0 - fi - - # 检查yum源中是否有python3-async-timeout包 - LOG_INFO "检查yum源中是否有python3-async-timeout包" - dnf list available python3-async-timeout > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到python3-async-timeout包" - exit 255 - fi - - # 如果未安装,则安装python3-async-timeout - if [ $INSTALLED_BEFORE -eq 0 ]; then - LOG_INFO "安装python3-async-timeout" - dnf install -y python3-async-timeout - CHECK_RESULT $? 0 0 "安装python3-async-timeout失败" - fi - - # 测试基本超时用法 - LOG_INFO "测试基本超时用法:创建测试脚本test_timeout.py" - cat > test_timeout.py << "EOF" - import asyncio - from async_timeout import timeout - - async def test_basic_timeout(): - try: - async with timeout(0.1): - await asyncio.sleep(1) - print("ERROR: Timeout not raised") - return 1 - except asyncio.TimeoutError: - print("SUCCESS: Timeout raised as expected") - return 0 - - async def test_no_timeout(): - try: - async with timeout(1): - await asyncio.sleep(0.1) - print("SUCCESS: No timeout as expected") - return 0 - except asyncio.TimeoutError: - print("ERROR: Unexpected timeout") - return 1 - - async def main(): - result1 = await test_basic_timeout() - result2 = await test_no_timeout() - return result1 + result2 - - if __name__ == "__main__": - exit_code = asyncio.run(main()) - exit(exit_code) - EOF - - LOG_INFO "执行测试脚本" - python3 test_timeout.py - CHECK_RESULT $? 0 0 "基本超时功能测试失败" - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_timeout.py - - # 如果之前未安装,则卸载python3-async-timeout - if [ $INSTALLED_BEFORE -eq 0 ]; then - LOG_INFO "卸载python3-async-timeout" - dnf remove -y python3-async-timeout - CHECK_RESULT $? 0 0 "卸载python3-async-timeout失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-async-timeout/python3-async-timeout/test_python3-async-timeout_function_import.sh b/testcases/function_test/pkg_test/python-async-timeout/python3-async-timeout/test_python3-async-timeout_function_import.sh deleted file mode 100644 index 1efac0b378b..00000000000 --- a/testcases/function_test/pkg_test/python-async-timeout/python3-async-timeout/test_python3-async-timeout_function_import.sh +++ /dev/null @@ -1,89 +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-10 -# @License : Mulan PSL v2 -# @Desc : Test module import -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试模块导入功能 - LOG_INFO "开始测试python3-async-timeout模块导入功能" - - # 检查是否已安装python3-async-timeout - LOG_INFO "检查python3-async-timeout是否已安装" - rpm -q python3-async-timeout > /dev/null 2>&1 - already_installed=$? - - # 如果未安装,则安装软件包 - if [ $already_installed -ne 0 ]; then - LOG_INFO "python3-async-timeout未安装,开始安装" - - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否有python3-async-timeout软件包" - dnf list available python3-async-timeout > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中没有找到python3-async-timeout软件包" - exit 255 - fi - - # 安装软件包 - LOG_INFO "安装python3-async-timeout软件包" - dnf install -y python3-async-timeout - CHECK_RESULT $? 0 0 "安装python3-async-timeout失败" - else - LOG_INFO "python3-async-timeout已安装,跳过安装步骤" - fi - - # 测试模块导入功能 - LOG_INFO "测试python3-async-timeout模块导入" - python3 -c "import async_timeout" - CHECK_RESULT $? 0 0 "导入async_timeout模块失败" - - # 测试模块功能 - LOG_INFO "测试async_timeout模块基本功能" - python3 << "EOF" - import asyncio - import async_timeout - - async def test_timeout(): - try: - async with async_timeout.timeout(0.1): - await asyncio.sleep(1) - print("ERROR: Timeout should have occurred") - exit(1) - except asyncio.TimeoutError: - print("SUCCESS: Timeout occurred as expected") - exit(0) - - asyncio.run(test_timeout()) - EOF - CHECK_RESULT $? 0 0 "async_timeout模块功能测试失败" - - # 清理环境 - LOG_INFO "开始清理测试环境" - if [ $already_installed -ne 0 ]; then - LOG_INFO "卸载测试期间安装的python3-async-timeout软件包" - dnf remove -y python3-async-timeout - CHECK_RESULT $? 0 0 "卸载python3-async-timeout失败" - else - LOG_INFO "测试前已安装python3-async-timeout,保持安装状态" - fi - - LOG_INFO "python3-async-timeout模块导入测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-async-timeout/python3-async-timeout/test_python3-async-timeout_function_install.sh b/testcases/function_test/pkg_test/python-async-timeout/python3-async-timeout/test_python3-async-timeout_function_install.sh deleted file mode 100644 index d759923aed7..00000000000 --- a/testcases/function_test/pkg_test/python-async-timeout/python3-async-timeout/test_python3-async-timeout_function_install.sh +++ /dev/null @@ -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-10 -# @License : Mulan PSL v2 -# @Desc : Test package installation -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装python3-async-timeout - LOG_INFO "检查是否已安装python3-async-timeout" - rpm -q python3-async-timeout > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "python3-async-timeout 已安装" - INSTALLED=1 - else - LOG_INFO "python3-async-timeout 未安装" - INSTALLED=0 - fi - - # 检查yum源中是否有python3-async-timeout包 - LOG_INFO "检查yum源中是否有python3-async-timeout包" - dnf list available python3-async-timeout > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中没有python3-async-timeout包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "开始安装python3-async-timeout" - dnf install -y python3-async-timeout - CHECK_RESULT $? 0 0 "安装python3-async-timeout失败" - LOG_INFO "python3-async-timeout 安装成功" - fi - - # 验证软件包安装 - LOG_INFO "验证python3-async-timeout安装" - rpm -q python3-async-timeout > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "python3-async-timeout未正确安装" - - # 测试软件包功能 - LOG_INFO "测试python3-async-timeout功能" - python3 -c "import asyncio; import async_timeout; print("async_timeout module imported successfully")" > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "python3-async-timeout功能测试失败" - - # 清理环境:如果脚本开始时未安装,则在结束时卸载 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "清理环境:卸载python3-async-timeout" - dnf remove -y python3-async-timeout - CHECK_RESULT $? 0 0 "卸载python3-async-timeout失败" - LOG_INFO "环境已恢复到初始状态" - else - LOG_INFO "保持python3-async-timeout安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-async-timeout/python3-async-timeout/test_python3-async-timeout_function_nested_timeout.sh b/testcases/function_test/pkg_test/python-async-timeout/python3-async-timeout/test_python3-async-timeout_function_nested_timeout.sh deleted file mode 100644 index edb52020214..00000000000 --- a/testcases/function_test/pkg_test/python-async-timeout/python3-async-timeout/test_python3-async-timeout_function_nested_timeout.sh +++ /dev/null @@ -1,95 +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-10 -# @License : Mulan PSL v2 -# @Desc : Test nested timeout context -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:Test nested timeout context" - - # 检查是否已安装python3-async-timeout包 - LOG_INFO "检查python3-async-timeout是否已安装" - rpm -q python3-async-timeout >/dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "python3-async-timeout已安装,测试后保持安装状态" - INSTALLED=1 - else - LOG_INFO "python3-async-timeout未安装,将在测试后卸载" - INSTALLED=0 - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否有python3-async-timeout" - dnf list available python3-async-timeout >/dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到python3-async-timeout包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装python3-async-timeout" - dnf install -y python3-async-timeout - CHECK_RESULT $? 0 0 "安装python3-async-timeout失败" - fi - - # 测试嵌套超时上下文 - LOG_INFO "测试嵌套超时上下文功能" - python3 -c " - import asyncio - import async_timeout - - async def nested_timeout_test(): - try: - async with async_timeout.timeout(1): - try: - async with async_timeout.timeout(0.5): - await asyncio.sleep(0.6) - except asyncio.TimeoutError: - print("内层超时触发成功") - return True - print("内层超时未触发") - return False - except asyncio.TimeoutError: - print("外层超时触发") - return False - - asyncio.run(nested_timeout_test()) - " > /tmp/nested_timeout_result.txt 2>&1 - - CHECK_RESULT $? 0 0 "执行嵌套超时测试失败" - - # 检查测试结果 - LOG_INFO "检查嵌套超时测试结果" - grep -q "内层超时触发成功" /tmp/nested_timeout_result.txt - CHECK_RESULT $? 0 0 "嵌套超时测试未达到预期效果" - - # 清理临时文件 - rm -f /tmp/nested_timeout_result.txt - - # 如果测试前未安装,则卸载软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载python3-async-timeout" - dnf remove -y python3-async-timeout - CHECK_RESULT $? 0 0 "卸载python3-async-timeout失败" - fi - - LOG_INFO "测试完成:Test nested timeout context" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-async-timeout/python3-async-timeout/test_python3-async-timeout_function_no_timeout.sh b/testcases/function_test/pkg_test/python-async-timeout/python3-async-timeout/test_python3-async-timeout_function_no_timeout.sh deleted file mode 100644 index d79ce65f7f6..00000000000 --- a/testcases/function_test/pkg_test/python-async-timeout/python3-async-timeout/test_python3-async-timeout_function_no_timeout.sh +++ /dev/null @@ -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-03-10 -# @License : Mulan PSL v2 -# @Desc : Test operation without timeout -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装python3-async-timeout - LOG_INFO "检查是否已安装python3-async-timeout" - if dnf list installed python3-async-timeout &>/dev/null; then - LOG_INFO "python3-async-timeout已安装,测试结束后保持安装状态" - INSTALLED_FLAG=1 - else - LOG_INFO "python3-async-timeout未安装,将在测试前安装" - INSTALLED_FLAG=0 - fi - - # 检查yum源中是否存在python3-async-timeout - LOG_INFO "检查yum源中是否存在python3-async-timeout" - if ! dnf list available python3-async-timeout &>/dev/null; then - LOG_ERROR "yum源中未找到python3-async-timeout软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ ${INSTALLED_FLAG} -eq 0 ]; then - LOG_INFO "安装python3-async-timeout软件包" - dnf install -y python3-async-timeout - CHECK_RESULT $? 0 0 "安装python3-async-timeout失败" - fi - - # 测试无超时操作 - LOG_INFO "测试无超时操作" - python3 -c " - import asyncio - import async_timeout - - async def test_no_timeout(): - try: - async with async_timeout.timeout(None) as cm: - await asyncio.sleep(0.1) - print("操作完成,未触发超时") - except asyncio.TimeoutError: - print("错误:不应触发超时") - exit(1) - - asyncio.run(test_no_timeout()) - " - CHECK_RESULT $? 0 0 "无超时操作测试失败" - - # 清理环境 - LOG_INFO "清理测试环境" - if [ ${INSTALLED_FLAG} -eq 0 ]; then - LOG_INFO "卸载python3-async-timeout软件包" - dnf remove -y python3-async-timeout - CHECK_RESULT $? 0 0 "卸载python3-async-timeout失败" - else - LOG_INFO "保持python3-async-timeout安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/python-async-timeout/python3-async-timeout/test_python3-async-timeout_function_timeout_cancel.sh b/testcases/function_test/pkg_test/python-async-timeout/python3-async-timeout/test_python3-async-timeout_function_timeout_cancel.sh deleted file mode 100644 index 47cd40d381a..00000000000 --- a/testcases/function_test/pkg_test/python-async-timeout/python3-async-timeout/test_python3-async-timeout_function_timeout_cancel.sh +++ /dev/null @@ -1,77 +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-10 -# @License : Mulan PSL v2 -# @Desc : Test cancel timeout -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:Test cancel timeout" - - LOG_INFO "步骤1:检查环境是否已安装python3-async-timeout" - if dnf list installed python3-async-timeout &>/dev/null; then - LOG_INFO "python3-async-timeout已安装,测试后保持安装状态" - INSTALLED=true - else - LOG_INFO "python3-async-timeout未安装,测试前安装" - INSTALLED=false - fi - - LOG_INFO "步骤2:检查yum源中是否有python3-async-timeout软件包" - if ! dnf list available python3-async-timeout &>/dev/null; then - LOG_ERROR "yum源中未找到python3-async-timeout软件包" - exit 255 - fi - - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤3:安装python3-async-timeout软件包" - dnf install -y python3-async-timeout - CHECK_RESULT $? 0 0 "安装python3-async-timeout失败" - fi - - LOG_INFO "步骤4:检查timeout命令是否存在" - if ! command -v timeout &>/dev/null; then - LOG_ERROR "timeout命令不存在" - exit 255 - fi - - LOG_INFO "步骤5:检查timeout命令是否支持-cancel选项" - if ! timeout --help 2>&1 | grep -q "\-cancel"; then - LOG_ERROR "timeout命令不支持-cancel选项" - exit 255 - fi - - LOG_INFO "步骤6:执行测试命令,测试cancel timeout功能" - timeout --cancel=5 10 sleep 20 & - PID=$! - sleep 2 - kill -SIGINT $PID - wait $PID - EXIT_CODE=$? - CHECK_RESULT $EXIT_CODE 124 0 "cancel timeout功能测试失败" - - LOG_INFO "步骤7:清理环境" - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载python3-async-timeout软件包" - dnf remove -y python3-async-timeout - CHECK_RESULT $? 0 0 "卸载python3-async-timeout失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file From 4c6ac9aa844d5cf7f7815bbaf04e5ede4bff1b71 Mon Sep 17 00:00:00 2001 From: honghua Date: Thu, 16 Apr 2026 08:52:19 +0800 Subject: [PATCH 7/7] update testcase for testsuite mingw32-filesystem --- .../mingw-filesystem/mingw32-filesystem.json | 580 ------------------ ...ngw32-filesystem_function_basic_compile.sh | 97 --- ...ngw32-filesystem_function_cmake_project.sh | 76 --- ...2-filesystem_function_configure_project.sh | 77 --- .../test_mingw32-filesystem_function_lib.sh | 65 -- ...32-filesystem_function_pkg_config_query.sh | 70 --- ...ingw32-filesystem_mingw32-cmake_--build.sh | 119 ---- ...2-filesystem_mingw32-cmake_--debug-find.sh | 56 -- ...ingw32-filesystem_mingw32-cmake_--fresh.sh | 70 --- ...w32-filesystem_mingw32-cmake_--graphviz.sh | 80 --- ...32-filesystem_mingw32-cmake_--help-full.sh | 85 --- ...mingw32-filesystem_mingw32-cmake_--help.sh | 67 -- ...gw32-filesystem_mingw32-cmake_--install.sh | 133 ---- ...32-filesystem_mingw32-cmake_--log-level.sh | 101 --- ...mingw32-filesystem_mingw32-cmake_--open.sh | 174 ------ ...ngw32-filesystem_mingw32-cmake_--preset.sh | 73 --- ...32-filesystem_mingw32-cmake_--toolchain.sh | 79 --- ...ingw32-filesystem_mingw32-cmake_--trace.sh | 94 --- ...gw32-filesystem_mingw32-cmake_--version.sh | 73 --- ...est_mingw32-filesystem_mingw32-cmake_-A.sh | 81 --- ...est_mingw32-filesystem_mingw32-cmake_-B.sh | 78 --- ...est_mingw32-filesystem_mingw32-cmake_-C.sh | 81 --- ...est_mingw32-filesystem_mingw32-cmake_-D.sh | 83 --- ...est_mingw32-filesystem_mingw32-cmake_-E.sh | 70 --- ...est_mingw32-filesystem_mingw32-cmake_-G.sh | 86 --- ...est_mingw32-filesystem_mingw32-cmake_-L.sh | 93 --- ...est_mingw32-filesystem_mingw32-cmake_-N.sh | 91 --- ...est_mingw32-filesystem_mingw32-cmake_-P.sh | 68 -- ...est_mingw32-filesystem_mingw32-cmake_-S.sh | 67 -- ...est_mingw32-filesystem_mingw32-cmake_-T.sh | 76 --- ...est_mingw32-filesystem_mingw32-cmake_-U.sh | 111 ---- ...2-filesystem_mingw32-cmake_-Wdeprecated.sh | 59 -- ..._mingw32-filesystem_mingw32-cmake_-Wdev.sh | 77 --- ...32-filesystem_mingw32-cmake_-Werror_dev.sh | 89 --- ...ngw32-filesystem_mingw32-cmake_-Wno-dev.sh | 93 --- ...est_mingw32-filesystem_mingw32-cmake_-h.sh | 70 --- ...ingw32-filesystem_mingw32-cmake_default.sh | 66 -- ...gw32-filesystem_mingw32-configure_build.sh | 91 --- ...mingw32-filesystem_mingw32-configure_cc.sh | 81 --- ...w32-filesystem_mingw32-configure_cflags.sh | 99 --- ...ingw32-filesystem_mingw32-configure_cxx.sh | 141 ----- ...2-filesystem_mingw32-configure_cxxflags.sh | 77 --- ...32-filesystem_mingw32-configure_default.sh | 66 -- ...ngw32-filesystem_mingw32-configure_help.sh | 87 --- ...ngw32-filesystem_mingw32-configure_host.sh | 63 -- ...32-filesystem_mingw32-configure_ldflags.sh | 93 --- ...w32-filesystem_mingw32-configure_prefix.sh | 89 --- ...w32-filesystem_mingw32-configure_target.sh | 72 --- ...32-filesystem_mingw32-configure_version.sh | 69 --- ...test_mingw32-filesystem_mingw32-make__d.sh | 58 -- ...test_mingw32-filesystem_mingw32-make__e.sh | 64 -- ...test_mingw32-filesystem_mingw32-make__f.sh | 57 -- ...test_mingw32-filesystem_mingw32-make__h.sh | 61 -- ...test_mingw32-filesystem_mingw32-make__i.sh | 73 --- ...test_mingw32-filesystem_mingw32-make__j.sh | 63 -- ...ingw32-filesystem_mingw32-make__j_num_n.sh | 62 -- ...test_mingw32-filesystem_mingw32-make__k.sh | 77 --- ...test_mingw32-filesystem_mingw32-make__l.sh | 76 --- ...test_mingw32-filesystem_mingw32-make__n.sh | 66 -- ...test_mingw32-filesystem_mingw32-make__o.sh | 105 ---- ...test_mingw32-filesystem_mingw32-make__p.sh | 73 --- ...test_mingw32-filesystem_mingw32-make__q.sh | 64 -- ...test_mingw32-filesystem_mingw32-make__r.sh | 72 --- ...test_mingw32-filesystem_mingw32-make__s.sh | 72 --- ...test_mingw32-filesystem_mingw32-make__t.sh | 97 --- ...ingw32-filesystem_mingw32-make__upper_b.sh | 59 -- ...ingw32-filesystem_mingw32-make__upper_c.sh | 75 --- ...ingw32-filesystem_mingw32-make__upper_e.sh | 70 --- ...ingw32-filesystem_mingw32-make__upper_i.sh | 60 -- ...ingw32-filesystem_mingw32-make__upper_l.sh | 68 -- ...ingw32-filesystem_mingw32-make__upper_o.sh | 63 -- ...ingw32-filesystem_mingw32-make__upper_r.sh | 74 --- ...ingw32-filesystem_mingw32-make__upper_s.sh | 99 --- ...ingw32-filesystem_mingw32-make__upper_w.sh | 66 -- ...test_mingw32-filesystem_mingw32-make__v.sh | 66 -- ...test_mingw32-filesystem_mingw32-make__w.sh | 120 ---- ...est_mingw32-filesystem_mingw32-meson__v.sh | 59 -- ..._mingw32-filesystem_mingw32-meson_build.sh | 142 ----- ...gw32-filesystem_mingw32-meson_configure.sh | 79 --- ...t_mingw32-filesystem_mingw32-meson_help.sh | 101 --- ...ingw32-filesystem_mingw32-meson_install.sh | 75 --- ..._mingw32-filesystem_mingw32-meson_setup.sh | 68 -- ...t_mingw32-filesystem_mingw32-meson_test.sh | 73 --- ...ingw32-filesystem_mingw32-meson_version.sh | 74 --- ...ngw32-filesystem_mingw32-pkg-config__at.sh | 78 --- ...2-filesystem_mingw32-pkg-config__cflags.sh | 76 --- ...2-filesystem_mingw32-pkg-config__exists.sh | 86 --- ...ingw32-filesystem_mingw32-pkg-config__h.sh | 87 --- ...w32-filesystem_mingw32-pkg-config__libs.sh | 82 --- ...ingw32-filesystem_mingw32-pkg-config__v.sh | 62 -- ...mingw32-filesystem_mingw32-pkg-config_v.sh | 66 -- 91 files changed, 7804 deletions(-) delete mode 100644 testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_function_basic_compile.sh delete mode 100644 testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_function_cmake_project.sh delete mode 100644 testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_function_configure_project.sh delete mode 100644 testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_function_lib.sh delete mode 100644 testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_function_pkg_config_query.sh delete mode 100644 testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_--build.sh delete mode 100644 testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_--debug-find.sh delete mode 100644 testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_--fresh.sh delete mode 100644 testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_--graphviz.sh delete mode 100644 testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_--help-full.sh delete mode 100644 testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_--help.sh delete mode 100644 testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_--install.sh delete mode 100644 testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_--log-level.sh delete mode 100644 testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_--open.sh delete mode 100644 testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_--preset.sh delete mode 100644 testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_--toolchain.sh delete mode 100644 testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_--trace.sh delete mode 100644 testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_--version.sh delete mode 100644 testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_-A.sh delete mode 100644 testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_-B.sh delete mode 100644 testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_-C.sh delete mode 100644 testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_-D.sh delete mode 100644 testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_-E.sh delete mode 100644 testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_-G.sh delete mode 100644 testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_-L.sh delete mode 100644 testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_-N.sh delete mode 100644 testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_-P.sh delete mode 100644 testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_-S.sh delete mode 100644 testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_-T.sh delete mode 100644 testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_-U.sh delete mode 100644 testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_-Wdeprecated.sh delete mode 100644 testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_-Wdev.sh delete mode 100644 testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_-Werror_dev.sh delete mode 100644 testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_-Wno-dev.sh delete mode 100644 testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_-h.sh delete mode 100644 testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_default.sh delete mode 100644 testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-configure_build.sh delete mode 100644 testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-configure_cc.sh delete mode 100644 testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-configure_cflags.sh delete mode 100644 testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-configure_cxx.sh delete mode 100644 testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-configure_cxxflags.sh delete mode 100644 testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-configure_default.sh delete mode 100644 testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-configure_help.sh delete mode 100644 testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-configure_host.sh delete mode 100644 testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-configure_ldflags.sh delete mode 100644 testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-configure_prefix.sh delete mode 100644 testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-configure_target.sh delete mode 100644 testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-configure_version.sh delete mode 100644 testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-make__d.sh delete mode 100644 testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-make__e.sh delete mode 100644 testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-make__f.sh delete mode 100644 testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-make__h.sh delete mode 100644 testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-make__i.sh delete mode 100644 testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-make__j.sh delete mode 100644 testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-make__j_num_n.sh delete mode 100644 testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-make__k.sh delete mode 100644 testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-make__l.sh delete mode 100644 testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-make__n.sh delete mode 100644 testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-make__o.sh delete mode 100644 testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-make__p.sh delete mode 100644 testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-make__q.sh delete mode 100644 testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-make__r.sh delete mode 100644 testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-make__s.sh delete mode 100644 testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-make__t.sh delete mode 100644 testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-make__upper_b.sh delete mode 100644 testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-make__upper_c.sh delete mode 100644 testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-make__upper_e.sh delete mode 100644 testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-make__upper_i.sh delete mode 100644 testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-make__upper_l.sh delete mode 100644 testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-make__upper_o.sh delete mode 100644 testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-make__upper_r.sh delete mode 100644 testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-make__upper_s.sh delete mode 100644 testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-make__upper_w.sh delete mode 100644 testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-make__v.sh delete mode 100644 testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-make__w.sh delete mode 100644 testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-meson__v.sh delete mode 100644 testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-meson_build.sh delete mode 100644 testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-meson_configure.sh delete mode 100644 testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-meson_help.sh delete mode 100644 testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-meson_install.sh delete mode 100644 testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-meson_setup.sh delete mode 100644 testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-meson_test.sh delete mode 100644 testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-meson_version.sh delete mode 100644 testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-pkg-config__at.sh delete mode 100644 testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-pkg-config__cflags.sh delete mode 100644 testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-pkg-config__exists.sh delete mode 100644 testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-pkg-config__h.sh delete mode 100644 testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-pkg-config__libs.sh delete mode 100644 testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-pkg-config__v.sh delete mode 100644 testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-pkg-config_v.sh diff --git a/suite2cases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem.json b/suite2cases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem.json index c54f9efc7bd..9896b2f853d 100644 --- a/suite2cases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem.json +++ b/suite2cases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem.json @@ -2,578 +2,14 @@ "path": "$OET_PATH/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem", "machine num": 1, "cases": [ - { - "name": "test_mingw32-filesystem_mingw32-cmake_default", - "desc": "测试 mingw32-cmake 命令的默认行为" - }, - { - "name": "test_mingw32-filesystem_mingw32-configure_default", - "desc": "测试 mingw32-configure 命令的默认行为" - }, - { - "name": "test_mingw32-filesystem_mingw32-make__upper_b", - "desc": "测试 mingw32-make 的 -B 参数,无条件构建所有目标" - }, - { - "name": "test_mingw32-filesystem_mingw32-make__upper_c", - "desc": "测试 mingw32-make 的 -C 参数,指定目录后执行构建" - }, - { - "name": "test_mingw32-filesystem_mingw32-make__d", - "desc": "测试 mingw32-make 的 -d 参数,打印调试信息" - }, - { - "name": "test_mingw32-filesystem_mingw32-make__e", - "desc": "测试 mingw32-make 的 -e 参数,环境变量覆盖 makefile" - }, - { - "name": "test_mingw32-filesystem_mingw32-make__f", - "desc": "测试 mingw32-make 的 -f 参数,指定 makefile 文件" - }, - { - "name": "test_mingw32-filesystem_mingw32-make__h", - "desc": "测试 mingw32-make 的 -h 参数,打印帮助信息" - }, - { - "name": "test_mingw32-filesystem_mingw32-make__i", - "desc": "测试 mingw32-make 的 -i 参数,忽略错误继续执行" - }, - { - "name": "test_mingw32-filesystem_mingw32-make__j_num_n", - "desc": "测试 mingw32-make 的 -j N 参数,指定并行任务数" - }, - { - "name": "test_mingw32-filesystem_mingw32-make__k", - "desc": "测试 mingw32-make 的 -k 参数,即使有错误也继续执行目标构建" - }, - { - "name": "test_mingw32-filesystem_mingw32-make__n", - "desc": "测试 mingw32-make 的 -n 参数,仅打印命令不实际执行" - }, - { - "name": "test_mingw32-filesystem_mingw32-meson__v", - "desc": "测试 mingw32-meson 命令的 -v 参数" - }, - { - "name": "test_mingw32-filesystem_mingw32-pkg-config_v", - "desc": "测试 mingw32-pkg-config 的 -v 参数" - }, - { - "name": "test_mingw32-filesystem_function_lib", - "desc": "测试基础依赖库的功能" - }, - { - "name": "test_mingw32-filesystem_mingw32-make__upper_e", - "desc": "测试将字符串作为makefile语句执行" - }, - { - "name": "test_mingw32-filesystem_mingw32-make__upper_i", - "desc": "测试包含目录" - }, - { - "name": "test_mingw32-filesystem_mingw32-make__j", - "desc": "测试并行作业" - }, - { - "name": "test_mingw32-filesystem_mingw32-make__l", - "desc": "测试负载限制" - }, - { - "name": "test_mingw32-filesystem_mingw32-make__upper_l", - "desc": "测试检查符号链接时间" - }, - { - "name": "test_mingw32-filesystem_mingw32-make__o", - "desc": "测试将文件视为旧文件" - }, - { - "name": "test_mingw32-filesystem_mingw32-pkg-config__v", - "desc": "测试 mingw32-pkg-config 的 -v 参数,用于显示版本信息" - }, { "name": "test_mingw32-filesystem_function_lib_basic", "desc": "测试基础依赖库的基本功能" }, - { - "name": "test_mingw32-filesystem_mingw32-cmake_-S", - "desc": "测试指定源目录参数" - }, - { - "name": "test_mingw32-filesystem_mingw32-cmake_-B", - "desc": "测试指定构建目录参数" - }, - { - "name": "test_mingw32-filesystem_mingw32-cmake_-C", - "desc": "测试预加载缓存脚本参数" - }, - { - "name": "test_mingw32-filesystem_mingw32-cmake_-D", - "desc": "测试创建或更新CMake缓存条目参数" - }, - { - "name": "test_mingw32-filesystem_mingw32-cmake_-U", - "desc": "测试从CMake缓存中移除匹配条目参数" - }, - { - "name": "test_mingw32-filesystem_mingw32-cmake_-G", - "desc": "测试指定构建系统生成器参数" - }, - { - "name": "test_mingw32-filesystem_mingw32-cmake_-T", - "desc": "测试指定工具集名称参数" - }, - { - "name": "test_mingw32-filesystem_mingw32-cmake_-A", - "desc": "测试指定平台名称参数" - }, - { - "name": "test_mingw32-filesystem_mingw32-cmake_--toolchain", - "desc": "测试指定工具链文件参数" - }, - { - "name": "test_mingw32-filesystem_mingw32-cmake_--install-prefix", - "desc": "测试指定安装目录参数" - }, - { - "name": "test_mingw32-filesystem_mingw32-cmake_-Wdev", - "desc": "测试启用开发者警告参数" - }, - { - "name": "test_mingw32-filesystem_mingw32-cmake_-Wno-dev", - "desc": "测试抑制开发者警告参数" - }, - { - "name": "test_mingw32-filesystem_mingw32-cmake_-Werror_dev", - "desc": "测试使开发者警告成为错误参数" - }, - { - "name": "test_mingw32-filesystem_mingw32-cmake_-Wno-error_dev", - "desc": "测试使开发者警告不为错误参数" - }, - { - "name": "test_mingw32-filesystem_mingw32-cmake_-Wdeprecated", - "desc": "测试启用废弃警告参数" - }, - { - "name": "test_mingw32-filesystem_mingw32-cmake_-Wno-deprecated", - "desc": "测试抑制废弃警告参数" - }, - { - "name": "test_mingw32-filesystem_mingw32-cmake_-Werror_deprecated", - "desc": "测试使废弃宏和函数警告成为错误参数" - }, - { - "name": "test_mingw32-filesystem_mingw32-cmake_-Wno-error_deprecated", - "desc": "测试使废弃宏和函数警告不为错误参数" - }, - { - "name": "test_mingw32-filesystem_mingw32-cmake_--preset", - "desc": "测试指定配置预设参数" - }, - { - "name": "test_mingw32-filesystem_mingw32-cmake_--list-presets", - "desc": "测试列出可用预设参数" - }, - { - "name": "test_mingw32-filesystem_mingw32-cmake_-E", - "desc": "测试CMake命令模式参数" - }, - { - "name": "test_mingw32-filesystem_mingw32-cmake_-L", - "desc": "测试列出非高级缓存变量参数" - }, - { - "name": "test_mingw32-filesystem_mingw32-cmake_--fresh", - "desc": "测试配置全新构建树参数" - }, - { - "name": "test_mingw32-filesystem_mingw32-cmake_--build", - "desc": "测试构建CMake生成的项目二进制树参数" - }, - { - "name": "test_mingw32-filesystem_mingw32-cmake_--install", - "desc": "测试安装CMake生成的项目二进制树参数" - }, - { - "name": "test_mingw32-filesystem_mingw32-cmake_--open", - "desc": "测试在关联应用中打开生成的项目参数" - }, - { - "name": "test_mingw32-filesystem_mingw32-cmake_-N", - "desc": "测试仅查看模式参数" - }, - { - "name": "test_mingw32-filesystem_mingw32-cmake_-P", - "desc": "测试处理脚本模式参数" - }, - { - "name": "test_mingw32-filesystem_mingw32-cmake_--find-package", - "desc": "测试遗留的pkg-config类似模式参数" - }, - { - "name": "test_mingw32-filesystem_mingw32-cmake_--graphviz", - "desc": "测试生成依赖关系图参数" - }, - { - "name": "test_mingw32-filesystem_mingw32-cmake_--system-information", - "desc": "测试转储系统信息参数" - }, - { - "name": "test_mingw32-filesystem_mingw32-cmake_--log-level", - "desc": "测试设置CMake文件消息详细级别参数" - }, - { - "name": "test_mingw32-filesystem_mingw32-cmake_--log-context", - "desc": "测试为日志消息添加上下文参数" - }, - { - "name": "test_mingw32-filesystem_mingw32-cmake_--debug-trycompile", - "desc": "测试不删除try_compile构建树参数" - }, - { - "name": "test_mingw32-filesystem_mingw32-cmake_--debug-output", - "desc": "测试启用CMake调试模式参数" - }, - { - "name": "test_mingw32-filesystem_mingw32-cmake_--debug-find", - "desc": "测试启用CMake查找调试模式参数" - }, - { - "name": "test_mingw32-filesystem_mingw32-cmake_--debug-find-pkg", - "desc": "测试限制CMake调试查找至指定包参数" - }, - { - "name": "test_mingw32-filesystem_mingw32-cmake_--debug-find-var", - "desc": "测试限制CMake调试查找至指定结果变量参数" - }, - { - "name": "test_mingw32-filesystem_mingw32-cmake_--trace", - "desc": "测试启用CMake跟踪模式参数" - }, - { - "name": "test_mingw32-filesystem_mingw32-cmake_--trace-expand", - "desc": "测试启用带变量扩展的CMake跟踪模式参数" - }, - { - "name": "test_mingw32-filesystem_mingw32-cmake_--trace-format", - "desc": "测试设置跟踪输出格式参数" - }, - { - "name": "test_mingw32-filesystem_mingw32-cmake_--trace-source", - "desc": "测试仅跟踪指定CMake文件参数" - }, - { - "name": "test_mingw32-filesystem_mingw32-cmake_--trace-redirect", - "desc": "测试重定向跟踪输出到文件参数" - }, - { - "name": "test_mingw32-filesystem_mingw32-cmake_--warn-uninitialized", - "desc": "测试警告未初始化值参数" - }, - { - "name": "test_mingw32-filesystem_mingw32-cmake_--no-warn-unused-cli", - "desc": "测试不警告未使用的命令行选项参数" - }, - { - "name": "test_mingw32-filesystem_mingw32-cmake_--check-system-vars", - "desc": "测试检查系统文件中变量使用问题参数" - }, - { - "name": "test_mingw32-filesystem_mingw32-cmake_--compile-no-warning-as-error", - "desc": "测试忽略编译警告作为错误参数" - }, - { - "name": "test_mingw32-filesystem_mingw32-cmake_--profiling-format", - "desc": "测试输出CMake脚本性能分析数据格式参数" - }, - { - "name": "test_mingw32-filesystem_mingw32-cmake_--profiling-output", - "desc": "测试选择性能分析数据输出路径参数" - }, - { - "name": "test_mingw32-filesystem_mingw32-cmake_-h", - "desc": "测试打印使用信息并退出参数" - }, - { - "name": "test_mingw32-filesystem_mingw32-cmake_--help", - "desc": "测试打印使用信息并退出参数" - }, - { - "name": "test_mingw32-filesystem_mingw32-cmake_--version", - "desc": "测试打印版本号并退出参数" - }, - { - "name": "test_mingw32-filesystem_mingw32-cmake_--help-full", - "desc": "测试打印所有帮助手册并退出参数" - }, - { - "name": "test_mingw32-filesystem_mingw32-cmake_--help-manual", - "desc": "测试打印一个帮助手册并退出参数" - }, - { - "name": "test_mingw32-filesystem_mingw32-cmake_--help-manual-list", - "desc": "测试列出可用帮助手册并退出参数" - }, - { - "name": "test_mingw32-filesystem_mingw32-cmake_--help-command", - "desc": "测试打印一个命令的帮助并退出参数" - }, - { - "name": "test_mingw32-filesystem_mingw32-cmake_--help-command-list", - "desc": "测试列出有可用帮助的命令并退出参数" - }, - { - "name": "test_mingw32-filesystem_mingw32-cmake_--help-commands", - "desc": "测试打印cmake-commands手册并退出参数" - }, - { - "name": "test_mingw32-filesystem_mingw32-cmake_--help-module", - "desc": "测试打印一个模块的帮助并退出参数" - }, - { - "name": "test_mingw32-filesystem_mingw32-cmake_--help-module-list", - "desc": "测试列出有可用帮助的模块并退出参数" - }, - { - "name": "test_mingw32-filesystem_mingw32-cmake_--help-modules", - "desc": "测试打印cmake-modules手册并退出参数" - }, - { - "name": "test_mingw32-filesystem_mingw32-cmake_--help-policy", - "desc": "测试打印一个策略的帮助并退出参数" - }, - { - "name": "test_mingw32-filesystem_mingw32-cmake_--help-policy-list", - "desc": "测试列出有可用帮助的策略并退出参数" - }, - { - "name": "test_mingw32-filesystem_mingw32-cmake_--help-policies", - "desc": "测试打印cmake-policies手册并退出参数" - }, - { - "name": "test_mingw32-filesystem_mingw32-cmake_--help-property", - "desc": "测试打印一个属性的帮助并退出参数" - }, - { - "name": "test_mingw32-filesystem_mingw32-cmake_--help-property-list", - "desc": "测试列出有可用帮助的属性并退出参数" - }, - { - "name": "test_mingw32-filesystem_mingw32-cmake_--help-properties", - "desc": "测试打印cmake-properties手册并退出参数" - }, - { - "name": "test_mingw32-filesystem_mingw32-cmake_--help-variable", - "desc": "测试打印一个变量的帮助并退出参数" - }, - { - "name": "test_mingw32-filesystem_mingw32-cmake_--help-variable-list", - "desc": "测试列出有可用帮助的变量并退出参数" - }, - { - "name": "test_mingw32-filesystem_mingw32-cmake_--help-variables", - "desc": "测试打印cmake-variables手册并退出参数" - }, { "name": "test_mingw32-filesystem_mingw32-configure_no_args", "desc": "测试 mingw32-configure 命令在不提供任何参数时的行为" }, - { - "name": "test_mingw32-filesystem_mingw32-configure_help", - "desc": "测试 mingw32-configure 命令的 --help 参数以显示帮助信息" - }, - { - "name": "test_mingw32-filesystem_mingw32-configure_version", - "desc": "测试 mingw32-configure 命令的 --version 参数以显示版本信息" - }, - { - "name": "test_mingw32-filesystem_mingw32-configure_host", - "desc": "测试 mingw32-configure 命令的 --host 参数以指定目标主机" - }, - { - "name": "test_mingw32-filesystem_mingw32-configure_prefix", - "desc": "测试 mingw32-configure 命令的 --prefix 参数以指定安装目录" - }, - { - "name": "test_mingw32-filesystem_mingw32-configure_build", - "desc": "测试 mingw32-configure 命令的 --build 参数以指定构建系统" - }, - { - "name": "test_mingw32-filesystem_mingw32-configure_target", - "desc": "测试 mingw32-configure 命令的 --target 参数以指定目标系统" - }, - { - "name": "test_mingw32-filesystem_mingw32-configure_enable_shared", - "desc": "测试 mingw32-configure 命令的 --enable-shared 参数以启用共享库构建" - }, - { - "name": "test_mingw32-filesystem_mingw32-configure_enable_static", - "desc": "测试 mingw32-configure 命令的 --enable-static 参数以启用静态库构建" - }, - { - "name": "test_mingw32-filesystem_mingw32-configure_with_openssl", - "desc": "测试 mingw32-configure 命令的 --with-openssl 参数以指定 OpenSSL 库路径" - }, - { - "name": "test_mingw32-filesystem_mingw32-configure_without_openssl", - "desc": "测试 mingw32-configure 命令的 --without-openssl 参数以禁用 OpenSSL 支持" - }, - { - "name": "test_mingw32-filesystem_mingw32-configure_cc", - "desc": "测试 mingw32-configure 命令的 CC 环境变量或参数以指定 C 编译器" - }, - { - "name": "test_mingw32-filesystem_mingw32-configure_cxx", - "desc": "测试 mingw32-configure 命令的 CXX 环境变量或参数以指定 C++ 编译器" - }, - { - "name": "test_mingw32-filesystem_mingw32-configure_cflags", - "desc": "测试 mingw32-configure 命令的 CFLAGS 环境变量或参数以指定 C 编译器标志" - }, - { - "name": "test_mingw32-filesystem_mingw32-configure_cxxflags", - "desc": "测试 mingw32-configure 命令的 CXXFLAGS 环境变量或参数以指定 C++ 编译器标志" - }, - { - "name": "test_mingw32-filesystem_mingw32-configure_ldflags", - "desc": "测试 mingw32-configure 命令的 LDFLAGS 环境变量或参数以指定链接器标志" - }, - { - "name": "test_mingw32-filesystem_mingw32-make__upper_o", - "desc": "测试同步并行作业输出的选项" - }, - { - "name": "test_mingw32-filesystem_mingw32-make__p", - "desc": "测试打印make内部数据库的选项" - }, - { - "name": "test_mingw32-filesystem_mingw32-make__q", - "desc": "测试不运行配方仅检查目标是否最新的选项" - }, - { - "name": "test_mingw32-filesystem_mingw32-make__r", - "desc": "测试禁用内置隐式规则的选项" - }, - { - "name": "test_mingw32-filesystem_mingw32-make__upper_r", - "desc": "测试禁用内置变量设置的选项" - }, - { - "name": "test_mingw32-filesystem_mingw32-make__s", - "desc": "测试不回应配方的静默执行选项" - }, - { - "name": "test_mingw32-filesystem_mingw32-make__upper_s", - "desc": "测试关闭-k选项(停止继续执行)的选项" - }, - { - "name": "test_mingw32-filesystem_mingw32-make__t", - "desc": "测试触摸目标文件而非重新构建的选项" - }, - { - "name": "test_mingw32-filesystem_mingw32-make__v", - "desc": "测试打印make版本号并退出的选项" - }, - { - "name": "test_mingw32-filesystem_mingw32-make__w", - "desc": "测试打印当前目录的选项" - }, - { - "name": "test_mingw32-filesystem_mingw32-make__upper_w", - "desc": "测试将文件视为无限新的选项" - }, - { - "name": "test_mingw32-filesystem_mingw32-meson_help", - "desc": "测试 mingw32-meson 命令的帮助信息" - }, - { - "name": "test_mingw32-filesystem_mingw32-meson_version", - "desc": "测试 mingw32-meson 命令的版本信息" - }, - { - "name": "test_mingw32-filesystem_mingw32-meson_setup", - "desc": "测试 mingw32-meson 命令最基本的 setup 子命令" - }, - { - "name": "test_mingw32-filesystem_mingw32-meson_configure", - "desc": "测试 mingw32-meson 命令的 configure 子命令" - }, - { - "name": "test_mingw32-filesystem_mingw32-meson_build", - "desc": "测试 mingw32-meson 命令的 build 子命令" - }, - { - "name": "test_mingw32-filesystem_mingw32-meson_test", - "desc": "测试 mingw32-meson 命令的 test 子命令" - }, - { - "name": "test_mingw32-filesystem_mingw32-meson_install", - "desc": "测试 mingw32-meson 命令的 install 子命令" - }, - { - "name": "test_mingw32-filesystem_mingw32-pkg-config__upper_v", - "desc": "测试 mingw32-pkg-config 的 -V 参数,检查其版本信息" - }, - { - "name": "test_mingw32-filesystem_mingw32-pkg-config__h", - "desc": "测试 mingw32-pkg-config 的 -h 参数,显示帮助信息" - }, - { - "name": "test_mingw32-filesystem_mingw32-pkg-config__upper_help", - "desc": "测试 mingw32-pkg-config 的 --help 参数,显示帮助信息" - }, - { - "name": "test_mingw32-filesystem_mingw32-pkg-config__upper_version", - "desc": "测试 mingw32-pkg-config 的 --version 参数,显示 pkg-config 版本" - }, - { - "name": "test_mingw32-filesystem_mingw32-pkg-config__at", - "desc": "测试 mingw32-pkg-config 的 @ 参数,从文件读取额外的命令行参数" - }, - { - "name": "test_mingw32-filesystem_mingw32-pkg-config__cflags", - "desc": "测试 mingw32-pkg-config 的 --cflags 参数,输出指定软件包的编译标志" - }, - { - "name": "test_mingw32-filesystem_mingw32-pkg-config__libs", - "desc": "测试 mingw32-pkg-config 的 --libs 参数,输出指定软件包的链接库标志" - }, - { - "name": "test_mingw32-filesystem_mingw32-pkg-config__libs_only_l", - "desc": "测试 mingw32-pkg-config 的 --libs-only-l 参数,输出指定软件包的 -l 库标志" - }, - { - "name": "test_mingw32-filesystem_mingw32-pkg-config__libs_only_other", - "desc": "测试 mingw32-pkg-config 的 --libs-only-other 参数,输出指定软件包的其他链接标志" - }, - { - "name": "test_mingw32-filesystem_mingw32-pkg-config__cflags_only_i", - "desc": "测试 mingw32-pkg-config 的 --cflags-only-I 参数,输出指定软件包的 -I 包含目录标志" - }, - { - "name": "test_mingw32-filesystem_mingw32-pkg-config__cflags_only_other", - "desc": "测试 mingw32-pkg-config 的 --cflags-only-other 参数,输出指定软件包的其他编译标志" - }, - { - "name": "test_mingw32-filesystem_mingw32-pkg-config__modversion", - "desc": "测试 mingw32-pkg-config 的 --modversion 参数,输出指定软件包的版本" - }, - { - "name": "test_mingw32-filesystem_mingw32-pkg-config__exists", - "desc": "测试 mingw32-pkg-config 的 --exists 参数,检查指定软件包是否存在" - }, - { - "name": "test_mingw32-filesystem_mingw32-pkg-config__at_package", - "desc": "测试 mingw32-pkg-config 的 @ 参数与软件包名结合使用,从文件读取参数并查询软件包" - }, - { - "name": "test_mingw32-filesystem_mingw32-pkg-config__cflags_libs", - "desc": "测试 mingw32-pkg-config 的 --cflags 和 --libs 参数组合使用,输出指定软件包的编译和链接标志" - }, - { - "name": "test_mingw32-filesystem_mingw32-pkg-config__exists_silent", - "desc": "测试 mingw32-pkg-config 的 --exists 参数静默模式,仅通过退出码判断软件包是否存在" - }, { "name": "test_mingw32-filesystem_function_install", "desc": "测试软件包安装功能" @@ -585,22 +21,6 @@ { "name": "test_mingw32-filesystem_function_check_installed", "desc": "测试检查软件包是否安装" - }, - { - "name": "test_mingw32-filesystem_function_basic_compile", - "desc": "测试使用mingw32-make基本编译" - }, - { - "name": "test_mingw32-filesystem_function_cmake_project", - "desc": "测试使用mingw32-cmake配置项目" - }, - { - "name": "test_mingw32-filesystem_function_configure_project", - "desc": "测试使用mingw32-configure配置项目" - }, - { - "name": "test_mingw32-filesystem_function_pkg_config_query", - "desc": "测试使用mingw32-pkg-config查询包信息" } ] } \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_function_basic_compile.sh b/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_function_basic_compile.sh deleted file mode 100644 index ad2ddb04317..00000000000 --- a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_function_basic_compile.sh +++ /dev/null @@ -1,97 +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-28 -# @License : Mulan PSL v2 -# @Desc : 测试使用mingw32-make基本编译 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试mingw32-make基本编译功能" - LOG_INFO "检查mingw32-filesystem软件包是否在yum源中" - dnf list available mingw32-filesystem > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中未找到mingw32-filesystem软件包" - - LOG_INFO "检查当前环境是否已安装mingw32-filesystem" - rpm -q mingw32-filesystem > /dev/null 2>&1 - if [ $? -eq 0 ]; then - INSTALLED=true - LOG_INFO "mingw32-filesystem已安装,脚本结束后将保持安装状态" - else - INSTALLED=false - LOG_INFO "mingw32-filesystem未安装,将在测试步骤中安装" - fi - - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装mingw32-filesystem软件包" - dnf install -y mingw32-filesystem - CHECK_RESULT $? 0 0 "安装mingw32-filesystem失败" - fi - - LOG_INFO "检查mingw32-make命令是否可用" - command -v mingw32-make > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "mingw32-make命令不存在" - - LOG_INFO "创建一个简单的C程序用于测试编译" - cat > test_hello.c << "EOF" - #include - int main() { - printf("Hello, MinGW32!\n"); - return 0; - } - EOF - - LOG_INFO "创建一个简单的Makefile文件" - cat > Makefile << "EOF" - CC=mingw32-gcc - TARGET=test_hello.exe - OBJ=test_hello.o - - $(TARGET): $(OBJ) - $(CC) -o $(TARGET) $(OBJ) - - $(OBJ): test_hello.c - $(CC) -c test_hello.c - - clean: - rm -f $(OBJ) $(TARGET) - EOF - - LOG_INFO "使用mingw32-make进行编译" - mingw32-make - CHECK_RESULT $? 0 0 "mingw32-make编译失败" - - LOG_INFO "验证编译生成的可执行文件" - if [ -f "test_hello.exe" ]; then - LOG_INFO "成功生成test_hello.exe文件" - else - LOG_ERROR "未找到test_hello.exe文件" - exit 1 - fi - - LOG_INFO "清理测试文件" - rm -f test_hello.c Makefile test_hello.o test_hello.exe - - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载mingw32-filesystem软件包" - dnf remove -y mingw32-filesystem - CHECK_RESULT $? 0 0 "卸载mingw32-filesystem失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_function_cmake_project.sh b/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_function_cmake_project.sh deleted file mode 100644 index f4129820e1f..00000000000 --- a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_function_cmake_project.sh +++ /dev/null @@ -1,76 +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-28 -# @License : Mulan PSL v2 -# @Desc : 测试使用mingw32-cmake配置项目 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:使用mingw32-cmake配置项目" - - # 步骤1:检查mingw32-filesystem软件包是否在yum源中 - LOG_INFO "检查mingw32-filesystem软件包是否在yum源中" - dnf list available mingw32-filesystem &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到mingw32-filesystem软件包" - exit 255 - fi - - # 步骤2:检查mingw32-cmake命令是否支持所需参数 - LOG_INFO "检查mingw32-cmake命令是否支持所需参数" - mingw32-cmake --help &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "mingw32-cmake命令不支持或参数错误" - exit 255 - fi - - # 步骤3:判断环境是否已安装mingw32-filesystem - LOG_INFO "判断环境是否已安装mingw32-filesystem" - rpm -q mingw32-filesystem &>/dev/null - if [ $? -eq 0 ]; then - LOG_INFO "mingw32-filesystem已安装,测试结束后保持安装状态" - INSTALLED=1 - else - LOG_INFO "mingw32-filesystem未安装,将在测试步骤中安装" - INSTALLED=0 - fi - - # 步骤4:如果未安装,则安装mingw32-filesystem - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装mingw32-filesystem软件包" - dnf install -y mingw32-filesystem - CHECK_RESULT $? 0 0 "安装mingw32-filesystem失败" - fi - - # 步骤5:使用mingw32-cmake配置项目 - LOG_INFO "使用mingw32-cmake配置项目" - mingw32-cmake -S . -B build - CHECK_RESULT $? 0 0 "mingw32-cmake配置项目失败" - - # 步骤6:清理环境,如果测试前未安装则卸载软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载mingw32-filesystem软件包" - dnf remove -y mingw32-filesystem - CHECK_RESULT $? 0 0 "卸载mingw32-filesystem失败" - else - LOG_INFO "测试前已安装mingw32-filesystem,保持安装状态" - fi - - LOG_INFO "测试完成:使用mingw32-cmake配置项目" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_function_configure_project.sh b/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_function_configure_project.sh deleted file mode 100644 index 7be16956105..00000000000 --- a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_function_configure_project.sh +++ /dev/null @@ -1,77 +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-28 -# @License : Mulan PSL v2 -# @Desc : 测试使用mingw32-configure配置项目 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已经安装了mingw32-filesystem - LOG_INFO "检查mingw32-filesystem是否已安装" - rpm -q mingw32-filesystem > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "mingw32-filesystem已安装,脚本结束后将保持安装状态" - already_installed=1 - else - LOG_INFO "mingw32-filesystem未安装,将在测试过程中安装" - already_installed=0 - fi - - # 检查yum源中是否有mingw32-filesystem软件包 - LOG_INFO "检查yum源中是否存在mingw32-filesystem软件包" - dnf list available mingw32-filesystem > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到mingw32-filesystem软件包" - exit 255 - fi - - # 如果没有安装,则安装mingw32-filesystem - if [ $already_installed -eq 0 ]; then - LOG_INFO "安装mingw32-filesystem软件包" - dnf install -y mingw32-filesystem - CHECK_RESULT $? 0 0 "安装mingw32-filesystem失败" - fi - - # 测试使用mingw32-configure配置项目 - LOG_INFO "测试使用mingw32-configure配置项目" - mingw32-configure --help > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "mingw32-configure命令存在,开始测试配置项目" - # 模拟配置一个简单项目 - mkdir -p test_project - cd test_project - echo "int main() { return 0; }" > test.c - mingw32-configure > configure.log 2>&1 - CHECK_RESULT $? 0 0 "mingw32-configure配置项目失败" - cd .. - rm -rf test_project - else - LOG_ERROR "mingw32-configure命令不存在或不支持" - exit 255 - fi - - # 清理环境:如果之前未安装,则卸载软件包 - if [ $already_installed -eq 0 ]; then - LOG_INFO "卸载mingw32-filesystem软件包" - dnf remove -y mingw32-filesystem - CHECK_RESULT $? 0 0 "卸载mingw32-filesystem失败" - fi - - LOG_INFO "测试脚本执行完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_function_lib.sh b/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_function_lib.sh deleted file mode 100644 index a91aad22b79..00000000000 --- a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_function_lib.sh +++ /dev/null @@ -1,65 +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-30 -# @License : Mulan PSL v2 -# @Desc : 测试基础依赖库的功能 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试基础依赖库的功能" - - # 检查是否已安装mingw32-filesystem软件包 - LOG_INFO "检查mingw32-filesystem是否已安装" - if dnf list installed mingw32-filesystem &>/dev/null; then - LOG_INFO "mingw32-filesystem已安装,脚本结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "mingw32-filesystem未安装,将在测试步骤中安装" - INSTALLED=false - fi - - # 检查yum源中是否有mingw32-filesystem软件包 - LOG_INFO "检查yum源中是否有mingw32-filesystem软件包" - if ! dnf list available mingw32-filesystem &>/dev/null; then - LOG_ERROR "yum源中未找到mingw32-filesystem软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装mingw32-filesystem软件包" - dnf install -y mingw32-filesystem - CHECK_RESULT $? 0 0 "安装mingw32-filesystem失败" - fi - - # 测试基础依赖库的功能 - LOG_INFO "测试基础依赖库的功能" - # 示例测试命令,根据实际需求替换 - example_command --test-param - CHECK_RESULT $? 0 0 "测试基础依赖库功能失败" - - # 如果脚本开始时未安装,则在结束时卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载mingw32-filesystem软件包" - dnf remove -y mingw32-filesystem - CHECK_RESULT $? 0 0 "卸载mingw32-filesystem失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_function_pkg_config_query.sh b/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_function_pkg_config_query.sh deleted file mode 100644 index 889f760432a..00000000000 --- a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_function_pkg_config_query.sh +++ /dev/null @@ -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 : 2026-02-28 -# @License : Mulan PSL v2 -# @Desc : 测试使用mingw32-pkg-config查询包信息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:使用mingw32-pkg-config查询包信息" - LOG_INFO "步骤1:检查mingw32-filesystem软件包是否在yum源中" - if ! dnf list available mingw32-filesystem &> /dev/null; then - LOG_ERROR "yum源中未找到mingw32-filesystem软件包" - exit 255 - fi - LOG_INFO "步骤2:检查mingw32-filesystem是否已安装" - if rpm -q mingw32-filesystem &> /dev/null; then - LOG_INFO "mingw32-filesystem已安装,脚本结束后将保持安装状态" - INSTALLED="true" - else - LOG_INFO "mingw32-filesystem未安装,将进行安装" - INSTALLED="false" - fi - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "步骤3:安装mingw32-filesystem软件包" - dnf install -y mingw32-filesystem - CHECK_RESULT $? 0 0 "安装mingw32-filesystem失败" - fi - LOG_INFO "步骤4:检查mingw32-pkg-config命令是否存在" - if ! command -v mingw32-pkg-config &> /dev/null; then - LOG_ERROR "mingw32-pkg-config命令不存在" - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "清理环境:卸载mingw32-filesystem软件包" - dnf remove -y mingw32-filesystem - fi - exit 255 - fi - LOG_INFO "步骤5:测试mingw32-pkg-config查询包信息功能" - LOG_INFO "执行命令:mingw32-pkg-config --list-all" - mingw32-pkg-config --list-all - CHECK_RESULT $? 0 0 "mingw32-pkg-config --list-all执行失败" - LOG_INFO "步骤6:测试指定包查询(以zlib为例)" - LOG_INFO "执行命令:mingw32-pkg-config --modversion zlib" - if mingw32-pkg-config --modversion zlib &> /dev/null; then - LOG_INFO "zlib包信息查询成功" - else - LOG_INFO "zlib包未安装或查询失败,此为正常情况,继续测试" - fi - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "步骤7:清理环境,卸载mingw32-filesystem软件包" - dnf remove -y mingw32-filesystem - CHECK_RESULT $? 0 0 "卸载mingw32-filesystem失败" - fi - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_--build.sh b/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_--build.sh deleted file mode 100644 index 4d762d3e86a..00000000000 --- a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_--build.sh +++ /dev/null @@ -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-28 -# @License : Mulan PSL v2 -# @Desc : 测试构建CMake生成的项目二进制树参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义软件包名称 - PACKAGE_NAME="mingw32-filesystem" - CMAKE_PACKAGE="mingw32-cmake" - - # 步骤1:检查环境是否已安装软件包 - LOG_INFO "检查环境是否已安装软件包 $PACKAGE_NAME 和 $CMAKE_PACKAGE" - if rpm -q $PACKAGE_NAME &>/dev/null && rpm -q $CMAKE_PACKAGE &>/dev/null; then - LOG_INFO "软件包已安装,脚本结束时将保持安装状态" - INSTALLED_BEFORE=true - else - LOG_INFO "软件包未安装,将在测试过程中安装" - INSTALLED_BEFORE=false - fi - - # 步骤2:检查yum源中是否有软件包 - LOG_INFO "检查yum源中是否有软件包 $PACKAGE_NAME 和 $CMAKE_PACKAGE" - if ! dnf list available $PACKAGE_NAME &>/dev/null; then - LOG_ERROR "yum源中未找到软件包 $PACKAGE_NAME" - exit 255 - fi - if ! dnf list available $CMAKE_PACKAGE &>/dev/null; then - LOG_ERROR "yum源中未找到软件包 $CMAKE_PACKAGE" - exit 255 - fi - - # 步骤3:检查参数是否支持 - LOG_INFO "检查参数 --build 是否支持" - if ! mingw32-cmake --help 2>&1 | grep -q "\-\-build"; then - LOG_ERROR "参数 --build 不存在或不支持" - exit 255 - fi - - # 步骤4:如果未安装,安装软件包 - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "安装软件包 $PACKAGE_NAME 和 $CMAKE_PACKAGE" - dnf install -y $PACKAGE_NAME $CMAKE_PACKAGE - CHECK_RESULT $? 0 0 "安装软件包失败" - fi - - # 步骤5:创建测试项目目录 - LOG_INFO "创建测试项目目录" - TEST_DIR="/tmp/cmake_test_project" - mkdir -p $TEST_DIR - CHECK_RESULT $? 0 0 "创建测试目录失败" - - # 步骤6:创建CMakeLists.txt文件 - LOG_INFO "创建CMakeLists.txt文件" - cat > $TEST_DIR/CMakeLists.txt << "EOF" - cmake_minimum_required(VERSION 3.10) - project(TestProject) - add_executable(test_app main.c) - EOF - CHECK_RESULT $? 0 0 "创建CMakeLists.txt失败" - - # 步骤7:创建main.c文件 - LOG_INFO "创建main.c文件" - cat > $TEST_DIR/main.c << "EOF" - #include - int main() { - printf("Hello, World!\n"); - return 0; - } - EOF - CHECK_RESULT $? 0 0 "创建main.c失败" - - # 步骤8:使用mingw32-cmake构建项目 - LOG_INFO "使用mingw32-cmake构建项目" - cd $TEST_DIR - mingw32-cmake --build . - CHECK_RESULT $? 0 0 "构建项目失败" - - # 步骤9:检查构建结果 - LOG_INFO "检查构建结果" - if [ -f "$TEST_DIR/test_app.exe" ]; then - LOG_INFO "构建成功,生成test_app.exe" - else - LOG_ERROR "构建失败,未生成test_app.exe" - exit 1 - fi - - # 步骤10:清理测试目录 - LOG_INFO "清理测试目录" - cd / - rm -rf $TEST_DIR - CHECK_RESULT $? 0 0 "清理测试目录失败" - - # 步骤11:如果脚本开始前未安装,则卸载软件包 - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "卸载软件包 $PACKAGE_NAME 和 $CMAKE_PACKAGE" - dnf remove -y $PACKAGE_NAME $CMAKE_PACKAGE - CHECK_RESULT $? 0 0 "卸载软件包失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_--debug-find.sh b/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_--debug-find.sh deleted file mode 100644 index 851f96257cf..00000000000 --- a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_--debug-find.sh +++ /dev/null @@ -1,56 +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-28 -# @License : Mulan PSL v2 -# @Desc : 测试启用CMake查找调试模式参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:测试启用CMake查找调试模式参数" - LOG_INFO "步骤1:检查yum源中是否存在mingw32-filesystem和mingw32-cmake软件包" - dnf list available mingw32-filesystem mingw32-cmake >/dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中未找到mingw32-filesystem或mingw32-cmake软件包,退出" - LOG_INFO "步骤2:检查系统是否已安装mingw32-filesystem和mingw32-cmake" - rpm -q mingw32-filesystem mingw32-cmake >/dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "软件包已安装,测试结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "软件包未安装,将进行安装测试" - INSTALLED=0 - LOG_INFO "步骤3:安装mingw32-filesystem和mingw32-cmake" - dnf install -y mingw32-filesystem mingw32-cmake - CHECK_RESULT $? 0 0 "安装mingw32-filesystem和mingw32-cmake失败" - fi - LOG_INFO "步骤4:检查mingw32-cmake命令是否支持--debug-find参数" - mingw32-cmake --help 2>&1 | grep -q "\-\-debug-find" - CHECK_RESULT $? 0 0 "mingw32-cmake命令不支持--debug-find参数,退出" - LOG_INFO "步骤5:执行mingw32-cmake --debug-find命令" - mingw32-cmake --debug-find - CHECK_RESULT $? 0 0 "执行mingw32-cmake --debug-find命令失败" - LOG_INFO "步骤6:清理环境" - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载测试安装的软件包" - dnf remove -y mingw32-filesystem mingw32-cmake - CHECK_RESULT $? 0 0 "卸载mingw32-filesystem和mingw32-cmake失败" - else - LOG_INFO "保持原有安装状态,不进行卸载" - fi - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_--fresh.sh b/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_--fresh.sh deleted file mode 100644 index bf744398072..00000000000 --- a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_--fresh.sh +++ /dev/null @@ -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 : 2026-02-28 -# @License : Mulan PSL v2 -# @Desc : 测试配置全新构建树参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试配置全新构建树参数" - - # 检查是否已安装 mingw32-filesystem 和 mingw32-cmake - LOG_INFO "检查是否已安装 mingw32-filesystem 和 mingw32-cmake" - if dnf list installed mingw32-filesystem mingw32-cmake &>/dev/null; then - LOG_INFO "软件包已安装,测试结束后保持安装状态" - already_installed=true - else - LOG_INFO "软件包未安装,将在测试过程中安装并在结束后卸载" - already_installed=false - fi - - # 检查 yum 源中是否存在软件包 - LOG_INFO "检查 yum 源中是否存在 mingw32-filesystem 和 mingw32-cmake" - if ! dnf list available mingw32-filesystem mingw32-cmake &>/dev/null; then - LOG_ERROR "yum 源中缺少 mingw32-filesystem 或 mingw32-cmake 软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$already_installed" = false ]; then - LOG_INFO "安装 mingw32-filesystem 和 mingw32-cmake" - dnf install -y mingw32-filesystem mingw32-cmake - CHECK_RESULT $? 0 0 "安装软件包失败" - fi - - # 测试 --fresh 参数 - LOG_INFO "测试 mingw32-cmake 的 --fresh 参数" - if mingw32-cmake --help 2>&1 | grep -q "\-\-fresh"; then - LOG_INFO "--fresh 参数存在,执行测试" - mingw32-cmake --fresh - CHECK_RESULT $? 0 0 "执行 mingw32-cmake --fresh 失败" - else - LOG_ERROR "mingw32-cmake 不支持 --fresh 参数" - exit 255 - fi - - # 清理环境:如果测试前未安装,则卸载软件包 - if [ "$already_installed" = false ]; then - LOG_INFO "卸载 mingw32-filesystem 和 mingw32-cmake" - dnf remove -y mingw32-filesystem mingw32-cmake - CHECK_RESULT $? 0 0 "卸载软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_--graphviz.sh b/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_--graphviz.sh deleted file mode 100644 index 621083110a5..00000000000 --- a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_--graphviz.sh +++ /dev/null @@ -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-02-28 -# @License : Mulan PSL v2 -# @Desc : 测试生成依赖关系图参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "开始测试生成依赖关系图参数" - - # 定义软件包名称 - PACKAGE_NAME="mingw32-filesystem" - CMAKE_PACKAGE="mingw32-cmake" - GRAPHVIZ_PARAM="--graphviz" - - # 检查yum源中是否存在指定软件包 - LOG_INFO "检查yum源中是否存在软件包 $PACKAGE_NAME 和 $CMAKE_PACKAGE" - if ! dnf list available $PACKAGE_NAME $CMAKE_PACKAGE &>/dev/null; then - LOG_ERROR "yum源中不存在软件包 $PACKAGE_NAME 或 $CMAKE_PACKAGE" - exit 255 - fi - - # 检查环境是否已安装指定软件包 - LOG_INFO "检查环境是否已安装 $PACKAGE_NAME 和 $CMAKE_PACKAGE" - if rpm -q $PACKAGE_NAME $CMAKE_PACKAGE &>/dev/null; then - LOG_INFO "软件包已安装,测试结束后将保持安装状态" - ALREADY_INSTALLED=true - else - LOG_INFO "软件包未安装,将进行安装" - ALREADY_INSTALLED=false - fi - - # 如果未安装,则安装软件包 - if [ "$ALREADY_INSTALLED" = false ]; then - LOG_INFO "安装软件包 $PACKAGE_NAME 和 $CMAKE_PACKAGE" - dnf install -y $PACKAGE_NAME $CMAKE_PACKAGE - CHECK_RESULT $? 0 0 "安装软件包失败" - fi - - # 检查 --graphviz 参数是否支持 - LOG_INFO "检查 $CMAKE_PACKAGE 是否支持参数 $GRAPHVIZ_PARAM" - if ! mingw32-cmake --help 2>&1 | grep -q "$GRAPHVIZ_PARAM"; then - LOG_ERROR "参数 $GRAPHVIZ_PARAM 不存在或不支持" - exit 255 - fi - - # 测试生成依赖关系图参数 - LOG_INFO "执行 mingw32-cmake $GRAPHVIZ_PARAM 命令" - mingw32-cmake $GRAPHVIZ_PARAM - CHECK_RESULT $? 0 0 "执行 mingw32-cmake $GRAPHVIZ_PARAM 失败" - - # 清理环境:如果测试前未安装,则卸载软件包 - if [ "$ALREADY_INSTALLED" = false ]; then - LOG_INFO "卸载软件包 $PACKAGE_NAME 和 $CMAKE_PACKAGE" - dnf remove -y $PACKAGE_NAME $CMAKE_PACKAGE - CHECK_RESULT $? 0 0 "卸载软件包失败" - else - LOG_INFO "测试前软件包已安装,保持安装状态" - fi - - LOG_INFO "测试生成依赖关系图参数完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_--help-full.sh b/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_--help-full.sh deleted file mode 100644 index 049b5b5b13b..00000000000 --- a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_--help-full.sh +++ /dev/null @@ -1,85 +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-28 -# @License : Mulan PSL v2 -# @Desc : 测试打印所有帮助手册并退出参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 环境初始化与软件包检查 - LOG_INFO "开始测试 mingw32-filesystem 和 mingw32-cmake 的 --help-full 参数" - - # 定义软件包名称 - PACKAGE1="mingw32-filesystem" - PACKAGE2="mingw32-cmake" - CMD="mingw32-cmake" - ARG="--help-full" - - # 检查软件包是否已在系统中安装 - LOG_INFO "检查软件包是否已安装" - if dnf list installed "$PACKAGE1" &>/dev/null && dnf list installed "$PACKAGE2" &>/dev/null; then - LOG_INFO "软件包 $PACKAGE1 和 $PACKAGE2 已安装" - INSTALLED=true - else - LOG_INFO "软件包 $PACKAGE1 和 $PACKAGE2 未安装" - INSTALLED=false - fi - - # 检查软件包是否在 yum 源中 - LOG_INFO "检查软件包是否在 yum 源中" - if ! dnf list available "$PACKAGE1" &>/dev/null || ! dnf list available "$PACKAGE2" &>/dev/null; then - LOG_ERROR "软件包 $PACKAGE1 或 $PACKAGE2 不在 yum 源中" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装软件包 $PACKAGE1 和 $PACKAGE2" - dnf install -y "$PACKAGE1" "$PACKAGE2" - CHECK_RESULT $? 0 0 "安装软件包失败" - fi - - # 测试命令参数是否存在 - LOG_INFO "检查命令 $CMD 是否支持参数 $ARG" - if ! $CMD --help 2>&1 | grep -q "$ARG"; then - LOG_ERROR "命令 $CMD 不支持参数 $ARG" - # 如果之前未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载软件包 $PACKAGE1 和 $PACKAGE2" - dnf remove -y "$PACKAGE1" "$PACKAGE2" - fi - exit 255 - fi - - # 执行测试命令 - LOG_INFO "执行命令 $CMD $ARG" - $CMD $ARG - CHECK_RESULT $? 0 0 "执行命令 $CMD $ARG 失败" - - # 环境恢复 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载软件包 $PACKAGE1 和 $PACKAGE2" - dnf remove -y "$PACKAGE1" "$PACKAGE2" - CHECK_RESULT $? 0 0 "卸载软件包失败" - else - LOG_INFO "保持软件包 $PACKAGE1 和 $PACKAGE2 的安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_--help.sh b/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_--help.sh deleted file mode 100644 index 6eeade0d927..00000000000 --- a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_--help.sh +++ /dev/null @@ -1,67 +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-28 -# @License : Mulan PSL v2 -# @Desc : 测试打印使用信息并退出参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:测试打印使用信息并退出参数" - LOG_INFO "步骤1:检查是否已安装 mingw32-filesystem 和 mingw32-cmake" - if dnf list installed mingw32-filesystem mingw32-cmake &>/dev/null; then - LOG_INFO "软件包已安装,跳过安装步骤" - INSTALLED=true - else - LOG_INFO "软件包未安装,准备安装" - INSTALLED=false - fi - - LOG_INFO "步骤2:检查yum源中是否存在 mingw32-filesystem 和 mingw32-cmake" - if ! dnf list available mingw32-filesystem mingw32-cmake &>/dev/null; then - LOG_ERROR "yum源中缺少 mingw32-filesystem 或 mingw32-cmake 软件包" - exit 255 - fi - - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤3:安装 mingw32-filesystem 和 mingw32-cmake" - dnf install -y mingw32-filesystem mingw32-cmake - CHECK_RESULT $? 0 0 "安装软件包失败" - fi - - LOG_INFO "步骤4:检查 mingw32-cmake 是否支持 --help 参数" - if ! mingw32-cmake --help &>/dev/null; then - LOG_ERROR "mingw32-cmake 不支持 --help 参数" - exit 255 - fi - - LOG_INFO "步骤5:执行 mingw32-cmake --help 命令" - mingw32-cmake --help - CHECK_RESULT $? 0 0 "执行 mingw32-cmake --help 失败" - - LOG_INFO "步骤6:清理环境" - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载已安装的软件包" - dnf remove -y mingw32-filesystem mingw32-cmake - CHECK_RESULT $? 0 0 "卸载软件包失败" - else - LOG_INFO "保持软件包安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_--install.sh b/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_--install.sh deleted file mode 100644 index daee062af82..00000000000 --- a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_--install.sh +++ /dev/null @@ -1,133 +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-28 -# @License : Mulan PSL v2 -# @Desc : 测试安装CMake生成的项目二进制树参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 环境变量设置 - SCRIPT_NAME="test_mingw32-filesystem_mingw32-cmake_--install" - PKG_NAME="mingw32-filesystem" - PKG_TOOLS="mingw32-cmake" - CMD_PARAM="--install" - - # 日志函数 - LOG_INFO() { - echo "[INFO] $*" - } - - LOG_ERROR() { - echo "[ERROR] $*" >&2 - } - - # 检查软件包是否在yum源中 - check_package_in_repo() { - local pkg=$1 - LOG_INFO "检查yum源中是否存在软件包: $pkg" - dnf list available "$pkg" &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 $pkg 不在yum源中" - exit 255 - fi - LOG_INFO "软件包 $pkg 在yum源中存在" - } - - # 检查命令参数是否支持 - check_command_param() { - local cmd=$1 - local param=$2 - LOG_INFO "检查命令 $cmd 是否支持参数 $param" - $cmd --help 2>&1 | grep -q "\-\-install" - if [ $? -ne 0 ]; then - LOG_ERROR "命令 $cmd 不支持参数 $param" - exit 255 - fi - LOG_INFO "命令 $cmd 支持参数 $param" - } - - # 检查软件包是否已安装 - check_package_installed() { - local pkg=$1 - rpm -q "$pkg" &>/dev/null - return $? - } - - # 主测试函数 - main() { - LOG_INFO "开始测试: $SCRIPT_NAME" - LOG_INFO "测试用例描述: 测试安装CMake生成的项目二进制树参数" - - # 步骤1: 检查yum源中是否存在所需软件包 - LOG_INFO "步骤1: 检查yum源中是否存在所需软件包" - check_package_in_repo "$PKG_NAME" - check_package_in_repo "$PKG_TOOLS" - - # 步骤2: 检查命令参数是否支持 - LOG_INFO "步骤2: 检查命令参数是否支持" - check_command_param "$PKG_TOOLS" "$CMD_PARAM" - - # 步骤3: 检查环境是否已安装 - LOG_INFO "步骤3: 检查环境是否已安装" - local need_cleanup=0 - if check_package_installed "$PKG_NAME" && check_package_installed "$PKG_TOOLS"; then - LOG_INFO "软件包已安装,测试结束后将保持安装状态" - need_cleanup=0 - else - LOG_INFO "软件包未安装,将在测试结束后清理" - need_cleanup=1 - fi - - # 步骤4: 如果未安装,则安装软件包 - if [ $need_cleanup -eq 1 ]; then - LOG_INFO "步骤4: 安装所需软件包" - dnf install -y "$PKG_NAME" "$PKG_TOOLS" - CHECK_RESULT $? 0 0 "安装软件包失败" - LOG_INFO "软件包安装成功" - fi - - # 步骤5: 执行测试命令 - LOG_INFO "步骤5: 执行测试命令" - $PKG_TOOLS $CMD_PARAM - CHECK_RESULT $? 0 0 "执行命令失败" - - # 步骤6: 验证命令执行结果 - LOG_INFO "步骤6: 验证命令执行结果" - # 这里可以根据实际需求添加具体的验证逻辑 - # 例如检查某个文件是否生成,或者某个目录是否存在等 - # 由于测试用例描述比较泛,这里只检查命令是否成功执行 - LOG_INFO "命令执行成功,验证通过" - - # 步骤7: 环境恢复 - LOG_INFO "步骤7: 环境恢复" - if [ $need_cleanup -eq 1 ]; then - LOG_INFO "卸载测试安装的软件包" - dnf remove -y "$PKG_NAME" "$PKG_TOOLS" - CHECK_RESULT $? 0 0 "卸载软件包失败" - LOG_INFO "软件包卸载成功" - else - LOG_INFO "保持软件包安装状态" - fi - - LOG_INFO "测试完成: $SCRIPT_NAME" - } - - # 执行主函数 - main "$@" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_--log-level.sh b/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_--log-level.sh deleted file mode 100644 index 4d61231e874..00000000000 --- a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_--log-level.sh +++ /dev/null @@ -1,101 +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-28 -# @License : Mulan PSL v2 -# @Desc : 测试设置CMake文件消息详细级别参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义变量 - PKG_NAME="mingw32-filesystem" - CMD_NAME="mingw32-cmake" - PARAM_NAME="--log-level" - EXPECTED_PARAM_VALUE="STATUS|WARNING|AUTHOR_WARNING|SEND_ERROR|FATAL_ERROR|DEPRECATION" - - # 检查软件包是否在yum源中 - LOG_INFO "检查软件包 ${PKG_NAME} 是否在yum源中" - dnf list available ${PKG_NAME} > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 ${PKG_NAME} 不在yum源中" - exit 255 - fi - - # 检查是否已安装软件包 - LOG_INFO "检查是否已安装软件包 ${PKG_NAME}" - rpm -q ${PKG_NAME} > /dev/null 2>&1 - INSTALLED=$? - if [ ${INSTALLED} -eq 0 ]; then - LOG_INFO "软件包 ${PKG_NAME} 已安装" - NEED_CLEANUP=0 - else - LOG_INFO "软件包 ${PKG_NAME} 未安装,将进行安装" - NEED_CLEANUP=1 - fi - - # 如果未安装,则安装软件包 - if [ ${NEED_CLEANUP} -eq 1 ]; then - LOG_INFO "安装软件包 ${PKG_NAME}" - dnf install -y ${PKG_NAME} > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装软件包 ${PKG_NAME} 失败" - fi - - # 检查命令是否存在 - LOG_INFO "检查命令 ${CMD_NAME} 是否存在" - which ${CMD_NAME} > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "命令 ${CMD_NAME} 不存在" - - # 检查参数是否存在 - LOG_INFO "检查命令 ${CMD_NAME} 是否支持参数 ${PARAM_NAME}" - ${CMD_NAME} --help 2>&1 | grep -q "${PARAM_NAME}" - if [ $? -ne 0 ]; then - LOG_ERROR "命令 ${CMD_NAME} 不支持参数 ${PARAM_NAME}" - exit 255 - fi - - # 测试设置CMake文件消息详细级别参数 - LOG_INFO "测试设置CMake文件消息详细级别参数" - ${CMD_NAME} ${PARAM_NAME} STATUS --help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "执行 ${CMD_NAME} ${PARAM_NAME} STATUS 失败" - - ${CMD_NAME} ${PARAM_NAME} WARNING --help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "执行 ${CMD_NAME} ${PARAM_NAME} WARNING 失败" - - ${CMD_NAME} ${PARAM_NAME} AUTHOR_WARNING --help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "执行 ${CMD_NAME} ${PARAM_NAME} AUTHOR_WARNING 失败" - - ${CMD_NAME} ${PARAM_NAME} SEND_ERROR --help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "执行 ${CMD_NAME} ${PARAM_NAME} SEND_ERROR 失败" - - ${CMD_NAME} ${PARAM_NAME} FATAL_ERROR --help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "执行 ${CMD_NAME} ${PARAM_NAME} FATAL_ERROR 失败" - - ${CMD_NAME} ${PARAM_NAME} DEPRECATION --help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "执行 ${CMD_NAME} ${PARAM_NAME} DEPRECATION 失败" - - # 清理环境 - if [ ${NEED_CLEANUP} -eq 1 ]; then - LOG_INFO "卸载软件包 ${PKG_NAME}" - dnf remove -y ${PKG_NAME} > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载软件包 ${PKG_NAME} 失败" - else - LOG_INFO "保持软件包 ${PKG_NAME} 的安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_--open.sh b/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_--open.sh deleted file mode 100644 index d9a8cdd0226..00000000000 --- a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_--open.sh +++ /dev/null @@ -1,174 +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-28 -# @License : Mulan PSL v2 -# @Desc : 测试在关联应用中打开生成的项目参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 环境变量设置 - SCRIPT_NAME="test_mingw32-filesystem_mingw32-cmake_--open" - LOG_FILE="/tmp/${SCRIPT_NAME}.log" - - # 清理日志文件 - > "$LOG_FILE" - - # 软件包列表 - PACKAGES=("mingw32-filesystem" "mingw32-cmake") - - # 检查软件包是否在yum源中 - check_package_in_repo() { - local pkg=$1 - LOG_INFO "检查软件包 ${pkg} 是否在yum源中" - dnf list available "$pkg" &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 ${pkg} 不在yum源中" - exit 255 - fi - LOG_INFO "软件包 ${pkg} 在yum源中" - } - - # 检查命令参数 - check_command_params() { - local cmd=$1 - shift - local params=("$@") - - LOG_INFO "检查命令参数: ${cmd} ${params[*]}" - - # 这里简化处理,实际应根据具体命令验证参数 - # 示例:检查--open参数是否被支持 - for param in "${params[@]}"; do - if [[ "$param" == "--open" ]]; then - # 假设--open是有效参数 - LOG_INFO "参数 --open 有效" - else - LOG_ERROR "参数 ${param} 不存在或不支持" - exit 255 - fi - done - } - - # 检查软件包是否已安装 - check_package_installed() { - local pkg=$1 - rpm -q "$pkg" &>/dev/null - return $? - } - - # 安装软件包 - install_packages() { - LOG_INFO "开始安装软件包" - for pkg in "${PACKAGES[@]}"; do - if ! check_package_installed "$pkg"; then - LOG_INFO "安装软件包: ${pkg}" - dnf install -y "$pkg" - CHECK_RESULT $? 0 0 "安装软件包 ${pkg} 失败" - else - LOG_INFO "软件包 ${pkg} 已安装,跳过安装" - fi - done - } - - # 卸载软件包 - uninstall_packages() { - LOG_INFO "开始卸载软件包" - for pkg in "${PACKAGES[@]}"; do - if check_package_installed "$pkg"; then - LOG_INFO "卸载软件包: ${pkg}" - dnf remove -y "$pkg" - CHECK_RESULT $? 0 0 "卸载软件包 ${pkg} 失败" - fi - done - } - - # 主测试函数 - main_test() { - LOG_INFO "=== 开始测试: 测试在关联应用中打开生成的项目参数 ===" - - # 步骤1: 检查软件包是否在yum源中 - LOG_INFO "步骤1: 检查软件包是否在yum源中" - for pkg in "${PACKAGES[@]}"; do - check_package_in_repo "$pkg" - done - - # 步骤2: 检查命令参数 - LOG_INFO "步骤2: 检查命令参数" - check_command_params "mingw32-cmake" "--open" - - # 步骤3: 检查环境是否已安装 - LOG_INFO "步骤3: 检查环境是否已安装" - local already_installed=true - for pkg in "${PACKAGES[@]}"; do - if ! check_package_installed "$pkg"; then - already_installed=false - break - fi - done - - # 步骤4: 根据安装状态决定是否安装 - LOG_INFO "步骤4: 根据安装状态决定是否安装" - if [ "$already_installed" = false ]; then - install_packages - local need_uninstall=true - else - LOG_INFO "所有软件包已安装,无需重新安装" - local need_uninstall=false - fi - - # 步骤5: 执行测试命令 - LOG_INFO "步骤5: 执行测试命令" - LOG_INFO "执行: mingw32-cmake --open" - - # 模拟执行命令(实际应根据具体命令实现) - # 这里使用echo模拟命令执行 - echo "模拟执行 mingw32-cmake --open 命令" > /dev/null - CHECK_RESULT $? 0 0 "执行 mingw32-cmake --open 命令失败" - - # 步骤6: 验证测试结果 - LOG_INFO "步骤6: 验证测试结果" - # 这里添加具体的验证逻辑 - # 示例:检查命令是否成功执行 - LOG_INFO "测试命令执行成功" - - # 步骤7: 清理环境 - LOG_INFO "步骤7: 清理环境" - if [ "$need_uninstall" = true ]; then - uninstall_packages - else - LOG_INFO "保持环境安装状态" - fi - - LOG_INFO "=== 测试完成 ===" - } - - # 异常处理 - trap cleanup EXIT - - cleanup() { - LOG_INFO "执行清理操作" - # 这里可以添加额外的清理逻辑 - } - - # 执行主测试 - main_test - - # 记录日志 - LOG_INFO "测试脚本执行完成,详细日志请查看: ${LOG_FILE}" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_--preset.sh b/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_--preset.sh deleted file mode 100644 index 4c0cc798ea6..00000000000 --- a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_--preset.sh +++ /dev/null @@ -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-02-28 -# @License : Mulan PSL v2 -# @Desc : 测试指定配置预设参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试指定配置预设参数" - - # 检查是否已经安装 mingw32-filesystem 和 mingw32-cmake - LOG_INFO "检查 mingw32-filesystem 和 mingw32-cmake 是否已安装" - if dnf list installed mingw32-filesystem mingw32-cmake &>/dev/null; then - LOG_INFO "mingw32-filesystem 和 mingw32-cmake 已安装,脚本结束时将保持安装状态" - already_installed=true - else - LOG_INFO "mingw32-filesystem 和 mingw32-cmake 未安装,将在测试步骤中安装" - already_installed=false - fi - - # 检查 yum 源中是否有指定软件包 - LOG_INFO "检查 yum 源中是否有 mingw32-filesystem 和 mingw32-cmake" - if ! dnf list available mingw32-filesystem mingw32-cmake &>/dev/null; then - LOG_ERROR "yum 源中未找到 mingw32-filesystem 或 mingw32-cmake" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$already_installed" = false ]; then - LOG_INFO "安装 mingw32-filesystem 和 mingw32-cmake" - dnf install -y mingw32-filesystem mingw32-cmake - CHECK_RESULT $? 0 0 "安装 mingw32-filesystem 和 mingw32-cmake 失败" - fi - - # 检查命令参数是否存在或不支持 - LOG_INFO "检查 mingw32-cmake 是否支持 --preset 参数" - if ! mingw32-cmake --help | grep -q "\-\-preset"; then - LOG_ERROR "mingw32-cmake 不支持 --preset 参数" - exit 255 - fi - - # 执行测试命令 - LOG_INFO "执行 mingw32-cmake --preset 命令" - mingw32-cmake --preset - CHECK_RESULT $? 0 0 "执行 mingw32-cmake --preset 命令失败" - - # 环境恢复:如果之前未安装,则卸载软件包 - if [ "$already_installed" = false ]; then - LOG_INFO "卸载 mingw32-filesystem 和 mingw32-cmake" - dnf remove -y mingw32-filesystem mingw32-cmake - CHECK_RESULT $? 0 0 "卸载 mingw32-filesystem 和 mingw32-cmake 失败" - else - LOG_INFO "保持 mingw32-filesystem 和 mingw32-cmake 的安装状态" - fi - - LOG_INFO "测试指定配置预设参数完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_--toolchain.sh b/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_--toolchain.sh deleted file mode 100644 index 91934e8059b..00000000000 --- a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_--toolchain.sh +++ /dev/null @@ -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-02-28 -# @License : Mulan PSL v2 -# @Desc : 测试指定工具链文件参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装 mingw32-filesystem 和 mingw32-cmake - LOG_INFO "检查是否已安装 mingw32-filesystem 和 mingw32-cmake" - rpm -q mingw32-filesystem mingw32-cmake > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "软件包已安装,测试后保持安装状态" - INSTALLED=true - else - LOG_INFO "软件包未安装,将在测试后卸载" - INSTALLED=false - fi - - # 检查 yum 源中是否有 mingw32-filesystem 和 mingw32-cmake - LOG_INFO "检查 yum 源中是否有 mingw32-filesystem 和 mingw32-cmake" - dnf list available mingw32-filesystem mingw32-cmake > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum 源中缺少 mingw32-filesystem 或 mingw32-cmake" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "安装 mingw32-filesystem 和 mingw32-cmake" - dnf install -y mingw32-filesystem mingw32-cmake - CHECK_RESULT $? 0 0 "安装 mingw32-filesystem 和 mingw32-cmake 失败" - fi - - # 检查指定工具链文件参数是否存在 - LOG_INFO "检查 --toolchain 参数是否被支持" - mingw32-cmake --help | grep -q -- "--toolchain" - if [ $? -ne 0 ]; then - LOG_ERROR "--toolchain 参数不被支持" - # 如果测试前未安装,则卸载软件包 - if [ "$INSTALLED" = "false" ]; then - dnf remove -y mingw32-filesystem mingw32-cmake - fi - exit 255 - fi - - # 测试指定工具链文件参数 - LOG_INFO "测试指定工具链文件参数" - mingw32-cmake --toolchain /usr/i686-w64-mingw32/sys-root/mingw/lib/cmake > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "指定工具链文件参数测试失败" - - # 清理环境 - LOG_INFO "清理测试环境" - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "卸载 mingw32-filesystem 和 mingw32-cmake" - dnf remove -y mingw32-filesystem mingw32-cmake - CHECK_RESULT $? 0 0 "卸载 mingw32-filesystem 和 mingw32-cmake 失败" - else - LOG_INFO "保持 mingw32-filesystem 和 mingw32-cmake 安装状态" - fi - - LOG_INFO "测试指定工具链文件参数完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_--trace.sh b/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_--trace.sh deleted file mode 100644 index fd62cbcfc38..00000000000 --- a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_--trace.sh +++ /dev/null @@ -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-28 -# @License : Mulan PSL v2 -# @Desc : 测试启用CMake跟踪模式参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断是否已经安装所需软件包 - LOG_INFO "开始测试启用CMake跟踪模式参数" - - # 定义软件包名称 - PKG_NAME="mingw32-filesystem" - PKG_CMAKE="mingw32-cmake" - - # 检查yum源中是否存在指定软件包 - LOG_INFO "检查yum源中是否存在软件包: $PKG_NAME" - dnf list available $PKG_NAME &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到软件包: $PKG_NAME" - exit 255 - fi - - LOG_INFO "检查yum源中是否存在软件包: $PKG_CMAKE" - dnf list available $PKG_CMAKE &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到软件包: $PKG_CMAKE" - exit 255 - fi - - # 检查是否已经安装 - LOG_INFO "检查软件包是否已经安装" - INSTALLED=0 - rpm -q $PKG_NAME &>/dev/null && rpm -q $PKG_CMAKE &>/dev/null - if [ $? -eq 0 ]; then - LOG_INFO "软件包已经安装,测试后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "软件包未安装,将在测试过程中安装" - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装软件包: $PKG_NAME 和 $PKG_CMAKE" - dnf install -y $PKG_NAME $PKG_CMAKE - CHECK_RESULT $? 0 0 "安装软件包失败" - fi - - # 测试--trace参数 - LOG_INFO "测试mingw32-cmake是否支持--trace参数" - mingw32-cmake --trace --help &>/dev/null - if [ $? -eq 0 ]; then - LOG_INFO "--trace参数支持" - else - LOG_ERROR "--trace参数不支持" - exit 255 - fi - - # 测试启用CMake跟踪模式参数 - LOG_INFO "执行测试: 启用CMake跟踪模式参数" - mingw32-cmake --trace -P /dev/null 2>&1 | grep -q "trace mode" - CHECK_RESULT $? 0 0 "启用CMake跟踪模式参数测试失败" - - LOG_INFO "CMake跟踪模式参数测试成功" - - # 清理环境 - LOG_INFO "开始清理环境" - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载测试安装的软件包" - dnf remove -y $PKG_NAME $PKG_CMAKE - CHECK_RESULT $? 0 0 "卸载软件包失败" - LOG_INFO "环境已恢复到测试前状态" - else - LOG_INFO "软件包为预先安装,保持安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_--version.sh b/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_--version.sh deleted file mode 100644 index 197cb3ce1b5..00000000000 --- a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_--version.sh +++ /dev/null @@ -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-02-28 -# @License : Mulan PSL v2 -# @Desc : 测试打印版本号并退出参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断当前环境是否已安装指定软件包 - LOG_INFO "检查是否已安装 mingw32-filesystem 和 mingw32-cmake 软件包" - if rpm -q mingw32-filesystem mingw32-cmake &> /dev/null; then - LOG_INFO "软件包已安装,标记为已安装状态" - INSTALLED=true - else - LOG_INFO "软件包未安装,标记为未安装状态" - INSTALLED=false - fi - - # 检查yum源中是否存在需要安装的软件包 - LOG_INFO "检查yum源中是否存在 mingw32-filesystem 和 mingw32-cmake 软件包" - if ! dnf list available mingw32-filesystem mingw32-cmake &> /dev/null; then - LOG_ERROR "yum源中不存在指定的软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装 mingw32-filesystem 和 mingw32-cmake 软件包" - dnf install -y mingw32-filesystem mingw32-cmake - CHECK_RESULT $? 0 0 "安装软件包失败" - fi - - # 测试指定命令的参数 - LOG_INFO "测试 mingw32-cmake --version 命令" - if mingw32-cmake --help 2>&1 | grep -q "\-\-version"; then - LOG_INFO "--version 参数存在,继续执行测试" - else - LOG_ERROR "--version 参数不存在或不支持" - exit 255 - fi - - # 执行命令并检查结果 - LOG_INFO "执行 mingw32-cmake --version 命令" - mingw32-cmake --version - CHECK_RESULT $? 0 0 "执行 mingw32-cmake --version 命令失败" - - # 清理环境:如果脚本开始时未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "清理环境:卸载 mingw32-filesystem 和 mingw32-cmake 软件包" - dnf remove -y mingw32-filesystem mingw32-cmake - CHECK_RESULT $? 0 0 "卸载软件包失败" - else - LOG_INFO "脚本开始时软件包已安装,保持安装状态" - fi - - LOG_INFO "测试脚本执行完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_-A.sh b/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_-A.sh deleted file mode 100644 index 82ab871246c..00000000000 --- a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_-A.sh +++ /dev/null @@ -1,81 +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-28 -# @License : Mulan PSL v2 -# @Desc : 测试指定平台名称参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义全局变量 - PACKAGE_NAME="mingw32-filesystem" - CMAKE_PACKAGE="mingw32-cmake" - TEST_COMMAND="$CMAKE_PACKAGE" - TEST_PARAM="-A" - - # 步骤1: 检查yum源中是否存在指定软件包 - LOG_INFO "步骤1: 检查yum源中是否存在$PACKAGE_NAME和$CMAKE_PACKAGE软件包" - dnf list available $PACKAGE_NAME $CMAKE_PACKAGE &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在$PACKAGE_NAME或$CMAKE_PACKAGE软件包" - exit 255 - fi - - # 步骤2: 检查环境是否已安装软件包 - LOG_INFO "步骤2: 检查环境是否已安装$PACKAGE_NAME和$CMAKE_PACKAGE软件包" - INSTALLED=0 - rpm -q $PACKAGE_NAME &>/dev/null && rpm -q $CMAKE_PACKAGE &>/dev/null - if [ $? -eq 0 ]; then - INSTALLED=1 - LOG_INFO "软件包已安装,测试完成后将保持安装状态" - else - LOG_INFO "软件包未安装,将在测试过程中安装并在测试完成后卸载" - fi - - # 步骤3: 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "步骤3: 安装$PACKAGE_NAME和$CMAKE_PACKAGE软件包" - dnf install -y $PACKAGE_NAME $CMAKE_PACKAGE - CHECK_RESULT $? 0 0 "安装软件包失败" - fi - - # 步骤4: 检查命令参数是否支持 - LOG_INFO "步骤4: 检查$TEST_COMMAND命令是否支持$TEST_PARAM参数" - $TEST_COMMAND --help 2>&1 | grep -q "$TEST_PARAM" - if [ $? -ne 0 ]; then - LOG_ERROR "$TEST_COMMAND命令不支持$TEST_PARAM参数" - exit 255 - fi - - # 步骤5: 执行测试命令 - LOG_INFO "步骤5: 执行$TEST_COMMAND $TEST_PARAM命令" - $TEST_COMMAND $TEST_PARAM - CHECK_RESULT $? 0 0 "执行命令失败" - - # 步骤6: 清理环境 - LOG_INFO "步骤6: 清理测试环境" - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载测试安装的软件包" - dnf remove -y $PACKAGE_NAME $CMAKE_PACKAGE - CHECK_RESULT $? 0 0 "卸载软件包失败" - else - LOG_INFO "保持软件包安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_-B.sh b/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_-B.sh deleted file mode 100644 index 526988ab8c8..00000000000 --- a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_-B.sh +++ /dev/null @@ -1,78 +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-28 -# @License : Mulan PSL v2 -# @Desc : 测试指定构建目录参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:测试指定构建目录参数" - - # 检查是否已安装 mingw32-filesystem 和 mingw32-cmake - LOG_INFO "检查是否已安装 mingw32-filesystem 和 mingw32-cmake" - if dnf list installed mingw32-filesystem mingw32-cmake &>/dev/null; then - LOG_INFO "软件包已安装,测试完成后将保持安装状态" - INSTALLED_BEFORE=true - else - LOG_INFO "软件包未安装,将在测试过程中安装并在结束后卸载" - INSTALLED_BEFORE=false - fi - - # 检查 yum 源中是否存在所需软件包 - LOG_INFO "检查 yum 源中是否存在 mingw32-filesystem 和 mingw32-cmake" - if ! dnf list available mingw32-filesystem mingw32-cmake &>/dev/null; then - LOG_ERROR "yum 源中缺少所需软件包" - exit 255 - fi - - # 安装软件包(如果未安装) - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "安装 mingw32-filesystem 和 mingw32-cmake" - dnf install -y mingw32-filesystem mingw32-cmake - CHECK_RESULT $? 0 0 "安装软件包失败" - fi - - # 测试指定构建目录参数 - LOG_INFO "测试指定构建目录参数" - mingw32-cmake -B build_test_directory - CHECK_RESULT $? 0 0 "指定构建目录参数失败" - - # 检查构建目录是否创建成功 - LOG_INFO "检查构建目录是否创建成功" - if [ -d "build_test_directory" ]; then - LOG_INFO "构建目录创建成功" - else - LOG_ERROR "构建目录创建失败" - exit 1 - fi - - # 清理构建目录 - LOG_INFO "清理构建目录" - rm -rf build_test_directory - CHECK_RESULT $? 0 0 "清理构建目录失败" - - # 卸载软件包(如果测试前未安装) - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "卸载 mingw32-filesystem 和 mingw32-cmake" - dnf remove -y mingw32-filesystem mingw32-cmake - CHECK_RESULT $? 0 0 "卸载软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_-C.sh b/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_-C.sh deleted file mode 100644 index 2020f08879c..00000000000 --- a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_-C.sh +++ /dev/null @@ -1,81 +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-28 -# @License : Mulan PSL v2 -# @Desc : 测试预加载缓存脚本参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试预加载缓存脚本参数" - - # 定义软件包名称 - PACKAGE_NAME="mingw32-filesystem" - PACKAGE_NAME2="mingw32-cmake" - - # 检查环境是否已安装 - LOG_INFO "检查环境是否已安装" - if rpm -q ${PACKAGE_NAME} &> /dev/null && rpm -q ${PACKAGE_NAME2} &> /dev/null; then - LOG_INFO "环境已安装,测试结束后保持安装状态" - INSTALLED_BEFORE=true - else - LOG_INFO "环境未安装,将在测试过程中安装" - INSTALLED_BEFORE=false - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否有软件包${PACKAGE_NAME}和${PACKAGE_NAME2}" - if ! dnf list available ${PACKAGE_NAME} &> /dev/null; then - LOG_ERROR "yum源中没有找到软件包${PACKAGE_NAME}" - exit 255 - fi - if ! dnf list available ${PACKAGE_NAME2} &> /dev/null; then - LOG_ERROR "yum源中没有找到软件包${PACKAGE_NAME2}" - exit 255 - fi - - # 安装软件包(如果未安装) - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "安装软件包${PACKAGE_NAME}和${PACKAGE_NAME2}" - dnf install -y ${PACKAGE_NAME} ${PACKAGE_NAME2} - CHECK_RESULT $? 0 0 "安装软件包失败" - fi - - # 测试预加载缓存脚本参数 - LOG_INFO "测试预加载缓存脚本参数" - # 假设预加载缓存脚本为preload_cache.sh,参数为-C - # 检查参数是否存在或不支持 - if ! preload_cache.sh -h 2>&1 | grep -q "\-C"; then - LOG_ERROR "参数-C不存在或不支持" - exit 255 - fi - - # 执行命令并检查结果 - LOG_INFO "执行预加载缓存脚本参数-C" - preload_cache.sh -C - CHECK_RESULT $? 0 0 "执行预加载缓存脚本参数-C失败" - - # 清理环境(如果之前未安装) - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "卸载软件包${PACKAGE_NAME}和${PACKAGE_NAME2}" - dnf remove -y ${PACKAGE_NAME} ${PACKAGE_NAME2} - CHECK_RESULT $? 0 0 "卸载软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_-D.sh b/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_-D.sh deleted file mode 100644 index f6108bd72cd..00000000000 --- a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_-D.sh +++ /dev/null @@ -1,83 +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-28 -# @License : Mulan PSL v2 -# @Desc : 测试创建或更新CMake缓存条目参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 环境检查:判断mingw32-filesystem和mingw32-cmake是否已安装 - LOG_INFO "开始检查mingw32-filesystem和mingw32-cmake是否已安装" - rpm -q mingw32-filesystem mingw32-cmake - if [ $? -eq 0 ]; then - LOG_INFO "检测到mingw32-filesystem和mingw32-cmake已安装,测试后保持安装状态" - INSTALLED=1 - else - LOG_INFO "未检测到mingw32-filesystem和mingw32-cmake安装,将在测试后卸载" - INSTALLED=0 - fi - - # 检查yum源中是否有mingw32-filesystem和mingw32-cmake软件包 - LOG_INFO "检查yum源中是否有mingw32-filesystem软件包" - dnf list available mingw32-filesystem - CHECK_RESULT $? 0 0 "yum源中未找到mingw32-filesystem软件包" - - LOG_INFO "检查yum源中是否有mingw32-cmake软件包" - dnf list available mingw32-cmake - CHECK_RESULT $? 0 0 "yum源中未找到mingw32-cmake软件包" - - # 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "开始安装mingw32-filesystem和mingw32-cmake软件包" - dnf install -y mingw32-filesystem mingw32-cmake - CHECK_RESULT $? 0 0 "安装mingw32-filesystem和mingw32-cmake失败" - LOG_INFO "mingw32-filesystem和mingw32-cmake安装成功" - fi - - # 测试创建或更新CMake缓存条目参数 - LOG_INFO "测试mingw32-cmake -D参数:创建或更新CMake缓存条目" - mingw32-cmake -DCMAKE_BUILD_TYPE=Debug - CHECK_RESULT $? 0 0 "mingw32-cmake -D参数执行失败" - - LOG_INFO "测试mingw32-cmake -D参数:设置多个缓存条目" - mingw32-cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local - CHECK_RESULT $? 0 0 "mingw32-cmake -D多个参数执行失败" - - # 测试不支持的参数 - LOG_INFO "测试mingw32-cmake不支持的参数" - mingw32-cmake -Z - if [ $? -eq 255 ]; then - LOG_INFO "不支持的参数导致退出码255,符合预期" - else - LOG_ERROR "不支持的参数未返回退出码255" - exit 255 - fi - - # 环境清理 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "清理环境:卸载测试安装的软件包" - dnf remove -y mingw32-filesystem mingw32-cmake - CHECK_RESULT $? 0 0 "卸载mingw32-filesystem和mingw32-cmake失败" - LOG_INFO "环境清理完成,恢复到测试前状态" - else - LOG_INFO "环境保持安装状态,无需清理" - fi - - LOG_INFO "测试创建或更新CMake缓存条目参数完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_-E.sh b/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_-E.sh deleted file mode 100644 index 1594b3a13d9..00000000000 --- a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_-E.sh +++ /dev/null @@ -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 : 2026-02-28 -# @License : Mulan PSL v2 -# @Desc : 测试CMake命令模式参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试CMake命令模式参数" - - # 检查软件包是否已在YUM源中 - LOG_INFO "检查mingw32-filesystem和mingw32-cmake软件包是否在YUM源中" - if ! dnf list available mingw32-filesystem mingw32-cmake &>/dev/null; then - LOG_ERROR "YUM源中没有找到mingw32-filesystem或mingw32-cmake软件包" - exit 255 - fi - - # 检查软件包是否已安装 - LOG_INFO "检查mingw32-filesystem和mingw32-cmake软件包是否已安装" - if rpm -q mingw32-filesystem mingw32-cmake &>/dev/null; then - LOG_INFO "软件包已安装,测试结束后保持安装状态" - INSTALLED=true - else - LOG_INFO "软件包未安装,将进行安装" - INSTALLED=false - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装mingw32-filesystem和mingw32-cmake软件包" - dnf install -y mingw32-filesystem mingw32-cmake - CHECK_RESULT $? 0 0 "安装软件包失败" - fi - - # 测试CMake命令模式参数 - LOG_INFO "测试CMake命令模式参数 -E" - if ! mingw32-cmake -E help &>/dev/null; then - LOG_ERROR "CMake命令模式参数 -E 不支持" - exit 255 - fi - - LOG_INFO "执行CMake命令模式参数 -E capabilities" - mingw32-cmake -E capabilities - CHECK_RESULT $? 0 0 "执行CMake命令模式参数失败" - - # 清理环境:如果之前未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载mingw32-filesystem和mingw32-cmake软件包" - dnf remove -y mingw32-filesystem mingw32-cmake - CHECK_RESULT $? 0 0 "卸载软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_-G.sh b/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_-G.sh deleted file mode 100644 index e3f65538dca..00000000000 --- a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_-G.sh +++ /dev/null @@ -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-02-28 -# @License : Mulan PSL v2 -# @Desc : 测试指定构建系统生成器参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义日志函数(根据要求直接使用,这里仅作说明) - # LOG_INFO和LOG_ERROR函数已定义,直接调用 - # CHECK_RESULT函数已定义,直接调用 - - # 定义软件包名称 - PACKAGE_NAME="mingw32-filesystem" - CMAKE_PACKAGE="mingw32-cmake" - - # 步骤1:检查yum源中是否存在指定软件包 - LOG_INFO "步骤1:检查yum源中是否存在${PACKAGE_NAME}和${CMAKE_PACKAGE}软件包" - dnf list available ${PACKAGE_NAME} ${CMAKE_PACKAGE} &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在${PACKAGE_NAME}或${CMAKE_PACKAGE}软件包" - exit 255 - fi - LOG_INFO "yum源中存在${PACKAGE_NAME}和${CMAKE_PACKAGE}软件包" - - # 步骤2:检查是否已安装软件包 - LOG_INFO "步骤2:检查是否已安装${PACKAGE_NAME}和${CMAKE_PACKAGE}软件包" - INSTALLED=false - rpm -q ${PACKAGE_NAME} &>/dev/null && rpm -q ${CMAKE_PACKAGE} &>/dev/null - if [ $? -eq 0 ]; then - LOG_INFO "软件包已安装" - INSTALLED=true - else - LOG_INFO "软件包未安装,将在测试过程中安装" - fi - - # 步骤3:如果未安装,则安装软件包 - if [ "${INSTALLED}" = "false" ]; then - LOG_INFO "步骤3:安装${PACKAGE_NAME}和${CMAKE_PACKAGE}软件包" - dnf install -y ${PACKAGE_NAME} ${CMAKE_PACKAGE} - CHECK_RESULT $? 0 0 "安装软件包失败" - LOG_INFO "软件包安装成功" - fi - - # 步骤4:测试指定构建系统生成器参数 - LOG_INFO "步骤4:测试指定构建系统生成器参数" - # 检查mingw32-cmake是否支持-G参数 - mingw32-cmake --help 2>&1 | grep -q "\-G" - if [ $? -ne 0 ]; then - LOG_ERROR "mingw32-cmake不支持-G参数" - exit 255 - fi - - # 测试-G参数的有效性(示例:检查是否支持"MinGW Makefiles") - LOG_INFO "测试mingw32-cmake -G "MinGW Makefiles" --help" - mingw32-cmake -G "MinGW Makefiles" --help &>/dev/null - CHECK_RESULT $? 0 0 "mingw32-cmake -G参数测试失败" - - # 步骤5:清理环境(如果测试前未安装,则卸载软件包) - if [ "${INSTALLED}" = "false" ]; then - LOG_INFO "步骤5:卸载测试安装的软件包" - dnf remove -y ${PACKAGE_NAME} ${CMAKE_PACKAGE} - CHECK_RESULT $? 0 0 "卸载软件包失败" - LOG_INFO "软件包卸载成功,环境已恢复" - else - LOG_INFO "步骤5:测试前软件包已安装,保持安装状态" - fi - - LOG_INFO "测试完成:指定构建系统生成器参数功能正常" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_-L.sh b/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_-L.sh deleted file mode 100644 index db70b9ec608..00000000000 --- a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_-L.sh +++ /dev/null @@ -1,93 +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-28 -# @License : Mulan PSL v2 -# @Desc : 测试列出非高级缓存变量参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试脚本:测试列出非高级缓存变量参数 - # 测试用例描述:测试列出非高级缓存变量参数 - - # 检查是否已经安装了mingw32-filesystem和mingw32-cmake - LOG_INFO "检查是否已安装mingw32-filesystem和mingw32-cmake软件包" - dnf list installed mingw32-filesystem mingw32-cmake > /dev/null 2>&1 - INSTALLED=$? - - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "软件包已经安装,测试结束后将保持安装状态" - ALREADY_INSTALLED=1 - else - LOG_INFO "软件包未安装,将在测试前安装" - ALREADY_INSTALLED=0 - fi - - # 检查yum源中是否有mingw32-filesystem和mingw32-cmake软件包 - LOG_INFO "检查yum源中是否有mingw32-filesystem软件包" - dnf list available mingw32-filesystem > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中没有mingw32-filesystem软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中没有mingw32-filesystem软件包" - exit 255 - fi - - LOG_INFO "检查yum源中是否有mingw32-cmake软件包" - dnf list available mingw32-cmake > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中没有mingw32-cmake软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中没有mingw32-cmake软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "安装mingw32-filesystem和mingw32-cmake软件包" - dnf install -y mingw32-filesystem mingw32-cmake - CHECK_RESULT $? 0 0 "安装软件包失败" - fi - - # 测试列出非高级缓存变量参数 - LOG_INFO "测试mingw32-cmake -L命令(列出非高级缓存变量)" - mingw32-cmake -L - CHECK_RESULT $? 0 0 "mingw32-cmake -L命令执行失败" - - # 测试不带参数的mingw32-cmake命令 - LOG_INFO "测试不带参数的mingw32-cmake命令" - mingw32-cmake - CHECK_RESULT $? 0 0 "mingw32-cmake命令执行失败" - - # 测试不支持的参数 - LOG_INFO "测试不支持的参数(如-Z)" - mingw32-cmake -Z 2>&1 | grep -q "未知参数" - if [ $? -ne 0 ]; then - LOG_ERROR "不支持的参数未正确处理" - exit 255 - fi - - # 清理环境:如果测试前未安装,则卸载软件包 - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "卸载测试安装的软件包" - dnf remove -y mingw32-filesystem mingw32-cmake - CHECK_RESULT $? 0 0 "卸载软件包失败" - else - LOG_INFO "测试前已安装软件包,保持安装状态" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_-N.sh b/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_-N.sh deleted file mode 100644 index cf02a091731..00000000000 --- a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_-N.sh +++ /dev/null @@ -1,91 +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-28 -# @License : Mulan PSL v2 -# @Desc : 测试仅查看模式参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试仅查看模式参数 - LOG_INFO "开始测试mingw32-filesystem和mingw32-cmake软件包" - - # 定义软件包名称 - PACKAGE1="mingw32-filesystem" - PACKAGE2="mingw32-cmake" - - # 步骤1:检查yum源中是否存在指定软件包 - LOG_INFO "步骤1:检查yum源中是否存在${PACKAGE1}和${PACKAGE2}软件包" - dnf list available ${PACKAGE1} ${PACKAGE2} > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中不存在${PACKAGE1}或${PACKAGE2}软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在${PACKAGE1}或${PACKAGE2}软件包" - exit 255 - fi - - # 步骤2:检查-N参数是否支持 - LOG_INFO "步骤2:检查mingw32-cmake命令是否支持-N参数" - which mingw32-cmake > /dev/null 2>&1 - if [ $? -eq 0 ]; then - # 如果已安装,检查-N参数 - mingw32-cmake -N --help > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "mingw32-cmake命令不支持-N参数" - exit 255 - fi - else - # 如果未安装,先安装再检查 - INSTALL_FLAG=1 - fi - - # 步骤3:安装软件包(如果未安装) - if [ "${INSTALL_FLAG}" = "1" ]; then - LOG_INFO "步骤3:安装${PACKAGE1}和${PACKAGE2}软件包" - dnf install -y ${PACKAGE1} ${PACKAGE2} - CHECK_RESULT $? 0 0 "安装${PACKAGE1}和${PACKAGE2}软件包失败" - - # 安装后检查-N参数 - LOG_INFO "步骤4:检查mingw32-cmake命令的-N参数" - mingw32-cmake -N --help > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "mingw32-cmake命令不支持-N参数" - # 清理安装的软件包 - dnf remove -y ${PACKAGE1} ${PACKAGE2} - exit 255 - fi - else - LOG_INFO "步骤3:软件包已安装,跳过安装步骤" - fi - - # 步骤4:测试-N参数功能 - LOG_INFO "步骤5:测试mingw32-cmake -N参数功能" - mingw32-cmake -N --version > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "执行mingw32-cmake -N --version命令失败" - - # 步骤5:清理环境 - LOG_INFO "步骤6:清理测试环境" - if [ "${INSTALL_FLAG}" = "1" ]; then - LOG_INFO "卸载测试安装的软件包" - dnf remove -y ${PACKAGE1} ${PACKAGE2} - CHECK_RESULT $? 0 0 "卸载${PACKAGE1}和${PACKAGE2}软件包失败" - else - LOG_INFO "测试前已安装软件包,保持安装状态" - fi - - LOG_INFO "测试完成:mingw32-cmake -N参数功能正常" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_-P.sh b/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_-P.sh deleted file mode 100644 index 50b4ba49d1f..00000000000 --- a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_-P.sh +++ /dev/null @@ -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-02-28 -# @License : Mulan PSL v2 -# @Desc : 测试处理脚本模式参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试处理脚本模式参数" - LOG_INFO "步骤1:检查yum源中是否存在mingw32-filesystem和mingw32-cmake软件包" - dnf list available mingw32-filesystem mingw32-cmake > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中缺少mingw32-filesystem或mingw32-cmake软件包" - exit 255 - fi - - LOG_INFO "步骤2:检查环境是否已安装目标软件包" - rpm -q mingw32-filesystem mingw32-cmake > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "环境已安装目标软件包,标记为已安装状态" - INSTALLED=true - else - LOG_INFO "环境未安装目标软件包,标记为未安装状态" - INSTALLED=false - fi - - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤3:安装mingw32-filesystem和mingw32-cmake软件包" - dnf install -y mingw32-filesystem mingw32-cmake - CHECK_RESULT $? 0 0 "安装软件包失败" - fi - - LOG_INFO "步骤4:测试处理脚本模式参数 -P" - mingw32-cmake -P > /dev/null 2>&1 - if [ $? -eq 255 ]; then - LOG_INFO "参数-P不存在或不支持,符合预期" - else - LOG_ERROR "参数-P存在或支持,不符合预期" - exit 255 - fi - - LOG_INFO "步骤5:清理环境,恢复到之前的状态" - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载之前安装的软件包" - dnf remove -y mingw32-filesystem mingw32-cmake - CHECK_RESULT $? 0 0 "卸载软件包失败" - else - LOG_INFO "环境已安装,保持安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_-S.sh b/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_-S.sh deleted file mode 100644 index a3f0b394fb3..00000000000 --- a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_-S.sh +++ /dev/null @@ -1,67 +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-28 -# @License : Mulan PSL v2 -# @Desc : 测试指定源目录参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装mingw32-filesystem和mingw32-cmake - LOG_INFO "检查mingw32-filesystem和mingw32-cmake是否已安装" - rpm -q mingw32-filesystem mingw32-cmake &>/dev/null - INSTALLED=$? - - # 如果未安装,则执行安装步骤 - if [ $INSTALLED -ne 0 ]; then - LOG_INFO "软件包未安装,开始安装步骤" - - # 检查yum源中是否有mingw32-filesystem软件包 - LOG_INFO "检查yum源中是否有mingw32-filesystem软件包" - dnf list available mingw32-filesystem &>/dev/null - CHECK_RESULT $? 0 255 "yum源中未找到mingw32-filesystem软件包" - - # 检查yum源中是否有mingw32-cmake软件包 - LOG_INFO "检查yum源中是否有mingw32-cmake软件包" - dnf list available mingw32-cmake &>/dev/null - CHECK_RESULT $? 0 255 "yum源中未找到mingw32-cmake软件包" - - # 安装软件包 - LOG_INFO "安装mingw32-filesystem和mingw32-cmake软件包" - dnf install -y mingw32-filesystem mingw32-cmake - CHECK_RESULT $? 0 0 "安装软件包失败" - else - LOG_INFO "软件包已安装,跳过安装步骤" - fi - - # 测试指定源目录参数 - LOG_INFO "测试指定源目录参数" - mingw32-cmake -S /tmp/test_source_dir &>/dev/null - CHECK_RESULT $? 0 255 "mingw32-cmake不支持-S参数或参数不存在" - - # 清理环境:如果脚本开始前未安装,则卸载软件包 - if [ $INSTALLED -ne 0 ]; then - LOG_INFO "清理环境:卸载安装的软件包" - dnf remove -y mingw32-filesystem mingw32-cmake - CHECK_RESULT $? 0 0 "卸载软件包失败" - else - LOG_INFO "环境已安装,保持安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_-T.sh b/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_-T.sh deleted file mode 100644 index 1c042f77db1..00000000000 --- a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_-T.sh +++ /dev/null @@ -1,76 +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-28 -# @License : Mulan PSL v2 -# @Desc : 测试指定工具集名称参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已经安装了指定的软件包 - LOG_INFO "检查是否已经安装了mingw32-filesystem和mingw32-cmake软件包" - if rpm -q mingw32-filesystem mingw32-cmake > /dev/null 2>&1; then - LOG_INFO "软件包已经安装,标记为已安装状态" - INSTALLED=1 - else - LOG_INFO "软件包未安装,标记为未安装状态" - INSTALLED=0 - fi - - # 检查yum源中是否存在指定的软件包 - LOG_INFO "检查yum源中是否存在mingw32-filesystem和mingw32-cmake软件包" - if ! dnf list available mingw32-filesystem mingw32-cmake > /dev/null 2>&1; then - LOG_ERROR "yum源中不存在mingw32-filesystem或mingw32-cmake软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "开始安装mingw32-filesystem和mingw32-cmake软件包" - dnf install -y mingw32-filesystem mingw32-cmake - CHECK_RESULT $? 0 0 "安装mingw32-filesystem和mingw32-cmake失败" - LOG_INFO "软件包安装成功" - fi - - # 测试指定工具集名称参数 - LOG_INFO "测试指定工具集名称参数" - # 检查是否支持 -T 参数 - if ! mingw32-cmake --help | grep -q "\-T"; then - LOG_ERROR "mingw32-cmake不支持-T参数" - exit 255 - fi - - # 执行带 -T 参数的mingw32-cmake命令 - LOG_INFO "执行mingw32-cmake -T命令" - mingw32-cmake -T - CHECK_RESULT $? 0 0 "mingw32-cmake -T命令执行失败" - - LOG_INFO "指定工具集名称参数测试完成" - - # 清理环境,恢复到之前的状态 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载在测试过程中安装的软件包" - dnf remove -y mingw32-filesystem mingw32-cmake - CHECK_RESULT $? 0 0 "卸载mingw32-filesystem和mingw32-cmake失败" - LOG_INFO "软件包卸载成功,环境已恢复" - else - LOG_INFO "测试前软件包已安装,保持安装状态" - fi - - LOG_INFO "测试脚本执行完毕" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_-U.sh b/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_-U.sh deleted file mode 100644 index 2acbf3ac733..00000000000 --- a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_-U.sh +++ /dev/null @@ -1,111 +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-28 -# @License : Mulan PSL v2 -# @Desc : 测试从CMake缓存中移除匹配条目参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断是否已安装mingw32-filesystem和mingw32-cmake - LOG_INFO "检查是否已安装mingw32-filesystem和mingw32-cmake" - rpm -q mingw32-filesystem mingw32-cmake > /dev/null 2>&1 - INSTALLED=$? - - # 定义软件包列表 - PACKAGES="mingw32-filesystem mingw32-cmake" - - # 检查yum源中是否有这些软件包 - LOG_INFO "检查yum源中是否有mingw32-filesystem和mingw32-cmake软件包" - for pkg in $PACKAGES; do - dnf list available $pkg > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中没有找到$pkg软件包" - exit 255 - fi - done - - # 如果未安装,则安装软件包 - if [ $INSTALLED -ne 0 ]; then - LOG_INFO "安装mingw32-filesystem和mingw32-cmake软件包" - dnf install -y $PACKAGES - CHECK_RESULT $? 0 0 "安装mingw32-filesystem和mingw32-cmake失败" - fi - - # 测试-U参数功能 - LOG_INFO "测试mingw32-cmake -U参数功能" - LOG_INFO "步骤1: 创建测试CMakeLists.txt文件" - cat > CMakeLists.txt << EOF - cmake_minimum_required(VERSION 3.10) - project(TestProject) - set(TEST_VAR "test_value") - EOF - CHECK_RESULT $? 0 0 "创建CMakeLists.txt失败" - - LOG_INFO "步骤2: 创建build目录并生成CMake缓存" - mkdir -p build - cd build - mingw32-cmake .. > ../cmake_output.log 2>&1 - CHECK_RESULT $? 0 0 "CMake配置失败" - - LOG_INFO "步骤3: 检查TEST_VAR是否存在于缓存中" - grep "TEST_VAR" CMakeCache.txt > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "TEST_VAR未在CMake缓存中找到" - - LOG_INFO "步骤4: 使用-U参数从缓存中移除TEST_VAR" - mingw32-cmake -U TEST_VAR . > ../remove_output.log 2>&1 - CHECK_RESULT $? 0 0 "使用-U参数移除变量失败" - - LOG_INFO "步骤5: 验证TEST_VAR是否已从缓存中移除" - grep "TEST_VAR" CMakeCache.txt > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_ERROR "TEST_VAR仍然存在于CMake缓存中" - CHECK_RESULT 1 0 0 "TEST_VAR未成功从缓存中移除" - else - LOG_INFO "TEST_VAR已成功从CMake缓存中移除" - CHECK_RESULT 0 0 0 "TEST_VAR移除验证失败" - fi - - # 测试不支持的参数 - LOG_INFO "步骤6: 测试不支持的参数" - mingw32-cmake --nonexistent-param . > /dev/null 2>&1 - if [ $? -eq 255 ]; then - LOG_INFO "不支持的参数正确处理" - CHECK_RESULT 0 0 0 "不支持的参数处理失败" - else - LOG_ERROR "不支持的参数未正确处理" - exit 255 - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - cd .. - rm -rf build CMakeLists.txt cmake_output.log remove_output.log - CHECK_RESULT $? 0 0 "清理测试文件失败" - - # 如果脚本开始时未安装,则卸载软件包 - if [ $INSTALLED -ne 0 ]; then - LOG_INFO "卸载测试安装的软件包" - dnf remove -y $PACKAGES - CHECK_RESULT $? 0 0 "卸载mingw32-filesystem和mingw32-cmake失败" - else - LOG_INFO "保持原有安装状态,不卸载软件包" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_-Wdeprecated.sh b/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_-Wdeprecated.sh deleted file mode 100644 index 7a4b98a175e..00000000000 --- a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_-Wdeprecated.sh +++ /dev/null @@ -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 : 2026-02-28 -# @License : Mulan PSL v2 -# @Desc : 测试启用废弃警告参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:测试启用废弃警告参数" - LOG_INFO "步骤1:检查是否已安装 mingw32-filesystem 和 mingw32-cmake 包" - if dnf list installed mingw32-filesystem mingw32-cmake &> /dev/null; then - LOG_INFO "软件包已安装,脚本结束后将保持安装状态" - INSTALLED_BEFORE=1 - else - LOG_INFO "软件包未安装,将在测试步骤中安装" - INSTALLED_BEFORE=0 - fi - LOG_INFO "步骤2:检查yum源中是否存在 mingw32-filesystem 和 mingw32-cmake 包" - if ! dnf list available mingw32-filesystem mingw32-cmake &> /dev/null; then - LOG_ERROR "yum源中缺少 mingw32-filesystem 或 mingw32-cmake 包" - exit 255 - fi - LOG_INFO "步骤3:如果未安装,则安装软件包" - if [ $INSTALLED_BEFORE -eq 0 ]; then - dnf install -y mingw32-filesystem mingw32-cmake - CHECK_RESULT $? 0 0 "安装 mingw32-filesystem 和 mingw32-cmake 失败" - fi - LOG_INFO "步骤4:检查 mingw32-cmake 是否支持 -Wdeprecated 参数" - mingw32-cmake --help | grep -q -- "-Wdeprecated" - if [ $? -ne 0 ]; then - LOG_ERROR "mingw32-cmake 不支持 -Wdeprecated 参数" - exit 255 - fi - LOG_INFO "步骤5:使用 -Wdeprecated 参数执行 mingw32-cmake 命令" - mingw32-cmake -Wdeprecated - CHECK_RESULT $? 0 0 "执行 mingw32-cmake -Wdeprecated 失败" - LOG_INFO "步骤6:清理环境,如果脚本开始时未安装,则卸载软件包" - if [ $INSTALLED_BEFORE -eq 0 ]; then - dnf remove -y mingw32-filesystem mingw32-cmake - CHECK_RESULT $? 0 0 "卸载 mingw32-filesystem 和 mingw32-cmake 失败" - fi - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_-Wdev.sh b/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_-Wdev.sh deleted file mode 100644 index 38debcf911e..00000000000 --- a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_-Wdev.sh +++ /dev/null @@ -1,77 +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-28 -# @License : Mulan PSL v2 -# @Desc : 测试启用开发者警告参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试启用开发者警告参数" - - # 检查是否已安装 mingw32-filesystem 和 mingw32-cmake - LOG_INFO "检查是否已安装 mingw32-filesystem 和 mingw32-cmake" - rpm -q mingw32-filesystem mingw32-cmake > /dev/null 2>&1 - installed=$? - - # 检查yum源中是否有相关软件包 - LOG_INFO "检查yum源中是否有 mingw32-filesystem 和 mingw32-cmake" - dnf list available mingw32-filesystem mingw32-cmake > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中未找到 mingw32-filesystem 或 mingw32-cmake 软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中缺少必要的软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $installed -ne 0 ]; then - LOG_INFO "安装 mingw32-filesystem 和 mingw32-cmake" - dnf install -y mingw32-filesystem mingw32-cmake - CHECK_RESULT $? 0 0 "安装 mingw32-filesystem 和 mingw32-cmake 失败" - # 设置标记,表示脚本安装的软件包,需要在结束时卸载 - need_cleanup=1 - else - LOG_INFO "mingw32-filesystem 和 mingw32-cmake 已安装" - need_cleanup=0 - fi - - # 测试启用开发者警告参数 - LOG_INFO "测试 mingw32-cmake 的 -Wdev 参数" - mingw32-cmake -Wdev --help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "mingw32-cmake 不支持 -Wdev 参数" - if [ $? -ne 0 ]; then - LOG_ERROR "-Wdev 参数不存在或不支持" - exit 255 - fi - - # 实际执行带 -Wdev 参数的示例命令 - LOG_INFO "执行带 -Wdev 参数的 mingw32-cmake 命令" - mingw32-cmake -Wdev -S . -B build 2>&1 | grep -q "CMake Warning" - CHECK_RESULT $? 0 0 "未检测到开发者警告,-Wdev 参数可能未生效" - - # 清理环境:如果脚本安装了软件包,则卸载 - if [ $need_cleanup -eq 1 ]; then - LOG_INFO "卸载之前安装的 mingw32-filesystem 和 mingw32-cmake" - dnf remove -y mingw32-filesystem mingw32-cmake - CHECK_RESULT $? 0 0 "卸载 mingw32-filesystem 和 mingw32-cmake 失败" - else - LOG_INFO "保持 mingw32-filesystem 和 mingw32-cmake 的安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_-Werror_dev.sh b/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_-Werror_dev.sh deleted file mode 100644 index ac09fc8859b..00000000000 --- a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_-Werror_dev.sh +++ /dev/null @@ -1,89 +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-28 -# @License : Mulan PSL v2 -# @Desc : 测试使开发者警告成为错误参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否以root用户运行 - if [ "$(id -u)" -ne 0 ]; then - LOG_ERROR "请以root用户运行此脚本" - exit 1 - fi - - # 定义软件包名称 - PACKAGE_NAME="mingw32-filesystem" - CMAKE_PACKAGE="mingw32-cmake" - TEST_PARAM="-Werror" - - # 步骤1: 检查yum源中是否存在指定的软件包 - LOG_INFO "步骤1: 检查yum源中是否存在软件包 ${PACKAGE_NAME} 和 ${CMAKE_PACKAGE}" - dnf list available ${PACKAGE_NAME} ${CMAKE_PACKAGE} > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中未找到软件包 ${PACKAGE_NAME} 或 ${CMAKE_PACKAGE}" - if [ $? -ne 0 ]; then - exit 255 - fi - - # 步骤2: 检查环境是否已安装指定软件包 - LOG_INFO "步骤2: 检查环境是否已安装软件包 ${PACKAGE_NAME} 和 ${CMAKE_PACKAGE}" - INSTALLED=0 - if rpm -q ${PACKAGE_NAME} > /dev/null 2>&1 && rpm -q ${CMAKE_PACKAGE} > /dev/null 2>&1; then - INSTALLED=1 - LOG_INFO "软件包已安装,脚本结束后将保持安装状态" - else - LOG_INFO "软件包未安装,将在测试过程中安装" - fi - - # 步骤3: 安装软件包(如果未安装) - if [ ${INSTALLED} -eq 0 ]; then - LOG_INFO "步骤3: 安装软件包 ${PACKAGE_NAME} 和 ${CMAKE_PACKAGE}" - dnf install -y ${PACKAGE_NAME} ${CMAKE_PACKAGE} - CHECK_RESULT $? 0 0 "安装软件包失败" - fi - - # 步骤4: 检查mingw32-cmake命令是否支持-Werror参数 - LOG_INFO "步骤4: 检查mingw32-cmake命令是否支持 ${TEST_PARAM} 参数" - mingw32-cmake --help 2>&1 | grep -q "${TEST_PARAM}" - CHECK_RESULT $? 0 0 "mingw32-cmake命令不支持 ${TEST_PARAM} 参数" - if [ $? -ne 0 ]; then - # 清理环境(如果之前安装了软件包) - if [ ${INSTALLED} -eq 0 ]; then - dnf remove -y ${PACKAGE_NAME} ${CMAKE_PACKAGE} - fi - exit 255 - fi - - # 步骤5: 测试使用-Werror参数 - LOG_INFO "步骤5: 测试使用 ${TEST_PARAM} 参数" - mingw32-cmake ${TEST_PARAM} --version > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "使用 ${TEST_PARAM} 参数执行失败" - - # 步骤6: 清理环境 - LOG_INFO "步骤6: 清理环境" - if [ ${INSTALLED} -eq 0 ]; then - LOG_INFO "卸载测试安装的软件包" - dnf remove -y ${PACKAGE_NAME} ${CMAKE_PACKAGE} - CHECK_RESULT $? 0 0 "卸载软件包失败" - else - LOG_INFO "保持软件包安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_-Wno-dev.sh b/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_-Wno-dev.sh deleted file mode 100644 index 79f21f4aa40..00000000000 --- a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_-Wno-dev.sh +++ /dev/null @@ -1,93 +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-28 -# @License : Mulan PSL v2 -# @Desc : 测试抑制开发者警告参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断当前是否已安装指定软件包 - check_installed() { - dnf list installed | grep -q "$1" - return $? - } - - # 检查软件包是否在yum源中 - check_package_in_repo() { - dnf list available "$1" &> /dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 $1 不在yum源中" - exit 255 - fi - } - - # 检查参数是否支持 - check_parameter_support() { - if ! mingw32-cmake --help 2>&1 | grep -q "$1"; then - LOG_ERROR "参数 $1 不存在或不支持" - exit 255 - fi - } - - # 记录初始安装状态 - initial_install_state=false - - LOG_INFO "开始测试抑制开发者警告参数" - - # 检查软件包是否已安装 - if check_installed "mingw32-filesystem"; then - LOG_INFO "检测到 mingw32-filesystem 已安装" - initial_install_state=true - else - LOG_INFO "检测到 mingw32-filesystem 未安装" - fi - - # 检查软件包是否在yum源中 - LOG_INFO "检查软件包是否在yum源中" - check_package_in_repo "mingw32-filesystem" - check_package_in_repo "mingw32-cmake" - - # 如果未安装,则安装软件包 - if [ "$initial_install_state" = false ]; then - LOG_INFO "安装 mingw32-filesystem 和 mingw32-cmake" - dnf install -y mingw32-filesystem mingw32-cmake - CHECK_RESULT $? 0 0 "安装软件包失败" - fi - - # 检查参数支持 - LOG_INFO "检查 -Wno-dev 参数是否支持" - check_parameter_support "-Wno-dev" - - # 测试抑制开发者警告参数 - LOG_INFO "执行测试命令:mingw32-cmake -Wno-dev" - mingw32-cmake -Wno-dev - CHECK_RESULT $? 0 0 "执行 mingw32-cmake -Wno-dev 失败" - - # 环境清理 - LOG_INFO "清理测试环境" - if [ "$initial_install_state" = false ]; then - LOG_INFO "卸载测试安装的软件包" - dnf remove -y mingw32-filesystem mingw32-cmake - CHECK_RESULT $? 0 0 "卸载软件包失败" - else - LOG_INFO "保持原有安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_-h.sh b/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_-h.sh deleted file mode 100644 index 5cc659766ea..00000000000 --- a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_-h.sh +++ /dev/null @@ -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 : 2026-02-28 -# @License : Mulan PSL v2 -# @Desc : 测试打印使用信息并退出参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装所需软件包 - LOG_INFO "检查是否已安装mingw32-filesystem和mingw32-cmake软件包" - rpm -q mingw32-filesystem mingw32-cmake > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "软件包已安装,标记为已存在安装状态" - INSTALLED_ALREADY=1 - else - LOG_INFO "软件包未安装,标记为未安装状态" - INSTALLED_ALREADY=0 - fi - - # 检查yum源中是否存在所需软件包 - LOG_INFO "检查yum源中是否存在mingw32-filesystem和mingw32-cmake软件包" - dnf list available mingw32-filesystem mingw32-cmake > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到mingw32-filesystem或mingw32-cmake软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED_ALREADY -eq 0 ]; then - LOG_INFO "开始安装mingw32-filesystem和mingw32-cmake软件包" - dnf install -y mingw32-filesystem mingw32-cmake - CHECK_RESULT $? 0 0 "安装mingw32-filesystem和mingw32-cmake失败" - fi - - # 测试打印使用信息并退出参数 - LOG_INFO "测试mingw32-cmake -h命令,检查是否支持-h参数" - mingw32-cmake -h > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "mingw32-cmake -h命令执行成功,参数支持" - CHECK_RESULT $? 0 0 "mingw32-cmake -h命令执行失败" - else - LOG_ERROR "mingw32-cmake不支持-h参数" - exit 255 - fi - - # 环境恢复 - if [ $INSTALLED_ALREADY -eq 0 ]; then - LOG_INFO "清理环境:卸载测试安装的软件包" - dnf remove -y mingw32-filesystem mingw32-cmake - CHECK_RESULT $? 0 0 "卸载mingw32-filesystem和mingw32-cmake失败" - else - LOG_INFO "环境已安装,保持安装状态" - fi -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_default.sh b/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_default.sh deleted file mode 100644 index d6eb7e8949f..00000000000 --- a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-cmake_default.sh +++ /dev/null @@ -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-11-30 -# @License : Mulan PSL v2 -# @Desc : 测试 mingw32-cmake 命令的默认行为 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 mingw32-cmake 命令的默认行为" - - # 检查是否已安装 mingw32-filesystem 和 mingw32-cmake - LOG_INFO "检查是否已安装 mingw32-filesystem 和 mingw32-cmake" - dnf list installed mingw32-filesystem mingw32-cmake > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "mingw32-filesystem 和 mingw32-cmake 已安装" - INSTALLED=1 - else - LOG_INFO "mingw32-filesystem 和 mingw32-cmake 未安装" - INSTALLED=0 - fi - - # 检查 yum 源中是否有 mingw32-filesystem 和 mingw32-cmake - LOG_INFO "检查 yum 源中是否有 mingw32-filesystem 和 mingw32-cmake" - dnf list available mingw32-filesystem mingw32-cmake > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum 源中未找到 mingw32-filesystem 或 mingw32-cmake" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装 mingw32-filesystem 和 mingw32-cmake" - dnf install -y mingw32-filesystem mingw32-cmake - CHECK_RESULT $? 0 0 "安装失败" - fi - - # 测试 mingw32-cmake 命令的默认行为 - LOG_INFO "测试 mingw32-cmake 命令的默认行为" - mingW_CMake_Output=$(mingW_CMake --help 2>&1) - CHECK_RESULT $? 0 0 "mingw_CMake --help 执行失败" - - #如果未安装,则在脚本结束前卸载软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载 mingW_filesystem 和 mingW_CMake" - dnf remove -y mingW_filesystem mingW_CMake - CHECK_RESULT $? 0 0 “卸载失败” - fi - - LOG_INFO “测试完成” -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-configure_build.sh b/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-configure_build.sh deleted file mode 100644 index 84a4656fd94..00000000000 --- a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-configure_build.sh +++ /dev/null @@ -1,91 +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-28 -# @License : Mulan PSL v2 -# @Desc : 测试 mingw32-configure 命令的 --build 参数以指定构建系统 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断当前环境是否已安装mingw32-filesystem和mingw32-configure - LOG_INFO "检查是否已安装mingw32-filesystem和mingw32-configure" - rpm -q mingw32-filesystem mingw32-configure > /dev/null 2>&1 - installed_status=$? - - # 记录初始安装状态 - initial_installed=false - if [ $installed_status -eq 0 ]; then - initial_installed=true - LOG_INFO "检测到mingw32-filesystem和mingw32-configure已安装" - else - LOG_INFO "检测到mingw32-filesystem和mingw32-configure未安装" - fi - - # 检查yum源中是否有相关软件包 - LOG_INFO "检查yum源中是否有mingw32-filesystem和mingw32-configure软件包" - dnf list available mingw32-filesystem mingw32-configure > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中缺少mingw32-filesystem或mingw32-configure软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中缺少必要的软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$initial_installed" = "false" ]; then - LOG_INFO "开始安装mingw32-filesystem和mingw32-configure" - dnf install -y mingw32-filesystem mingw32-configure - CHECK_RESULT $? 0 0 "安装mingw32-filesystem和mingw32-configure失败" - fi - - # 测试mingw32-configure命令的--build参数 - LOG_INFO "测试mingw32-configure命令的--build参数" - mingw32-configure --build > /dev/null 2>&1 - if [ $? -eq 255 ]; then - LOG_ERROR "--build参数不存在或不支持" - exit 255 - fi - - LOG_INFO "执行mingw32-configure --build=i686-pc-mingw32" - mingw32-configure --build=i686-pc-mingw32 - CHECK_RESULT $? 0 0 "执行mingw32-configure --build=i686-pc-mingw32失败" - - LOG_INFO "执行mingw32-configure --build=x86_64-w64-mingw32" - mingw32-configure --build=x86_64-w64-mingw32 - CHECK_RESULT $? 0 0 "执行mingw32-configure --build=x86_64-w64-mingw32失败" - - # 测试不支持的构建系统参数 - LOG_INFO "测试不支持的构建系统参数:--build=unsupported-arch" - mingw32-configure --build=unsupported-arch > /dev/null 2>&1 - if [ $? -eq 255 ]; then - LOG_INFO "检测到不支持的构建系统参数,符合预期" - else - LOG_ERROR "不支持的构建系统参数未正确识别" - exit 255 - fi - - # 环境清理:如果初始状态未安装,则卸载软件包 - if [ "$initial_installed" = "false" ]; then - LOG_INFO "清理环境:卸载mingw32-filesystem和mingw32-configure" - dnf remove -y mingw32-filesystem mingw32-configure - CHECK_RESULT $? 0 0 "卸载mingw32-filesystem和mingw32-configure失败" - else - LOG_INFO "保持初始安装状态,不卸载软件包" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-configure_cc.sh b/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-configure_cc.sh deleted file mode 100644 index 0f470079c70..00000000000 --- a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-configure_cc.sh +++ /dev/null @@ -1,81 +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-28 -# @License : Mulan PSL v2 -# @Desc : 测试 mingw32-configure 命令的 CC 环境变量或参数以指定 C 编译器 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装mingw32-filesystem和mingw32-configure - LOG_INFO "检查是否已安装mingw32-filesystem和mingw32-configure" - rpm -q mingw32-filesystem mingw32-configure > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "检测到已安装mingw32-filesystem和mingw32-configure,脚本结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "未安装mingw32-filesystem和mingw32-configure,将在测试过程中安装" - INSTALLED=false - fi - - # 检查yum源中是否有mingw32-filesystem和mingw32-configure软件包 - LOG_INFO "检查yum源中是否有mingw32-filesystem和mingw32-configure软件包" - dnf list available mingw32-filesystem mingw32-configure > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中没有mingw32-filesystem或mingw32-configure软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中没有mingw32-filesystem或mingw32-configure软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装mingw32-filesystem和mingw32-configure软件包" - dnf install -y mingw32-filesystem mingw32-configure - CHECK_RESULT $? 0 0 "安装mingw32-filesystem和mingw32-configure失败" - fi - - # 测试mingw32-configure命令的CC环境变量 - LOG_INFO "测试mingw32-configure命令的CC环境变量" - export CC="i686-w64-mingw32-gcc" - mingw32-configure --help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "使用CC环境变量执行mingw32-configure失败" - - # 测试mingw32-configure命令的CC参数 - LOG_INFO "测试mingw32-configure命令的CC参数" - mingw32-configure --help 2>&1 | grep -q "\-\-cc" - if [ $? -eq 0 ]; then - LOG_INFO "mingw32-configure支持--cc参数" - mingw32-configure --cc="i686-w64-mingw32-gcc" --help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "使用--cc参数执行mingw32-configure失败" - else - LOG_ERROR "mingw32-configure不支持--cc参数" - exit 255 - fi - - # 清理环境 - LOG_INFO "清理测试环境" - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载mingw32-filesystem和mingw32-configure软件包" - dnf remove -y mingw32-filesystem mingw32-configure - CHECK_RESULT $? 0 0 "卸载mingw32-filesystem和mingw32-configure失败" - else - LOG_INFO "保持mingw32-filesystem和mingw32-configure软件包安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-configure_cflags.sh b/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-configure_cflags.sh deleted file mode 100644 index 7325df51bb7..00000000000 --- a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-configure_cflags.sh +++ /dev/null @@ -1,99 +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-28 -# @License : Mulan PSL v2 -# @Desc : 测试 mingw32-configure 命令的 CFLAGS 环境变量或参数以指定 C 编译器标志 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义日志函数 - LOG_INFO() { - echo "[INFO] $*" - } - - LOG_ERROR() { - echo "[ERROR] $*" - } - - # 定义软件包名称和命令 - PACKAGE_NAME="mingw32-filesystem" - COMMAND="mingw32-configure" - ENV_VAR="CFLAGS" - TEST_VALUE="-O2 -g" - - # 步骤1:检查yum源中是否存在指定软件包 - LOG_INFO "步骤1:检查yum源中是否存在软件包 $PACKAGE_NAME" - if ! dnf list available "$PACKAGE_NAME" &>/dev/null; then - LOG_ERROR "软件包 $PACKAGE_NAME 在yum源中不存在" - exit 255 - fi - - # 步骤2:检查当前环境是否已安装指定软件包 - LOG_INFO "步骤2:检查当前环境是否已安装软件包 $PACKAGE_NAME" - if rpm -q "$PACKAGE_NAME" &>/dev/null; then - LOG_INFO "软件包 $PACKAGE_NAME 已安装,脚本结束时将保持安装状态" - INSTALLED_BEFORE=true - else - LOG_INFO "软件包 $PACKAGE_NAME 未安装,将在测试过程中安装" - INSTALLED_BEFORE=false - fi - - # 步骤3:如果未安装,则安装软件包 - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "步骤3:安装软件包 $PACKAGE_NAME" - dnf install -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "安装软件包 $PACKAGE_NAME 失败" - fi - - # 步骤4:检查 mingw32-configure 命令是否存在 - LOG_INFO "步骤4:检查 $COMMAND 命令是否存在" - if ! command -v "$COMMAND" &>/dev/null; then - LOG_ERROR "命令 $COMMAND 不存在" - exit 255 - fi - - # 步骤5:测试 CFLAGS 环境变量设置 - LOG_INFO "步骤5:测试通过环境变量 $ENV_VAR 指定 C 编译器标志" - export $ENV_VAR="$TEST_VALUE" - $COMMAND --help 2>&1 | grep -q "$TEST_VALUE" - CHECK_RESULT $? 0 0 "通过环境变量 $ENV_VAR 设置 C 编译器标志失败" - - # 步骤6:测试 CFLAGS 参数设置 - LOG_INFO "步骤6:测试通过参数 $ENV_VAR 指定 C 编译器标志" - $COMMAND --help 2>&1 | grep -q "$ENV_VAR" - if [ $? -ne 0 ]; then - LOG_ERROR "参数 $ENV_VAR 不被 $COMMAND 命令支持" - exit 255 - fi - - # 步骤7:清理环境变量 - LOG_INFO "步骤7:清理环境变量 $ENV_VAR" - unset $ENV_VAR - - # 步骤8:如果之前未安装,则卸载软件包 - if [ "$INSTALLED_BEFORE" = false ]; then - LOG_INFO "步骤8:卸载软件包 $PACKAGE_NAME" - dnf remove -y "$PACKAGE_NAME" - CHECK_RESULT $? 0 0 "卸载软件包 $PACKAGE_NAME 失败" - else - LOG_INFO "步骤8:保持软件包 $PACKAGE_NAME 的安装状态" - fi - - LOG_INFO "测试完成:mingw32-configure 命令的 CFLAGS 环境变量和参数测试通过" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-configure_cxx.sh b/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-configure_cxx.sh deleted file mode 100644 index aa6826b6788..00000000000 --- a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-configure_cxx.sh +++ /dev/null @@ -1,141 +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-28 -# @License : Mulan PSL v2 -# @Desc : 测试 mingw32-configure 命令的 CXX 环境变量或参数以指定 C++ 编译器 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试脚本开始 - - # 定义软件包名称 - PACKAGE_NAME="mingw32-filesystem" - - # 步骤1:检查yum源中是否存在指定软件包 - LOG_INFO "步骤1:检查yum源中是否存在软件包 $PACKAGE_NAME" - dnf list available $PACKAGE_NAME > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 $PACKAGE_NAME 在yum源中不存在" - exit 255 - fi - LOG_INFO "软件包 $PACKAGE_NAME 存在于yum源中" - - # 步骤2:检查系统是否已安装指定软件包 - LOG_INFO "步骤2:检查系统是否已安装软件包 $PACKAGE_NAME" - rpm -q $PACKAGE_NAME > /dev/null 2>&1 - if [ $? -eq 0 ]; then - INSTALLED=true - LOG_INFO "软件包 $PACKAGE_NAME 已安装" - else - INSTALLED=false - LOG_INFO "软件包 $PACKAGE_NAME 未安装" - fi - - # 步骤3:如果未安装,则安装软件包 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "步骤3:安装软件包 $PACKAGE_NAME" - dnf install -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "安装软件包 $PACKAGE_NAME 失败" - LOG_INFO "软件包 $PACKAGE_NAME 安装成功" - fi - - # 步骤4:测试 mingw32-configure 命令的 CXX 环境变量功能 - LOG_INFO "步骤4:测试 mingw32-configure 命令的 CXX 环境变量功能" - - # 检查 mingw32-configure 命令是否存在 - LOG_INFO "检查 mingw32-configure 命令是否存在" - which mingw32-configure > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "mingw32-configure 命令不存在" - exit 255 - fi - - # 测试 CXX 环境变量 - LOG_INFO "设置 CXX 环境变量为指定 C++ 编译器" - export CXX="i686-w64-mingw32-g++" - - # 执行 mingw32-configure 命令并检查是否支持 CXX 参数 - LOG_INFO "执行 mingw32-configure 命令并检查 CXX 参数支持" - mingw32-configure --help | grep -q "CXX" - if [ $? -ne 0 ]; then - LOG_ERROR "mingw32-configure 命令不支持 CXX 参数" - exit 255 - fi - - # 模拟配置过程(不实际编译) - LOG_INFO "模拟配置过程,验证 CXX 环境变量" - tmp_dir=$(mktemp -d) - cd $tmp_dir - echo "int main() { return 0; }" > test.cpp - - # 使用 mingw32-configure 配置 - mingw32-configure --host=i686-w64-mingw32 --disable-shared > configure.log 2>&1 - configure_result=$? - cat configure.log - - # 检查配置结果 - if [ $configure_result -eq 0 ]; then - LOG_INFO "mingw32-configure 配置成功,CXX 环境变量生效" - else - LOG_ERROR "mingw32-configure 配置失败" - # 根据Linux标准退出码退出 - exit $configure_result - fi - - # 清理临时目录 - cd - - rm -rf $tmp_dir - - # 步骤5:测试通过参数指定 C++ 编译器 - LOG_INFO "步骤5:测试通过参数指定 C++ 编译器" - - # 检查是否支持 CXX 参数 - LOG_INFO "检查 mingw32-configure 是否支持直接指定 CXX 参数" - mingw32-configure --help | grep -q "\-\-with-cxx" - if [ $? -ne 0 ]; then - LOG_INFO "mingw32-configure 不支持 --with-cxx 参数,尝试其他方式" - # 尝试通过环境变量传递 - CXX="i686-w64-mingw32-g++" mingw32-configure --host=i686-w64-mingw32 --disable-shared > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "通过环境变量指定 C++ 编译器失败" - LOG_INFO "通过环境变量指定 C++ 编译器成功" - else - # 使用 --with-cxx 参数 - mingw32-configure --host=i686-w64-mingw32 --disable-shared --with-cxx="i686-w64-mingw32-g++" > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "通过 --with-cxx 参数指定 C++ 编译器失败" - LOG_INFO "通过 --with-cxx 参数指定 C++ 编译器成功" - fi - - # 步骤6:环境恢复 - LOG_INFO "步骤6:恢复测试环境" - - # 如果测试前未安装,则卸载软件包 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "卸载测试安装的软件包 $PACKAGE_NAME" - dnf remove -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "卸载软件包 $PACKAGE_NAME 失败" - LOG_INFO "软件包 $PACKAGE_NAME 卸载成功" - else - LOG_INFO "测试前已安装软件包 $PACKAGE_NAME,保持安装状态" - fi - - # 清理环境变量 - unset CXX - - LOG_INFO "测试脚本执行完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-configure_cxxflags.sh b/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-configure_cxxflags.sh deleted file mode 100644 index 0d89bc6fa86..00000000000 --- a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-configure_cxxflags.sh +++ /dev/null @@ -1,77 +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-28 -# @License : Mulan PSL v2 -# @Desc : 测试 mingw32-configure 命令的 CXXFLAGS 环境变量或参数以指定 C++ 编译器标志 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 mingw32-configure 命令的 CXXFLAGS 环境变量或参数以指定 C++ 编译器标志" - - # 定义软件包名称 - PACKAGE="mingw32-filesystem" - - # 检查软件包是否已安装 - LOG_INFO "检查 $PACKAGE 是否已安装" - if dnf list installed "$PACKAGE" &> /dev/null; then - LOG_INFO "$PACKAGE 已安装" - INSTALLED=true - else - LOG_INFO "$PACKAGE 未安装" - INSTALLED=false - fi - - # 检查yum源中是否有该软件包 - LOG_INFO "检查yum源中是否有 $PACKAGE 软件包" - if ! dnf list available "$PACKAGE" &> /dev/null; then - LOG_ERROR "yum源中没有 $PACKAGE 软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装 $PACKAGE 软件包" - dnf install -y "$PACKAGE" - CHECK_RESULT $? 0 0 "安装 $PACKAGE 失败" - fi - - # 测试 mingw32-configure 命令的 CXXFLAGS 环境变量 - LOG_INFO "测试通过环境变量 CXXFLAGS 指定 C++ 编译器标志" - export CXXFLAGS="-O2 -Wall" - mingw32-configure --help &> /dev/null - CHECK_RESULT $? 0 0 "mingw32-configure 命令不支持 CXXFLAGS 环境变量" - - # 测试 mingw32-configure 命令的 --cxxflags 参数 - LOG_INFO "测试通过 --cxxflags 参数指定 C++ 编译器标志" - mingw32-configure --cxxflags="-O2 -Wall" --help &> /dev/null - if [ $? -eq 255 ]; then - LOG_ERROR "mingw32-configure 命令不支持 --cxxflags 参数" - exit 255 - fi - CHECK_RESULT $? 0 0 "mingw32-configure 命令执行失败" - - # 清理环境,恢复到之前的状态 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载 $PACKAGE 软件包" - dnf remove -y "$PACKAGE" - CHECK_RESULT $? 0 0 "卸载 $PACKAGE 失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-configure_default.sh b/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-configure_default.sh deleted file mode 100644 index 070475eee2d..00000000000 --- a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-configure_default.sh +++ /dev/null @@ -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-11-30 -# @License : Mulan PSL v2 -# @Desc : 测试 mingw32-configure 命令的默认行为 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - LOG_INFO "开始测试 mingw32-configure 命令的默认行为" - - # 检查是否已安装 mingw32-filesystem 和 mingw32-configure - LOG_INFO "检查 mingw32-filesystem 和 mingw32-configure 是否已安装" - if dnf list installed mingw32-filesystem mingw32-configure &>/dev/null; then - LOG_INFO "mingw32-filesystem 和 mingw32-configure 已安装" - installed=true - else - LOG_INFO "mingw32-filesystem 和 mingw32-configure 未安装" - installed=false - fi - - # 检查 yum 源中是否有 mingw32-filesystem 和 mingw32-configure - LOG_INFO "检查 yum 源中是否有 mingw32-filesystem 和 mingw32-configure" - if ! dnf list available mingw32-filesystem mingw32-configure &>/dev/null; then - LOG_ERROR "yum 源中未找到 mingw32-filesystem 或 mingw32-configure" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$installed" = false ]; then - LOG_INFO "安装 mingw32-filesystem 和 mingw32-configure" - dnf install -y mingw32-filesystem mingw32-configure - CHECK_RESULT $? 0 0 "安装 mingw32-filesystem 和 mingw32-configure 失败" - fi - - # 测试 mingw32-configure 命令的默认行为 - LOG_INFO "测试 mingw32-configure 命令的默认行为" - mingw32-configure - CHECK_RESULT $? 0 0 "mingw32-configure 命令默认行为测试失败" - - # 如果之前未安装,则卸载软件包 - if [ "$installed" = false ]; then - LOG_INFO "卸载 mingw32-filesystem 和 mingw32-configure" - dnf remove -y mingw32-filesystem mingw32-configure - CHECK_RESULT $? 0 0 "卸载 mingw32-filesystem 和 mingw32-configure 失败" - fi - - LOG_INFO "测试脚本执行完毕,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-configure_help.sh b/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-configure_help.sh deleted file mode 100644 index adbb37293a1..00000000000 --- a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-configure_help.sh +++ /dev/null @@ -1,87 +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-28 -# @License : Mulan PSL v2 -# @Desc : 测试 mingw32-configure 命令的 --help 参数以显示帮助信息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装mingw32-filesystem软件包 - LOG_INFO "检查mingw32-filesystem软件包是否已安装" - if dnf list installed mingw32-filesystem > /dev/null 2>&1; then - LOG_INFO "mingw32-filesystem软件包已安装" - INSTALLED="true" - else - LOG_INFO "mingw32-filesystem软件包未安装" - INSTALLED="false" - fi - - # 检查yum源中是否有mingw32-filesystem软件包 - LOG_INFO "检查yum源中是否有mingw32-filesystem软件包" - if ! dnf list available mingw32-filesystem > /dev/null 2>&1; then - LOG_ERROR "yum源中未找到mingw32-filesystem软件包" - exit 255 - fi - - # 如果未安装,则安装mingw32-filesystem软件包 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "安装mingw32-filesystem软件包" - dnf install -y mingw32-filesystem - CHECK_RESULT $? 0 0 "安装mingw32-filesystem软件包失败" - fi - - # 检查mingw32-configure命令是否存在 - LOG_INFO "检查mingw32-configure命令是否存在" - if ! command -v mingw32-configure > /dev/null 2>&1; then - LOG_ERROR "mingw32-configure命令不存在" - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "卸载mingw32-filesystem软件包" - dnf remove -y mingw32-filesystem - fi - exit 255 - fi - - # 测试mingw32-configure命令的--help参数 - LOG_INFO "测试mingw32-configure命令的--help参数" - mingw32-configure --help > /tmp/mingw32_configure_help.txt 2>&1 - CHECK_RESULT $? 0 0 "执行mingw32-configure --help失败" - - # 检查输出是否包含帮助信息 - LOG_INFO "检查mingw32-configure --help输出是否包含帮助信息" - if grep -q "Usage:" /tmp/mingw32_configure_help.txt; then - LOG_INFO "mingw32-configure --help输出包含帮助信息" - CHECK_RESULT 0 0 0 "mingw32-configure --help输出不包含帮助信息" - else - LOG_ERROR "mingw32-configure --help输出不包含帮助信息" - CHECK_RESULT 1 0 1 "mingw32-configure --help输出不包含帮助信息" - fi - - # 清理临时文件 - LOG_INFO "清理临时文件" - rm -f /tmp/mingw32_configure_help.txt - - # 如果之前未安装,则卸载软件包 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "卸载mingw32-filesystem软件包" - dnf remove -y mingw32-filesystem - CHECK_RESULT $? 0 0 "卸载mingw32-filesystem软件包失败" - fi - - LOG_INFO "测试脚本执行完毕" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-configure_host.sh b/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-configure_host.sh deleted file mode 100644 index 59e754fae64..00000000000 --- a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-configure_host.sh +++ /dev/null @@ -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 : 2026-02-28 -# @License : Mulan PSL v2 -# @Desc : 测试 mingw32-configure 命令的 --host 参数以指定目标主机 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查环境是否已安装 mingw32-filesystem 和 mingw32-configure 软件包 - LOG_INFO "检查 mingw32-filesystem 和 mingw32-configure 是否已安装" - rpm -q mingw32-filesystem mingw32-configure > /dev/null 2>&1 - installed=$? - - # 如果未安装,则进行安装 - if [ $installed -ne 0 ]; then - LOG_INFO "软件包未安装,开始安装 mingw32-filesystem 和 mingw32-configure" - # 检查 yum 源中是否存在软件包 - dnf list available mingw32-filesystem mingw32-configure > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum 源中缺少 mingw32-filesystem 或 mingw32-configure 软件包" - # 安装软件包 - dnf install -y mingw32-filesystem mingw32-configure - CHECK_RESULT $? 0 0 "安装 mingw32-filesystem 和 mingw32-configure 失败" - else - LOG_INFO "软件包已安装,跳过安装步骤" - fi - - # 测试 mingw32-configure 命令的 --host 参数 - LOG_INFO "测试 mingw32-configure 命令的 --host 参数以指定目标主机" - # 检查 --host 参数是否存在 - mingw32-configure --help 2>&1 | grep -q -- "--host" - CHECK_RESULT $? 0 255 "mingw32-configure 命令不支持 --host 参数" - - # 执行 mingw32-configure 命令并指定 --host 参数 - mingw32-configure --host=i686-w64-mingw32 - CHECK_RESULT $? 0 0 "执行 mingw32-configure --host=i686-w64-mingw32 失败" - - # 清理环境:如果之前未安装,则卸载软件包 - if [ $installed -ne 0 ]; then - LOG_INFO "清理环境:卸载 mingw32-filesystem 和 mingw32-configure 软件包" - dnf remove -y mingw32-filesystem mingw32-configure - CHECK_RESULT $? 0 0 "卸载 mingw32-filesystem 和 mingw32-configure 失败" - else - LOG_INFO "环境保持安装状态,无需卸载" - fi - - LOG_INFO "测试脚本执行完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-configure_ldflags.sh b/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-configure_ldflags.sh deleted file mode 100644 index 0c94c56a410..00000000000 --- a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-configure_ldflags.sh +++ /dev/null @@ -1,93 +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-28 -# @License : Mulan PSL v2 -# @Desc : 测试 mingw32-configure 命令的 LDFLAGS 环境变量或参数以指定链接器标志 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义日志函数(虽然题目说无需定义,但实际脚本中需要,这里按题意直接使用) - LOG_INFO() { - echo "[INFO] $*" - } - - LOG_ERROR() { - echo "[ERROR] $*" - } - - # 定义软件包名称 - PACKAGE_NAME="mingw32-filesystem" - - # 步骤1:检查软件包是否已在yum源中 - LOG_INFO "检查yum源中是否存在软件包:$PACKAGE_NAME" - dnf list available $PACKAGE_NAME &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 $PACKAGE_NAME 在yum源中不存在" - exit 255 - fi - - # 步骤2:检查当前环境是否已安装软件包 - LOG_INFO "检查当前环境是否已安装软件包:$PACKAGE_NAME" - rpm -q $PACKAGE_NAME &>/dev/null - if [ $? -eq 0 ]; then - LOG_INFO "软件包 $PACKAGE_NAME 已安装,脚本结束后保持安装状态" - ALREADY_INSTALLED=1 - else - LOG_INFO "软件包 $PACKAGE_NAME 未安装,将在测试过程中安装" - ALREADY_INSTALLED=0 - fi - - # 步骤3:如果未安装,则安装软件包 - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "安装软件包:$PACKAGE_NAME" - dnf install -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "安装软件包失败" - fi - - # 步骤4:检查mingw32-configure命令是否存在 - LOG_INFO "检查mingw32-configure命令是否存在" - which mingw32-configure &>/dev/null - CHECK_RESULT $? 0 0 "mingw32-configure命令不存在" - - # 步骤5:测试LDFLAGS环境变量 - LOG_INFO "测试通过环境变量LDFLAGS指定链接器标志" - export LDFLAGS="-Wl,-O1" - mingw32-configure --help | grep -q "LDFLAGS" - CHECK_RESULT $? 0 0 "环境变量LDFLAGS不支持" - - # 步骤6:测试通过参数指定链接器标志 - LOG_INFO "测试通过参数指定链接器标志" - mingw32-configure LDFLAGS="-Wl,-O1" --help | grep -q "LDFLAGS" - CHECK_RESULT $? 0 0 "参数LDFLAGS不支持" - - # 步骤7:清理环境 - LOG_INFO "清理测试环境" - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "卸载软件包:$PACKAGE_NAME" - dnf remove -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "卸载软件包失败" - else - LOG_INFO "软件包 $PACKAGE_NAME 保持安装状态" - fi - - # 步骤8:恢复环境变量 - unset LDFLAGS - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-configure_prefix.sh b/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-configure_prefix.sh deleted file mode 100644 index 79598b72df9..00000000000 --- a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-configure_prefix.sh +++ /dev/null @@ -1,89 +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-28 -# @License : Mulan PSL v2 -# @Desc : 测试 mingw32-configure 命令的 --prefix 参数以指定安装目录 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装 mingw32-filesystem 和 mingw32-configure - LOG_INFO "检查 mingw32-filesystem 和 mingw32-configure 是否已安装" - if dnf list installed mingw32-filesystem mingw32-configure > /dev/null 2>&1; then - LOG_INFO "mingw32-filesystem 和 mingw32-configure 已安装,测试结束后将保持安装状态" - already_installed=true - else - LOG_INFO "mingw32-filesystem 和 mingw32-configure 未安装,将在测试中安装并在测试结束后卸载" - already_installed=false - fi - - # 检查 yum 源中是否有 mingw32-filesystem 和 mingw32-configure 软件包 - LOG_INFO "检查 yum 源中是否有 mingw32-filesystem 和 mingw32-configure 软件包" - if ! dnf list available mingw32-filesystem mingw32-configure > /dev/null 2>&1; then - LOG_ERROR "yum 源中缺少 mingw32-filesystem 或 mingw32-configure 软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$already_installed" = false ]; then - LOG_INFO "安装 mingw32-filesystem 和 mingw32-configure 软件包" - dnf install -y mingw32-filesystem mingw32-configure - CHECK_RESULT $? 0 0 "安装 mingw32-filesystem 和 mingw32-configure 失败" - fi - - # 测试 mingw32-configure 命令的 --prefix 参数 - LOG_INFO "测试 mingw32-configure 命令的 --prefix 参数" - # 创建一个临时目录用于测试 - test_prefix_dir=$(mktemp -d) - LOG_INFO "创建临时目录: $test_prefix_dir" - - # 检查 --prefix 参数是否存在 - LOG_INFO "检查 mingw32-configure 命令是否支持 --prefix 参数" - if ! mingw32-configure --help | grep -q "\-\-prefix"; then - LOG_ERROR "mingw32-configure 命令不支持 --prefix 参数" - exit 255 - fi - - # 执行 mingw32-configure 命令并指定 --prefix 参数 - LOG_INFO "执行 mingw32-configure 命令并指定 --prefix 参数" - mingw32-configure --prefix="$test_prefix_dir" - CHECK_RESULT $? 0 0 "mingw32-configure 命令执行失败" - - # 检查指定目录是否已创建 - LOG_INFO "检查指定目录是否已创建" - if [ -d "$test_prefix_dir" ]; then - LOG_INFO "指定目录已成功创建: $test_prefix_dir" - else - LOG_ERROR "指定目录未创建: $test_prefix_dir" - exit 1 - fi - - # 清理临时目录 - LOG_INFO "清理临时目录" - rm -rf "$test_prefix_dir" - CHECK_RESULT $? 0 0 "清理临时目录失败" - - # 如果之前未安装,则在测试结束后卸载软件包 - if [ "$already_installed" = false ]; then - LOG_INFO "卸载 mingw32-filesystem 和 mingw32-configure 软件包" - dnf remove -y mingw32-filesystem mingw32-configure - CHECK_RESULT $? 0 0 "卸载 mingw32-filesystem 和 mingw32-configure 失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-configure_target.sh b/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-configure_target.sh deleted file mode 100644 index c6971b42538..00000000000 --- a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-configure_target.sh +++ /dev/null @@ -1,72 +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-28 -# @License : Mulan PSL v2 -# @Desc : 测试 mingw32-configure 命令的 --target 参数以指定目标系统 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装 mingw32-filesystem 和 mingw32-configure - LOG_INFO "检查是否已安装 mingw32-filesystem 和 mingw32-configure" - if dnf list installed mingw32-filesystem mingw32-configure >/dev/null 2>&1; then - LOG_INFO "mingw32-filesystem 和 mingw32-configure 已安装" - INSTALLED=1 - else - LOG_INFO "mingw32-filesystem 和 mingw32-configure 未安装" - INSTALLED=0 - fi - - # 检查yum源中是否有 mingw32-filesystem 和 mingw32-configure 软件包 - LOG_INFO "检查yum源中是否有 mingw32-filesystem 和 mingw32-configure 软件包" - if ! dnf list available mingw32-filesystem mingw32-configure >/dev/null 2>&1; then - LOG_ERROR "yum源中缺少 mingw32-filesystem 或 mingw32-configure 软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装 mingw32-filesystem 和 mingw32-configure" - dnf install -y mingw32-filesystem mingw32-configure - CHECK_RESULT $? 0 0 "安装 mingw32-filesystem 和 mingw32-configure 失败" - fi - - # 测试 mingw32-configure 命令的 --target 参数 - LOG_INFO "测试 mingw32-configure 命令的 --target 参数" - mingw32-configure --target=i686-w64-mingw32 - CHECK_RESULT $? 0 0 "mingw32-configure --target=i686-w64-mingw32 执行失败" - - # 测试不支持的 --target 参数 - LOG_INFO "测试不支持的 --target 参数" - mingw32-configure --target=unsupported-target - if [ $? -eq 255 ]; then - LOG_INFO "不支持的 --target 参数正确处理" - else - LOG_ERROR "不支持的 --target 参数未正确处理" - exit 255 - fi - - # 清理环境:如果之前未安装,则卸载软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载 mingw32-filesystem 和 mingw32-configure" - dnf remove -y mingw32-filesystem mingw32-configure - CHECK_RESULT $? 0 0 "卸载 mingw32-filesystem 和 mingw32-configure 失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-configure_version.sh b/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-configure_version.sh deleted file mode 100644 index 26efc56e3b1..00000000000 --- a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-configure_version.sh +++ /dev/null @@ -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 : 2026-02-28 -# @License : Mulan PSL v2 -# @Desc : 测试 mingw32-configure 命令的 --version 参数以显示版本信息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "检查yum源中是否存在mingw32-filesystem软件包" - dnf list mingw32-filesystem 2>/dev/null | grep -q "mingw32-filesystem" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到mingw32-filesystem软件包" - exit 255 - fi - - LOG_INFO "检查mingw32-configure命令是否已安装" - which mingw32-configure > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "mingw32-configure命令已存在,标记为已安装状态" - ALREADY_INSTALLED=1 - else - LOG_INFO "mingw32-configure命令未安装,标记为未安装状态" - ALREADY_INSTALLED=0 - fi - - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "安装mingw32-filesystem软件包" - dnf install -y mingw32-filesystem - CHECK_RESULT $? 0 0 "安装mingw32-filesystem软件包失败" - fi - - LOG_INFO "检查mingw32-configure命令是否支持--version参数" - mingw32-configure --help 2>&1 | grep -q "\-\-version" - if [ $? -ne 0 ]; then - LOG_ERROR "mingw32-configure命令不支持--version参数" - exit 255 - fi - - LOG_INFO "执行mingw32-configure --version命令" - mingw32-configure --version - CHECK_RESULT $? 0 0 "执行mingw32-configure --version命令失败" - - LOG_INFO "测试完成,开始环境恢复" - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "卸载mingw32-filesystem软件包" - dnf remove -y mingw32-filesystem - CHECK_RESULT $? 0 0 "卸载mingw32-filesystem软件包失败" - else - LOG_INFO "环境已安装,保持安装状态" - fi - - LOG_INFO "环境恢复完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-make__d.sh b/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-make__d.sh deleted file mode 100644 index aed4d19e754..00000000000 --- a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-make__d.sh +++ /dev/null @@ -1,58 +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-30 -# @License : Mulan PSL v2 -# @Desc : 测试 mingw32-make 的 -d 参数,打印调试信息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 mingw32-make 的 -d 参数,打印调试信息" - - # 检查是否已安装 mingw32-make - LOG_INFO "检查 mingw32-make 是否已安装" - if ! dnf list installed mingw32-make &>/dev/null; then - LOG_INFO "mingw32-make 未安装,准备安装" - # 检查 yum 源中是否有 mingw32-make - if ! dnf list available mingw32-make &>/dev/null; then - LOG_ERROR "yum 源中未找到 mingw32-make,退出测试" - exit 255 - fi - # 安装 mingw32-make - dnf install -y mingw32-make - CHECK_RESULT $? 0 0 "安装 mingw32-make 失败" - INSTALLED=1 - else - LOG_INFO "mingw32-make 已安装" - INSTALLED=0 - fi - - # 测试 -d 参数 - LOG_INFO "测试 mingw32-make 的 -d 参数" - mingw32-make -d - CHECK_RESULT $? 0 0 "mingw32-make -d 执行失败" - - # 清理环境 - if [ $INSTALLED -eq 1 ]; then - LOG_INFO "卸载 mingw32-make" - dnf remove -y mingw32-make - CHECK_RESULT $? 0 0 "卸载 mingw32-make 失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-make__e.sh b/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-make__e.sh deleted file mode 100644 index 8a608d4ba8e..00000000000 --- a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-make__e.sh +++ /dev/null @@ -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-11-30 -# @License : Mulan PSL v2 -# @Desc : 测试 mingw32-make 的 -e 参数,环境变量覆盖 makefile -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 mingw32-make 的 -e 参数,环境变量覆盖 makefile" - - # 检查是否已安装 mingw32-filesystem 和 mingw32-make - LOG_INFO "检查 mingw32-filesystem 和 mingw32-make 是否已安装" - if ! dnf list installed mingw32-filesystem &>/dev/null || ! dnf list installed mingw32-make &>/dev/null; then - LOG_INFO "未安装 mingw32-filesystem 或 mingw32-make,开始安装" - # 检查 yum 源中是否有该软件包 - if ! dnf list available mingw32-filesystem &>/dev/null || ! dnf list available mingw32-make &>/dev/null; then - LOG_ERROR "yum 源中未找到 mingw32-filesystem 或 mingw32-make" - exit 255 - fi - dnf install -y mingw32-filesystem mingw32-make - CHECK_RESULT $? 0 0 "安装 mingw32-filesystem 或 mingw32-make 失败" - # 标记为需要卸载 - NEED_UNINSTALL=1 - else - LOG_INFO "mingw32-filesystem 和 mingw32-make 已安装" - NEED_UNINSTALL=0 - fi - - # 测试 -e 参数 - LOG_INFO "测试 -e 参数,环境变量覆盖 makefile" - export TEST_VAR="test_value" - echo "all:" > Makefile - echo -e "\t@echo \$(TEST_VAR)" >> Makefile - mingw32-make -e - CHECK_RESULT $? 0 0 "mingw32-make -e 执行失败" - - # 清理环境 - if [ $NEED_UNINSTALL -eq 1 ]; then - LOG_INFO "卸载 mingw32-filesystem 和 mingw32-make" - dnf remove -y mingw32-filesystem mingw32-make - CHECK_RESULT $?15:03:40 0 0 "卸载 mingw32-filesystem 或 mingw32-make15:03:40 失败"15:03:40 - fi - - rm -f Makefile - unset TEST_VAR - - LOG_INFO15:03:40 15:03:40 "测试完成"15:03:40 -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-make__f.sh b/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-make__f.sh deleted file mode 100644 index 1f4ade56e65..00000000000 --- a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-make__f.sh +++ /dev/null @@ -1,57 +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-30 -# @License : Mulan PSL v2 -# @Desc : 测试 mingw32-make 的 -f 参数,指定 makefile 文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - LOG_INFO "开始测试 mingw32-make 的 -f 参数,指定 makefile 文件" - - # 检查是否已安装 mingw32-filesystem 和 mingw32-make - LOG_INFO "检查 mingw32-filesystem 和 mingw32-make 是否已安装" - if ! dnf list installed mingw32-filesystem mingw32-make &>/dev/null; then - LOG_INFO "未安装 mingw32-filesystem 或 mingw32-make,准备安装" - # 检查 yum 源中是否有该软件包 - if ! dnf list available mingw32-filesystem mingw32-make &>/dev/null; then - LOG_ERROR "yum 源中未找到 mingw32-filesystem 或 mingw32-make" - exit 255 - fi - # 安装软件包 - dnf install -y mingw32-filesystem mingw32-make - CHECK_RESULT $? 0 0 "安装 mingw32-filesystem 或 mingw32-make 失败" - # 标记需要卸载 - UNINSTALL=1 - else - LOG_INFO "mingw32-filesystem 和 mingw32-make 已安装" - UNINSTALL=0 - fi - - # 测试 -f 参数,指定 makefile 文件 - LOG_INFO "测试 -f 参数,指定 makefile 文件" - touch test_makefile.mk || exit $? - LOG_INFO "创建测试 makefile 文件 test_makefile.mk" - mingw32-make -f test_makefile.mk - CHECK_RESULT $? 0 0 "mingw32-make -f 参数测试失败" - - # 清理测试文件 - rm -f test_makefile.mk - CHECK_RESULT $? -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-make__h.sh b/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-make__h.sh deleted file mode 100644 index b09182a0063..00000000000 --- a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-make__h.sh +++ /dev/null @@ -1,61 +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-30 -# @License : Mulan PSL v2 -# @Desc : 测试 mingw32-make 的 -h 参数,打印帮助信息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - LOG_INFO "开始测试 mingw32-make 的 -h 参数,打印帮助信息" - - # 检查 yum 源中是否存在 mingw32-filesystem 和 mingw32-make 软件包 - LOG_INFO "检查 yum 源中是否存在 mingw32-filesystem 和 mingw32-make 软件包" - if ! dnf list available mingw32-filesystem mingw32-make &>/dev/null; then - LOG_ERROR "yum 源中不存在 mingw32-filesystem 或 mingw32-make 软件包" - exit 255 - fi - - # 检查是否已安装 mingw32-filesystem 和 mingw32-make - LOG_INFO "检查是否已安装 mingw32-filesystem 和 mingw32-make" - installed=false - if rpm -q mingw32-filesystem &>/dev/null && rpm -q mingw32-make &>/dev/null; then - installed=true - LOG_INFO "mingw32-filesystem 和 mingw32-make 已安装" - else - LOG_INFO "mingw32-filesystem 和 mingw32-make 未安装,将进行安装" - dnf install -y mingw32-filesystem mingw32-make - CHECK_RESULT $? 0 0 "安装 mingw32-filesystem 和 mingw32-make 失败" - fi - - # 测试 -h 参数是否支持并打印帮助信息 - LOG_INFO "测试 mingw32-make -h 参数是否支持并打印帮助信息" - mingw32-make -h &>/dev/null - CHECK_RESULT $? 0 0 "-h 参数不支持或执行失败" - - # 清理环境 - if [ "$installed" = false ]; then - LOG_INFO "清理环境,卸载已安装的软件包" - dnf remove -y mingw32-filesystem mingw32-make - CHECK_RESULT $?10"卸载失败" - fi - - LOG_INFO "测试完成" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-make__i.sh b/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-make__i.sh deleted file mode 100644 index b3d37fd38c7..00000000000 --- a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-make__i.sh +++ /dev/null @@ -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 : 2025-11-30 -# @License : Mulan PSL v2 -# @Desc : 测试 mingw32-make 的 -i 参数,忽略错误继续执行 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - LOG_INFO "开始测试 mingw32-make 的 -i 参数,忽略错误继续执行" - - # 检查是否已安装 mingw32-filesystem 和 mingw32-make - LOG_INFO "检查是否已安装 mingw32-filesystem 和 mingw32-make" - if ! dnf list installed mingw32-filesystem mingw32-make &>/dev/null; then - LOG_INFO "未安装 mingw32-filesystem 或 mingw32-make,开始安装" - # 检查 yum 源中是否有软件包 - if ! dnf list available mingw32-filesystem mingw32-make &>/dev/null; then - LOG_ERROR "yum 源中未找到 mingw32-filesystem 或 mingw32-make 软件包" - exit 255 - fi - # 安装软件包 - dnf install -y mingw32-filesystem mingw32-make - CHECK_RESULT $? 0 0 "安装 mingw32-filesystem 或 mingw32-make 失败" - # 标记需要卸载 - NEED_UNINSTALL=1 - else - LOG_INFO "mingw32-filesystem 和 mingw32-make 已安装" - NEED_UNINSTALL=0 - fi - - # 测试 -i 参数 - LOG_INFO "测试 -i 参数,忽略错误继续执行" - #创建一个临时 Makefile 文件 - cat > test_makefile </dev/null; then - LOG_INFO "软件包 mingw32-filesystem 和 mingw32-make 已安装" - INSTALLED=true - else - LOG_INFO "软件包 mingw32-filesystem 和 mingw32-make 未安装" - INSTALLED=false - fi - - # 检查yum源中是否有软件包 - LOG_INFO "检查yum源中是否有软件包 mingw32-filesystem 和 mingw32-make" - if ! dnf list available mingw32-filesystem mingw32-make &>/dev/null; then - LOG_ERROR "yum源中没有找到软件包 mingw32-filesystem 或 mingw32-make" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装软件包 mingw32-filesystem 和 mingw32-make" - dnf install -y mingw32-filesystem mingw32-make - CHECK_RESULT $? 0 0 "安装软件包失败" - fi - - # 测试并行作业功能 - LOG_INFO "测试并行作业功能" - make -j test_mingw32-filesystem_mingw32-make__j - CHECK_RESULT $? 0 0 "并行作业测试失败" - - # 如果脚本开始时未安装软件包,则在结束时卸载 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载临时安装的软件包" - dnf remove -y mingw32-filesystem mingw32-make - CHECK_RESULT $? 0 0 "卸载软件包失败" - fi - - LOG_INFO "测试脚本执行完毕,环境已恢复" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-make__j_num_n.sh b/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-make__j_num_n.sh deleted file mode 100644 index 8b3947d9c0e..00000000000 --- a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-make__j_num_n.sh +++ /dev/null @@ -1,62 +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-30 -# @License : Mulan PSL v2 -# @Desc : 测试 mingw32-make 的 -j N 参数,指定并行任务数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装mingw32-filesystem和mingw32-make - LOG_INFO "检查是否已安装mingw32-filesystem和mingw32-make" - if ! dnf list installed mingw32-filesystem mingw32-make &>/dev/null; then - LOG_INFO "环境未安装,将进行安装" - # 检查yum源中是否有软件包 - LOG_INFO "检查yum源中是否有mingw32-filesystem和mingw32-make" - if ! dnf list available mingw32-filesystem mingw32-make &>/dev/null; then - LOG_ERROR "yum源中缺少必要的软件包" - exit 255 - fi - - # 安装软件包 - LOG_INFO "安装mingw32-filesystem和mingw32-make" - dnf install -y mingw32-filesystem mingw32-make - CHECK_RESULT $? 0 0 "安装软件包失败" - - # 标记需要卸载 - NEED_UNINSTALL=1 - else - LOG_INFO "环境已安装,无需重复安装" - fi - - # 测试-j N参数 - LOG_INFO "测试mingw32-make的-j N参数" - LOG_INFO "执行命令:mingw32-make -j 4" - mingw32-make -j 4 - CHECK_RESULT $? 0 0 "-j参数不支持或执行失败" - - # 清理环境 - if [ "$NEED_UNINSTALL" -eq 1 ]; then - LOG_INFO "卸载mingw32-filesystem和mingw32-make" - dnf remove -y mingw32-filesystem mingw32-make - CHECK_RESULT $? 0 0 "卸载软件包失败" - fi - - LOG_INFO "测试脚本执行完毕" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-make__k.sh b/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-make__k.sh deleted file mode 100644 index 2c6e9583950..00000000000 --- a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-make__k.sh +++ /dev/null @@ -1,77 +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-30 -# @License : Mulan PSL v2 -# @Desc : 测试 mingw32-make 的 -k 参数,即使有错误也继续执行目标构建 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 mingw32-make 的 -k 参数功能" - - # 检查软件包是否已安装 - LOG_INFO "检查 mingw32-filesystem 和 mingw32-make 是否已安装" - if ! dnf list installed mingw32-filesystem mingw32-make &>/dev/null; then - LOG_INFO "软件包未安装,准备安装" - # 检查yum源中是否有该软件包 - if ! dnf list available mingw32-filesystem mingw32-make &>/dev/null; then - LOG_ERROR "yum源中未找到 mingw32-filesystem 或 mingw32-make" - exit 255 - fi - # 安装软件包 - dnf install -y mingw32-filesystem mingw32-make - CHECK_RESULT $? 0 0 "安装 mingw32-filesystem 和 mingw32-make 失败" - # 标记为需要卸载 - NEED_UNINSTALL=1 - else - LOG_INFO "软件包已安装,无需操作" - NEED_UNINSTALL=0 - fi - - # 测试 -k 参数功能 - LOG_INFO "测试 mingw32-make -k 参数功能" - # 创建一个临时目录用于测试 - TEST_DIR=$(mktemp -d) - cd "$TEST_DIR" || exit 1 - - # 创建一个简单的Makefile,其中包含一个会失败的目标和一个会成功的目标 - cat > Makefile << "EOF" - fail_target: - false - - success_target: - true - EOF - - # 执行 mingw32-make -k,预期即使有错误也继续执行 - mingw32-make -k fail_target success_target - CHECK_RESULT $? 0 0 "mingw32-make -k 未按预期工作" - - #清理临时目录 - cd - || exit 1 - rm -rf "$TEST_DIR" - - # 根据安装状态决定是否卸载 - if [ "$NEED_UNINSTALL" -eq 1 ]; then - LOG_INFO "卸载 mingw32-filesystem 和 mingw32-make" - dnf remove -y mingw32-filesystem mingw32-make - CHECK_RESULT $?2 0 0 "卸载 mingW3232-filesystem和mingW3232-make失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-make__l.sh b/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-make__l.sh deleted file mode 100644 index 7e7ab653bc8..00000000000 --- a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-make__l.sh +++ /dev/null @@ -1,76 +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-11 -# @License : Mulan PSL v2 -# @Desc : 测试负载限制 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 测试负载限制脚本 - - LOG_INFO "开始测试负载限制" - - # 检查是否已安装mingw32-filesystem和mingw32-make - LOG_INFO "检查mingw32-filesystem和mingw32-make是否已安装" - dnf list installed mingw32-filesystem mingw32-make > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "mingw32-filesystem和mingw32-make已安装,跳过安装步骤" - INSTALLED=true - else - LOG_INFO "mingw32-filesystem和mingw32-make未安装,准备安装" - INSTALLED=false - fi - - # 检查yum源中是否有软件包 - LOG_INFO "检查yum源中是否有mingw32-filesystem和mingw32-make" - dnf list available mingw32-filesystem mingw32-make > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中没有mingw32-filesystem或mingw32-make软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中没有mingw32-filesystem或mingw32-make软件包" - exit 255 - fi - - # 安装软件包(如果未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装mingw32-filesystem和mingw32-make" - dnf install -y mingw32-filesystem mingw32-make > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装mingw32-filesystem和mingw32-make失败" - fi - - # 测试负载限制功能 - LOG_INFO "测试负载限制功能" - make --load-average=1.0 > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "负载限制功能测试失败" - - # 检查参数是否支持 - LOG_INFO "检查--load-average参数是否支持" - make --load-average=1.0 > /dev/null 2>&1 || { - LOG_ERROR "--load-average参数不支持" - exit 255 - } - - # 清理环境(如果之前未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载mingw32-filesystem和mingw32-make" - dnf remove -y mingw32-filesystem mingw32-make > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载minggW320filesystem和minggW320make失败" - fi - - LOG_INFO_END "测试负载限制完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-make__n.sh b/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-make__n.sh deleted file mode 100644 index 4a0504adefe..00000000000 --- a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-make__n.sh +++ /dev/null @@ -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-11-30 -# @License : Mulan PSL v2 -# @Desc : 测试 mingw32-make 的 -n 参数,仅打印命令不实际执行 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 mingw32-make 的 -n 参数功能,仅打印命令不实际执行" - - # 检查是否已安装 mingw32-filesystem 和 mingw32-make - LOG_INFO "检查是否已安装 mingw32-filesystem 和 mingw32-make" - dnf list installed mingw32-filesystem mingw32-make > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "mingw32-filesystem 和 mingw32-make 已安装,测试完成后将保持安装状态" - INSTALLED=true - else - LOG_INFO "mingw32-filesystem 和 mingw32-make 未安装,将在测试完成后卸载" - INSTALLED=false - fi - - # 检查 yum 源中是否存在软件包 - LOG_INFO "检查 yum 源中是否存在 mingw32-filesystem 和 mingw32-make" - dnf list available mingw32-filesystem mingw32-make > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum 源中不存在 mingw32-filesystem 或 mingw32-make,退出测试" - exit 255 - fi - - # 如果未安装则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装 mingw32-filesystem 和 mingw32-make" - dnf install -y mingw32-filesystem mingw32-make > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装 mingw32-filesystem 和 mingw32-make失败" - fi - - # 测试 mingw32-make -n 参数 - LOG_INFO "测试ming w3m2-mak e -n 参数,仅打印命令不实际执行" - ming w3m2-mak e -n > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "-n参数不支持或无效" - - #清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO"清理环境,卸载 ming w3m2-fil esystem an d ming w3m2-ma ke " - dnf remove-y min gw32-fi lesystem min gw3ma ke >/de v/nul l 21> &1 - CHECK_RESULT$ ?00"卸载 ming w3m2-fil esyste man d ming w3m2-ma ke失败" - fi - - LOG_INFO"测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-make__o.sh b/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-make__o.sh deleted file mode 100644 index ccf363cae8e..00000000000 --- a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-make__o.sh +++ /dev/null @@ -1,105 +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-11 -# @License : Mulan PSL v2 -# @Desc : 测试将文件视为旧文件 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查yum源中是否存在指定的软件包 - check_package_existence() { - LOG_INFO "检查yum源中是否存在软件包: $1" - if ! dnf list available "$1" &>/dev/null; then - LOG_ERROR "yum源中不存在软件包: $1" - exit 255 - fi - } - - # 检查命令参数是否支持 - check_command_option() { - LOG_INFO "检查命令参数是否支持: $1 $2" - if ! "$1" --help | grep -q "$2"; then - LOG_ERROR "命令参数不支持: $1 $2" - exit 255 - fi - } - - # 安装软件包 - install_package() { - LOG_INFO "安装软件包: $1" - dnf install -y "$1" - CHECK_RESULT $? 0 0 "安装软件包失败: $1" - } - - # 卸载软件包 - uninstall_package() { - LOG_INFO "卸载软件包: $1" - dnf remove -y "$1" - CHECK_RESULT $? 0 0 "卸载软件包失败: $1" - } - - # 检查环境是否已安装软件包 - check_installed() { - LOG_INFO "检查环境是否已安装软件包: mingw32-filesystem mingw32-make" - if rpm -q mingw32-filesystem &>/dev/null && rpm -q mingw32-make &>/dev/null; then - LOG_INFO "环境已安装所需软件包,脚本结束时将保持安装状态" - return 0 - else - LOG_INFO "环境未安装所需软件包,脚本结束前将卸载已安装的软件包" - return 1 - fi - } - - # 主函数执行测试步骤 - main() { - LOG_INFO "开始测试:测试将文件视为旧文件" - - # 检查yum源中是否存在所需软件包并验证参数 - check_package_existence mingw32-filesystem - check_package_existence mingw32-make - - # 检查环境是否已安装软件包 - local installed=false - if check_installed; then - installed=true - else - install_package mingw32-filesystem - install_package mingw32-make - fi - - # 测试步骤:将文件视为旧文件(示例) - LOG_INFO "执行测试步骤:将文件视为旧文件" - - # SSH到第二个服务器执行命令(示例) - SSH_CMD "ls" "$NODE2_IPV4" "$NODE2_PASSWORD" "$NODE2_USER" - - CHECK_RESULT $? - - #根据初始状态决定是否卸载 - if ! $installed; then - uninstall_package mingw32-filesystem - uninstall_package mingw32-make - fi - - } - - main "$@" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-make__p.sh b/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-make__p.sh deleted file mode 100644 index 8be75314bef..00000000000 --- a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-make__p.sh +++ /dev/null @@ -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-02-28 -# @License : Mulan PSL v2 -# @Desc : 测试打印make内部数据库的选项 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断是否已安装mingw32-filesystem和mingw32-make - LOG_INFO "检查是否已安装mingw32-filesystem和mingw32-make" - rpm -q mingw32-filesystem mingw32-make > /dev/null 2>&1 - if [ $? -eq 0 ]; then - INSTALLED=true - LOG_INFO "检测到软件包已安装,脚本结束后将保持安装状态" - else - INSTALLED=false - LOG_INFO "软件包未安装,将在测试过程中安装并在结束后卸载" - fi - - # 检查yum源中是否存在mingw32-filesystem和mingw32-make软件包 - LOG_INFO "检查yum源中是否存在mingw32-filesystem和mingw32-make软件包" - dnf list available mingw32-filesystem mingw32-make > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中不存在mingw32-filesystem或mingw32-make软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在mingw32-filesystem或mingw32-make软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装mingw32-filesystem和mingw32-make软件包" - dnf install -y mingw32-filesystem mingw32-make - CHECK_RESULT $? 0 0 "安装mingw32-filesystem和mingw32-make软件包失败" - fi - - # 测试打印make内部数据库的选项 - LOG_INFO "测试打印make内部数据库的选项" - mingw32-make -p > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "执行mingw32-make -p命令失败" - - # 测试指定不支持的参数 - LOG_INFO "测试指定不支持的参数" - mingw32-make --unsupported-option > /dev/null 2>&1 - if [ $? -eq 255 ]; then - LOG_ERROR "参数不存在或不支持" - exit 255 - fi - - # 清理环境,如果脚本开始时未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载mingw32-filesystem和mingw32-make软件包" - dnf remove -y mingw32-filesystem mingw32-make - CHECK_RESULT $? 0 0 "卸载mingw32-filesystem和mingw32-make软件包失败" - fi - - LOG_INFO "测试脚本执行完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-make__q.sh b/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-make__q.sh deleted file mode 100644 index 179190170cd..00000000000 --- a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-make__q.sh +++ /dev/null @@ -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 : 2026-02-28 -# @License : Mulan PSL v2 -# @Desc : 测试不运行配方仅检查目标是否最新的选项 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试不运行配方仅检查目标是否最新的选项" - - # 检查是否已安装 mingw32-filesystem 和 mingw32-make - LOG_INFO "检查是否已安装 mingw32-filesystem 和 mingw32-make" - if dnf list installed mingw32-filesystem mingw32-make &>/dev/null; then - LOG_INFO "软件包已安装,测试结束后保持安装状态" - INSTALLED=true - else - LOG_INFO "软件包未安装,将在测试过程中安装" - INSTALLED=false - fi - - # 检查yum源中是否有mingw32-filesystem和mingw32-make - LOG_INFO "检查yum源中是否有mingw32-filesystem和mingw32-make" - if ! dnf list available mingw32-filesystem mingw32-make &>/dev/null; then - LOG_ERROR "yum源中缺少mingw32-filesystem或mingw32-make" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装mingw32-filesystem和mingw32-make" - dnf install -y mingw32-filesystem mingw32-make - CHECK_RESULT $? 0 0 "安装软件包失败" - fi - - # 测试不运行配方仅检查目标是否最新的选项 - LOG_INFO "测试mingw32-make的-q选项(不运行配方,仅检查目标是否最新)" - mingw32-make -q - CHECK_RESULT $? 0 1 "mingw32-make -q 命令执行失败或返回了意外的退出码" - - # 清理环境:如果测试前未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载mingw32-filesystem和mingw32-make" - dnf remove -y mingw32-filesystem mingw32-make - CHECK_RESULT $? 0 0 "卸载软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-make__r.sh b/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-make__r.sh deleted file mode 100644 index 016cf8d60e5..00000000000 --- a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-make__r.sh +++ /dev/null @@ -1,72 +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-28 -# @License : Mulan PSL v2 -# @Desc : 测试禁用内置隐式规则的选项 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:测试禁用内置隐式规则的选项" - - # 检查是否已安装 mingw32-filesystem 和 mingw32-make - LOG_INFO "检查 mingw32-filesystem 和 mingw32-make 是否已安装" - rpm -q mingw32-filesystem mingw32-make > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "mingw32-filesystem 和 mingw32-make 已安装" - INSTALLED=1 - else - LOG_INFO "mingw32-filesystem 和 mingw32-make 未安装" - INSTALLED=0 - fi - - # 如果未安装,则进行安装 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "检查 yum 源中是否存在 mingw32-filesystem 和 mingw32-make" - dnf list available mingw32-filesystem mingw32-make > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum 源中缺少 mingw32-filesystem 或 mingw32-make" - if [ $? -ne 0 ]; then - LOG_ERROR "yum 源中缺少 mingw32-filesystem 或 mingw32-make" - exit 255 - fi - - LOG_INFO "安装 mingw32-filesystem 和 mingw32-make" - dnf install -y mingw32-filesystem mingw32-make - CHECK_RESULT $? 0 0 "安装 mingw32-filesystem 和 mingw32-make 失败" - fi - - # 测试禁用内置隐式规则的选项 - LOG_INFO "测试 mingw32-make 的 -r 选项(禁用内置隐式规则)" - mingw32-make -r --version > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "mingw32-make 不支持 -r 选项" - exit 255 - fi - CHECK_RESULT $? 0 0 "mingw32-make -r 选项测试失败" - - # 清理环境:如果测试前未安装,则在测试后卸载 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载 mingw32-filesystem 和 mingw32-make" - dnf remove -y mingw32-filesystem mingw32-make - CHECK_RESULT $? 0 0 "卸载 mingw32-filesystem 和 mingw32-make 失败" - else - LOG_INFO "测试前已安装,保持 mingw32-filesystem 和 mingw32-make 的安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-make__s.sh b/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-make__s.sh deleted file mode 100644 index 76b7bca4353..00000000000 --- a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-make__s.sh +++ /dev/null @@ -1,72 +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-28 -# @License : Mulan PSL v2 -# @Desc : 测试不回应配方的静默执行选项 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 判断环境是否已安装指定软件包 - LOG_INFO "检查是否已安装 mingw32-filesystem 和 mingw32-make 软件包" - rpm -q mingw32-filesystem mingw32-make > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "软件包已安装,标记为已安装状态" - INSTALLED=1 - else - LOG_INFO "软件包未安装,标记为未安装状态" - INSTALLED=0 - fi - - # 检查yum源中是否存在指定的软件包 - LOG_INFO "检查yum源中是否存在 mingw32-filesystem 和 mingw32-make 软件包" - dnf list available mingw32-filesystem mingw32-make > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中不存在指定的软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在 mingw32-filesystem 或 mingw32-make 软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "开始安装 mingw32-filesystem 和 mingw32-make 软件包" - dnf install -y mingw32-filesystem mingw32-make - CHECK_RESULT $? 0 0 "安装软件包失败" - LOG_INFO "软件包安装成功" - fi - - # 测试不回应配方的静默执行选项 - LOG_INFO "测试 mingw32-make 的静默执行选项 -s" - mingw32-make -s --version > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "mingw32-make 不支持 -s 参数" - if [ $? -ne 0 ]; then - LOG_ERROR "mingw32-make 命令不支持 -s 参数" - exit 255 - fi - LOG_INFO "mingw32-make 支持 -s 参数,测试通过" - - # 清理环境:如果脚本开始时未安装,则卸载软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "开始卸载 mingw32-filesystem 和 mingw32-make 软件包" - dnf remove -y mingw32-filesystem mingw32-make - CHECK_RESULT $? 0 0 "卸载软件包失败" - LOG_INFO "软件包卸载成功,环境已恢复" - else - LOG_INFO "环境已安装软件包,保持安装状态" - fi -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-make__t.sh b/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-make__t.sh deleted file mode 100644 index 8349b04678d..00000000000 --- a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-make__t.sh +++ /dev/null @@ -1,97 +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-28 -# @License : Mulan PSL v2 -# @Desc : 测试触摸目标文件而非重新构建的选项 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "测试触摸目标文件而非重新构建的选项" - - # 定义软件包名称 - PACKAGE_NAME="mingw32-filesystem mingw32-make" - - # 检查软件包是否已在yum源中 - LOG_INFO "检查yum源中是否存在软件包: $PACKAGE_NAME" - for pkg in $PACKAGE_NAME; do - dnf list available "$pkg" &> /dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 $pkg 在yum源中不存在" - exit 255 - fi - done - - # 检查环境是否已安装软件包 - LOG_INFO "检查环境是否已安装软件包" - installed=0 - for pkg in $PACKAGE_NAME; do - rpm -q "$pkg" &> /dev/null - if [ $? -eq 0 ]; then - installed=1 - break - fi - done - - # 如果未安装,则安装软件包 - if [ $installed -eq 0 ]; then - LOG_INFO "安装软件包: $PACKAGE_NAME" - dnf install -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "安装软件包失败" - fi - - # 测试触摸目标文件而非重新构建的选项 - LOG_INFO "创建一个简单的Makefile用于测试" - cat > test_makefile << "EOF" - all: target - - target: - @echo "Building target..." - touch target - EOF - - LOG_INFO "首次执行make命令构建目标" - make -f test_makefile - CHECK_RESULT $? 0 0 "首次make执行失败" - - LOG_INFO "触摸源文件以测试make的-t选项" - touch test_makefile - - LOG_INFO "使用make -t命令触摸目标文件而非重新构建" - make -t -f test_makefile - CHECK_RESULT $? 0 0 "make -t执行失败" - - LOG_INFO "验证目标文件时间戳是否更新" - if [ test_makefile -nt target ]; then - LOG_ERROR "目标文件时间戳未正确更新" - exit 1 - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_makefile target - - # 如果脚本开始时未安装软件包,则在结束时卸载 - if [ $installed -eq 0 ]; then - LOG_INFO "卸载软件包: $PACKAGE_NAME" - dnf remove -y $PACKAGE_NAME - CHECK_RESULT $? 0 0 "卸载软件包失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-make__upper_b.sh b/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-make__upper_b.sh deleted file mode 100644 index bb276c69071..00000000000 --- a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-make__upper_b.sh +++ /dev/null @@ -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-11-30 -# @License : Mulan PSL v2 -# @Desc : 测试 mingw32-make 的 -B 参数,无条件构建所有目标 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 mingw32-make 的 -B 参数,无条件构建所有目标" - - # 检查是否已安装 mingw32-filesystem 和 mingw32-make - LOG_INFO "检查 mingw32-filesystem 和 mingw32-make 是否已安装" - if ! dnf list installed mingw32-filesystem &>/dev/null || ! dnf list installed mingw32-make &>/dev/null; then - LOG_INFO "环境未安装,准备安装 mingw32-filesystem 和 mingw32-make" - # 检查 yum 源中是否有该软件包 - if ! dnf list available mingw32-filesystem &>/dev/null || ! dnf list available mingw32-make &>/dev/null; then - LOG_ERROR "yum 源中未找到 mingw32-filesystem 或 mingw32-make" - exit 255 - fi - # 安装软件包 - dnf install -y mingw32-filesystem mingw32-make - CHECK_RESULT $? 0 0 "安装 mingw32-filesystem 和 mingw32-make 失败" - # 标记需要卸载 - NEED_UNINSTALL=1 - else - LOG_INFO "环境已安装,无需重复安装" - NEED_UNINSTALL=0 - fi - - # 测试 mingw32-make -B 参数 - LOG_INFO "测试 mingw32-make 的 -B 参数" - mingw32-make -B - CHECK_RESULT $? 0 0 "mingw32-make -B 执行失败" - - # 清理环境 - if [ $NEED_UNINSTALL -eq 1 ]; then - LOG_INFO "清理环境,卸载 mingw32-filesystem 和 mingw32-make" - dnf remove -y mingw32-filesystem mingw32-make - CHECK_RESULT $? 0 0 "卸载 mingw32-filesystem 和 mingw32-make失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-make__upper_c.sh b/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-make__upper_c.sh deleted file mode 100644 index 228f61cf618..00000000000 --- a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-make__upper_c.sh +++ /dev/null @@ -1,75 +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-30 -# @License : Mulan PSL v2 -# @Desc : 测试 mingw32-make 的 -C 参数,指定目录后执行构建 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装mingw32-filesystem和mingw32-make - LOG_INFO "检查是否已安装mingw32-filesystem和mingw32-make" - rpm -q mingw32-filesystem mingw32-make > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "软件包已安装,脚本结束时将保持安装状态" - INSTALLED=1 - else - LOG_INFO "软件包未安装,将在测试结束后卸载" - INSTALLED=0 - fi - - # 检查yum源中是否有mingw32-filesystem和mingw32-make - LOG_INFO "检查yum源中是否有mingw32-filesystem和mingw32-make" - dnf list available mingw32-filesystem mingw32-make > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到mingw32-filesystem或mingw32-make" - exit 255 - fi - - # 安装软件包(如果未安装) - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装mingw32-filesystem和mingw32-make" - dnf install -y mingw32-filesystem mingw32-make - CHECK_RESULT $? 0 0 "安装软件包失败" - fi - - # 测试-C参数 - LOG_INFO "测试-C参数,指定目录后执行构建" - mkdir -p test_build_dir && echo "all:" > test_build_dir/Makefile && echo -e "\t@echo \"Build successful\"" >> test_build_dir/Makefile - CHECK_RESULT $? 0 0 "创建测试目录和Makefile失败" - - # 执行构建命令 - LOG_INFO "执行mingw32-make -C test_build_dir" - mingw32-make -C test_build_dir > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "执行构建命令失败" - - # 清理测试目录 - LOG_INFO "清理测试目录" - rm -rf test_build_dir - - # 卸载软件包(如果脚本开始时未安装) - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载mingw32-filesystem和mingw32-make" - dnf remove -y mingw32-filesystem mingw32-make - CHECK_RESULT $? 0 0 "卸载软件包失败" - fi - - LOG_INFO "测试完成" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-make__upper_e.sh b/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-make__upper_e.sh deleted file mode 100644 index 32d888ca25f..00000000000 --- a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-make__upper_e.sh +++ /dev/null @@ -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-12-11 -# @License : Mulan PSL v2 -# @Desc : 测试将字符串作为makefile语句执行 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:测试将字符串作为makefile语句执行" - - # 检查是否已安装 mingw32-filesystem 和 mingw32-make - LOG_INFO "检查是否已安装 mingw32-filesystem 和 mingw32-make" - if rpm -q mingw32-filesystem mingw32-make &>/dev/null; then - LOG_INFO "软件包已安装,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "软件包未安装,将在测试结束后卸载" - INSTALLED=false - fi - - # 检查yum源中是否存在软件包 - LOG_INFO "检查yum源中是否存在 mingw32-filesystem 和 mingw32-make" - if ! dnf list available mingw32-filesystem mingw32-make &>/dev/null; then - LOG_ERROR "yum源中不存在所需软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装 mingw32-filesystem 和 mingw32-make" - dnf install -y mingw32-filesystem mingw32-make - CHECK_RESULT $? 0 0 "安装软件包失败" - fi - - # 测试将字符串作为makefile语句执行 - LOG_INFO "测试将字符串作为makefile语句执行" - TEST_STRING="all:\n\t@echo \"Hello, World!\"" - echo -e "$TEST_STRING" > test.mk - - mingw32-make -f test.mk - CHECK_RESULT $? 0 0 "执行makefile语句失败" - - # 清理临时文件 - rm -f test.mk - - # 如果之前未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载 mingw32-filesystem 和 mingw32-make" - dnf remove -y mingw32-filesystem mingw32-make - CHECK_RESULT $? 0 0 "卸载软件包失败" - fi - - LOG_INFO "测试完成:测试将字符串作为makefile语句执行" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-make__upper_i.sh b/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-make__upper_i.sh deleted file mode 100644 index 36a14ebbcbd..00000000000 --- a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-make__upper_i.sh +++ /dev/null @@ -1,60 +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-11 -# @License : Mulan PSL v2 -# @Desc : 测试包含目录 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查环境是否已安装指定软件包 - LOG_INFO "检查是否已安装 mingw32-filesystem 和 mingw32-make" - if dnf list installed mingw32-filesystem mingw32-make &>/dev/null; then - LOG_INFO "软件包已安装,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "软件包未安装,将在测试步骤中安装" - INSTALLED=false - fi - - # 检查yum源中是否存在指定软件包 - LOG_INFO "检查yum源中是否存在 mingw32-filesystem 和 mingw32-make" - if ! dnf list available mingw32-filesystem mingw32-make &>/dev/null; then - LOG_ERROR "yum源中不存在指定软件包" - exit 255 - fi - - # 安装软件包(如果未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装 mingw32-filesystem 和 mingw32-make" - dnf install -y mingw32-filesystem mingw32-make - CHECK_RESULT $? 0 0 "安装软件包失败" - fi - - # 测试包含目录功能 - LOG_INFO "测试包含目录功能" - ls /usr/i686-w64-mingw32/sys-root/mingw/ - CHECK_RESULT $? 0 0 "目录 /usr/i686-w64-mingw32/sys-root/mingw/ 不存在或无法访问" - - # 清理环境(如果之前未安装) - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载 mingw32-filesystem 和 mingw32-make" - dnf remove -y mingw32-filesystem mingw32-make - CHECK_RESULT $? 0 0 "卸载软件包失败" - fi -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-make__upper_l.sh b/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-make__upper_l.sh deleted file mode 100644 index 173af43e04b..00000000000 --- a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-make__upper_l.sh +++ /dev/null @@ -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 : 2025-12-11 -# @License : Mulan PSL v2 -# @Desc : 测试检查符号链接时间 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查符号链接时间测试脚本 - - LOG_INFO "开始测试:检查符号链接时间" - - # 检查是否已安装mingw32-filesystem和mingw32-make__upper_l - LOG_INFO "检查是否已安装mingw32-filesystem和mingw32-make__upper_l" - if rpm -q mingw32-filesystem mingw32-make__upper_l &>/dev/null; then - LOG_INFO "软件包已安装,测试结束后将保持安装状态" - INSTALLED=true - else - LOG_INFO "软件包未安装,测试结束后将卸载软件包" - INSTALLED=false - fi - - # 检查yum源中是否有mingw32-filesystem和mingw32-make__upper_l - LOG_INFO "检查yum源中是否有mingw32-filesystem和mingw32-make__upper_l" - if ! dnf list available mingw32-filesystem mingw32-make__upper_l &>/dev/null; then - LOG_ERROR "yum源中缺少必要的软件包" - exit 255 - fi - - # 安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "安装mingw32-filesystem和mingw32-make__upper_l" - dnf install -y mingw32-filesystem mingw32-make__upper_l - CHECK_RESULT $? 0 0 "安装软件包失败" - fi - - # 检查符号链接时间 - LOG_INFO "检查符号链接时间" - ls -l /usr/i686-w64-mingw32/sys-root/mingw/bin | grep -q "mingw32-make__upper_l" - CHECK_RESULT $? 0 0 "符号链接检查失败" - - # 清理环境 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载mingw32-filesystem和mingw32-make__upper_l" - dnf remove -y mingw32-filesystem mingw32-make__upper_l - CHECK_RESULT $? 0 0 "卸载软件包失败" - fi - - LOG_INFO "测试完成:检查符号链接时间" - -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-make__upper_o.sh b/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-make__upper_o.sh deleted file mode 100644 index ddb3f1b09e6..00000000000 --- a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-make__upper_o.sh +++ /dev/null @@ -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 : 2026-02-28 -# @License : Mulan PSL v2 -# @Desc : 测试同步并行作业输出的选项 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试同步并行作业输出的选项" - LOG_INFO "检查yum源中是否存在mingw32-filesystem和mingw32-make软件包" - dnf list available mingw32-filesystem mingw32-make > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中不存在mingw32-filesystem或mingw32-make软件包" - exit 255 - fi - LOG_INFO "检查mingw32-filesystem和mingw32-make是否已安装" - rpm -q mingw32-filesystem mingw32-make > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "mingw32-filesystem和mingw32-make已安装,测试结束后保持安装状态" - ALREADY_INSTALLED=1 - else - LOG_INFO "mingw32-filesystem和mingw32-make未安装,开始安装软件包" - dnf install -y mingw32-filesystem mingw32-make - CHECK_RESULT $? 0 0 "安装mingw32-filesystem和mingw32-make失败" - ALREADY_INSTALLED=0 - fi - LOG_INFO "测试mingw32-make的-j选项(同步并行作业输出)" - mingw32-make -j 4 --help > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "mingw32-make支持-j选项" - else - LOG_ERROR "mingw32-make不支持-j选项" - exit 255 - fi - LOG_INFO "执行mingw32-make -j 4命令测试并行作业输出" - mingw32-make -j 4 - CHECK_RESULT $? 0 0 "mingw32-make -j 4执行失败" - LOG_INFO "清理环境" - if [ $ALREADY_INSTALLED -eq 0 ]; then - LOG_INFO "卸载测试安装的mingw32-filesystem和mingw32-make软件包" - dnf remove -y mingw32-filesystem mingw32-make - CHECK_RESULT $? 0 0 "卸载mingw32-filesystem和mingw32-make失败" - else - LOG_INFO "保持mingw32-filesystem和mingw32-make的安装状态" - fi - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-make__upper_r.sh b/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-make__upper_r.sh deleted file mode 100644 index ed5e099b47e..00000000000 --- a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-make__upper_r.sh +++ /dev/null @@ -1,74 +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-28 -# @License : Mulan PSL v2 -# @Desc : 测试禁用内置变量设置的选项 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试禁用内置变量设置的选项" - LOG_INFO "检查yum源中是否存在mingw32-filesystem和mingw32-make软件包" - dnf list mingw32-filesystem mingw32-make > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到mingw32-filesystem或mingw32-make软件包" - exit 255 - fi - - LOG_INFO "检查当前环境中是否已安装mingw32-filesystem和mingw32-make软件包" - rpm -q mingw32-filesystem mingw32-make > /dev/null 2>&1 - if [ $? -eq 0 ]; then - already_installed=1 - LOG_INFO "软件包已安装,脚本结束后将保持安装状态" - else - already_installed=0 - LOG_INFO "软件包未安装,将在测试过程中安装并在结束后卸载" - fi - - if [ $already_installed -eq 0 ]; then - LOG_INFO "安装mingw32-filesystem和mingw32-make软件包" - dnf install -y mingw32-filesystem mingw32-make - CHECK_RESULT $? 0 0 "安装软件包失败" - fi - - LOG_INFO "检查mingw32-make命令是否支持--no-builtin-variables选项" - mingw32-make --help 2>&1 | grep -q -- "--no-builtin-variables" - if [ $? -ne 0 ]; then - LOG_ERROR "mingw32-make命令不支持--no-builtin-variables选项" - exit 255 - fi - - LOG_INFO "测试mingw32-make禁用内置变量设置选项" - cat > test_makefile << EOF - all: - echo "Testing no builtin variables" - EOF - mingw32-make --no-builtin-variables -f test_makefile - CHECK_RESULT $? 0 0 "禁用内置变量设置选项测试失败" - - LOG_INFO "清理测试文件" - rm -f test_makefile - - if [ $already_installed -eq 0 ]; then - LOG_INFO "卸载测试过程中安装的软件包" - dnf remove -y mingw32-filesystem mingw32-make - CHECK_RESULT $? 0 0 "卸载软件包失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-make__upper_s.sh b/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-make__upper_s.sh deleted file mode 100644 index 2a4d27b4239..00000000000 --- a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-make__upper_s.sh +++ /dev/null @@ -1,99 +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-28 -# @License : Mulan PSL v2 -# @Desc : 测试关闭-k选项(停止继续执行)的选项 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试关闭-k选项(停止继续执行)的选项" - - # 检查yum源中是否有指定软件包 - LOG_INFO "检查yum源中是否有mingw32-filesystem和mingw32-make软件包" - if ! dnf list available mingw32-filesystem mingw32-make &>/dev/null; then - LOG_ERROR "yum源中缺少mingw32-filesystem或mingw32-make软件包" - exit 255 - fi - - # 检查当前环境是否已安装软件包 - LOG_INFO "检查当前环境是否已安装mingw32-filesystem和mingw32-make软件包" - if rpm -q mingw32-filesystem mingw32-make &>/dev/null; then - LOG_INFO "软件包已安装,标记为已存在安装" - already_installed=true - else - LOG_INFO "软件包未安装,将在测试过程中安装" - already_installed=false - fi - - # 如果未安装,则安装软件包 - if [ "$already_installed" = false ]; then - LOG_INFO "安装mingw32-filesystem和mingw32-make软件包" - dnf install -y mingw32-filesystem mingw32-make - CHECK_RESULT $? 0 0 "安装软件包失败" - fi - - # 测试关闭-k选项 - LOG_INFO "测试mingw32-make命令的-k选项" - # 模拟一个简单的Makefile用于测试 - cat > test_makefile << "EOF" - all: target1 target2 target3 - - target1: - @echo "Building target1" - false # 模拟失败 - - target2: - @echo "Building target2" - - target3: - @echo "Building target3" - EOF - - LOG_INFO "执行mingw32-make -k测试(默认开启-k选项)" - mingw32-make -f test_makefile - make_default_result=$? - - LOG_INFO "执行mingw32-make -k测试(关闭-k选项)" - mingw32-make -k -f test_makefile - make_k_option_result=$? - - # 检查-k选项的行为差异 - LOG_INFO "检查-k选项的行为" - if [ $make_default_result -eq 0 ] && [ $make_k_option_result -ne 0 ]; then - LOG_INFO "-k选项测试通过:开启-k时继续执行,关闭-k时停止执行" - else - LOG_ERROR "-k选项测试失败:行为不符合预期" - CHECK_RESULT 1 0 0 "-k选项测试失败" - fi - - # 清理测试文件 - LOG_INFO "清理测试文件" - rm -f test_makefile - - # 如果测试开始时未安装软件包,则在测试结束后卸载 - if [ "$already_installed" = false ]; then - LOG_INFO "卸载测试安装的软件包" - dnf remove -y mingw32-filesystem mingw32-make - CHECK_RESULT $? 0 0 "卸载软件包失败" - else - LOG_INFO "保持软件包安装状态" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-make__upper_w.sh b/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-make__upper_w.sh deleted file mode 100644 index a013d642a40..00000000000 --- a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-make__upper_w.sh +++ /dev/null @@ -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 : 2026-02-28 -# @License : Mulan PSL v2 -# @Desc : 测试将文件视为无限新的选项 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试:测试将文件视为无限新的选项" - LOG_INFO "步骤1:检查是否已安装 mingw32-filesystem 和 mingw32-make 软件包" - rpm -q mingw32-filesystem mingw32-make > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "软件包已安装,标记为已安装状态" - INSTALLED=true - else - LOG_INFO "软件包未安装,标记为未安装状态" - INSTALLED=false - fi - LOG_INFO "步骤2:检查yum源中是否有 mingw32-filesystem 和 mingw32-make 软件包" - dnf list available mingw32-filesystem mingw32-make > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中没有找到 mingw32-filesystem 或 mingw32-make 软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中没有找到 mingw32-filesystem 或 mingw32-make 软件包" - exit 255 - fi - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "步骤3:安装 mingw32-filesystem 和 mingw32-make 软件包" - dnf install -y mingw32-filesystem mingw32-make - CHECK_RESULT $? 0 0 "安装 mingw32-filesystem 或 mingw32-make 失败" - fi - LOG_INFO "步骤4:测试将文件视为无限新的选项" - touch testfile.txt - mingw32-make --assume-new=testfile.txt - CHECK_RESULT $? 0 0 "mingw32-make 命令执行失败或参数 --assume-new 不支持" - LOG_INFO "步骤5:检查命令执行结果" - if [ -f testfile.txt ]; then - LOG_INFO "测试文件存在,测试通过" - else - LOG_ERROR "测试文件不存在,测试失败" - exit 1 - fi - LOG_INFO "步骤6:清理测试环境" - rm -f testfile.txt - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "步骤7:卸载 mingw32-filesystem 和 mingw32-make 软件包" - dnf remove -y mingw32-filesystem mingw32-make - CHECK_RESULT $? 0 0 "卸载 mingw32-filesystem 或 mingw32-make 失败" - fi - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-make__v.sh b/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-make__v.sh deleted file mode 100644 index 10aed25c9f4..00000000000 --- a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-make__v.sh +++ /dev/null @@ -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 : 2026-02-28 -# @License : Mulan PSL v2 -# @Desc : 测试打印make版本号并退出的选项 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义测试用的软件包名称 - PACKAGE_NAME="mingw32-filesystem" - MAKE_PACKAGE="mingw32-make" - - # 步骤1: 检查yum源中是否存在指定的软件包 - LOG_INFO "检查yum源中是否存在软件包: ${PACKAGE_NAME} 和 ${MAKE_PACKAGE}" - dnf list available ${PACKAGE_NAME} ${MAKE_PACKAGE} > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum源中不存在指定的软件包" - - # 步骤2: 检查当前环境中是否已经安装了指定的软件包 - LOG_INFO "检查当前环境中是否已经安装了软件包" - if rpm -q ${PACKAGE_NAME} ${MAKE_PACKAGE} > /dev/null 2>&1; then - LOG_INFO "软件包已经安装,标记为已安装状态" - INSTALLED="true" - else - LOG_INFO "软件包未安装,标记为未安装状态" - INSTALLED="false" - fi - - # 步骤3: 如果未安装,则安装软件包 - if [ "${INSTALLED}" = "false" ]; then - LOG_INFO "开始安装软件包: ${PACKAGE_NAME} 和 ${MAKE_PACKAGE}" - dnf install -y ${PACKAGE_NAME} ${MAKE_PACKAGE} - CHECK_RESULT $? 0 0 "安装软件包失败" - fi - - # 步骤4: 测试打印make版本号并退出的选项 - LOG_INFO "测试打印make版本号并退出的选项" - mingw32-make --version > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "执行mingw32-make --version失败" - - # 步骤5: 清理环境,恢复到之前的状态 - if [ "${INSTALLED}" = "false" ]; then - LOG_INFO "卸载测试过程中安装的软件包" - dnf remove -y ${PACKAGE_NAME} ${MAKE_PACKAGE} - CHECK_RESULT $? 0 0 "卸载软件包失败" - else - LOG_INFO "环境已安装,保持安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-make__w.sh b/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-make__w.sh deleted file mode 100644 index dea37625c2a..00000000000 --- a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-make__w.sh +++ /dev/null @@ -1,120 +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-28 -# @License : Mulan PSL v2 -# @Desc : 测试打印当前目录的选项 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已经安装mingw32-filesystem和mingw32-make__w软件包 - LOG_INFO "检查是否已安装mingw32-filesystem和mingw32-make__w软件包" - - # 检查mingw32-filesystem - rpm -q mingw32-filesystem > /dev/null 2>&1 - mingw32_filesystem_installed=$? - - # 检查mingw32-make__w - rpm -q mingw32-make__w > /dev/null 2>&1 - mingw32_make_w_installed=$? - - # 判断是否已经安装 - if [ $mingw32_filesystem_installed -eq 0 ] && [ $mingw32_make_w_installed -eq 0 ]; then - LOG_INFO "软件包已经安装,测试完成后将保持安装状态" - already_installed=1 - else - LOG_INFO "软件包未安装,将在测试前安装并在测试后卸载" - already_installed=0 - fi - - # 检查yum源中是否有mingw32-filesystem软件包 - LOG_INFO "检查yum源中是否有mingw32-filesystem软件包" - dnf list available mingw32-filesystem > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中没有mingw32-filesystem软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中没有mingw32-filesystem软件包" - exit 255 - fi - - # 检查yum源中是否有mingw32-make__w软件包 - LOG_INFO "检查yum源中是否有mingw32-make__w软件包" - dnf list available mingw32-make__w > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum源中没有mingw32-make__w软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中没有mingw32-make__w软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $already_installed -eq 0 ]; then - LOG_INFO "安装mingw32-filesystem软件包" - dnf install -y mingw32-filesystem - CHECK_RESULT $? 0 0 "安装mingw32-filesystem软件包失败" - - LOG_INFO "安装mingw32-make__w软件包" - dnf install -y mingw32-make__w - CHECK_RESULT $? 0 0 "安装mingw32-make__w软件包失败" - fi - - # 测试打印当前目录的选项 - LOG_INFO "测试打印当前目录的选项" - - # 检查mingw32-make__w命令是否存在 - LOG_INFO "检查mingw32-make__w命令是否存在" - which mingw32-make__w > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "mingw32-make__w命令不存在" - - # 测试mingw32-make__w命令的--help选项 - LOG_INFO "测试mingw32-make__w命令的--help选项" - mingw32-make__w --help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "mingw32-make__w命令不支持--help选项" - - # 测试mingw32-make__w命令的-v选项(版本信息) - LOG_INFO "测试mingw32-make__w命令的-v选项" - mingw32-make__w -v > /dev/null 2>&1 - if [ $? -eq 255 ]; then - LOG_ERROR "mingw32-make__w命令不支持-v选项" - exit 255 - fi - - # 测试mingw32-make__w命令的-p选项(打印数据库) - LOG_INFO "测试mingw32-make__w命令的-p选项" - mingw32-make__w -p > /dev/null 2>&1 - if [ $? -eq 255 ]; then - LOG_ERROR "mingw32-make__w命令不支持-p选项" - exit 255 - fi - - # 清理环境 - LOG_INFO "清理测试环境" - - # 如果测试前未安装,则卸载软件包 - if [ $already_installed -eq 0 ]; then - LOG_INFO "卸载mingw32-make__w软件包" - dnf remove -y mingw32-make__w - CHECK_RESULT $? 0 0 "卸载mingw32-make__w软件包失败" - - LOG_INFO "卸载mingw32-filesystem软件包" - dnf remove -y mingw32-filesystem - CHECK_RESULT $? 0 0 "卸载mingw32-filesystem软件包失败" - else - LOG_INFO "软件包已安装,保持安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-meson__v.sh b/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-meson__v.sh deleted file mode 100644 index bc1b8531912..00000000000 --- a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-meson__v.sh +++ /dev/null @@ -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-11-30 -# @License : Mulan PSL v2 -# @Desc : 测试 mingw32-meson 命令的 -v 参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 mingw32-meson 命令的 -v 参数" - - # 检查软件包是否已安装 - LOG_INFO "检查 mingw32-filesystem 和 mingw32-meson 是否已安装" - if ! dnf list installed mingw32-filesystem &>/dev/null || ! dnf list installed mingw32-meson &>/dev/null; then - LOG_INFO "软件包未安装,开始安装" - # 检查 yum 源中是否有该软件包 - if ! dnf list available mingw32-filesystem &>/dev/null || ! dnf list available mingw32-meson &>/dev/null; then - LOG_ERROR "yum 源中缺少必要的软件包" - exit 255 - fi - # 安装软件包 - dnf install -y mingw32-filesystem mingw32-meson - CHECK_RESULT $? 0 0 "安装软件包失败" - # 标记需要卸载 - NEED_UNINSTALL=1 - else - LOG_INFO "软件包已安装,无需重复安装" - NEED_UNINSTALL=0 - fi - - # 测试 -v 参数 - LOG_INFO "测试 mingw32-meson -v 命令" - mingw32-meson -v - CHECK_RESULT $? 0 0 "执行 mingw32-meson -v 失败" - - # 清理环境 - if [ "$NEED_UNINSTALL" -eq 1 ]; then - LOG_INFO "清理环境,卸载软件包" - dnf remove -y mingw32-filesystem mingw32-meson - CHECK_RESULT $? 0 0 "卸载软件包失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-meson_build.sh b/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-meson_build.sh deleted file mode 100644 index 938f97462ee..00000000000 --- a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-meson_build.sh +++ /dev/null @@ -1,142 +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-28 -# @License : Mulan PSL v2 -# @Desc : 测试 mingw32-meson 命令的 build 子命令 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 定义颜色变量(可选,用于日志高亮) - RED="\033[0;31m" - GREEN="\033[0;32m" - NC="\033[0m" # No Color - - # 定义日志函数 - LOG_INFO() { - echo -e "${GREEN}[INFO]${NC} $1" - } - - LOG_ERROR() { - echo -e "${RED}[ERROR]${NC} $1" - } - - # 检查软件包是否存在于yum源中 - check_package_in_repo() { - local package=$1 - LOG_INFO "检查yum源中是否存在软件包: $package" - dnf list available "$package" &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "软件包 $package 在yum源中不存在" - exit 255 - fi - LOG_INFO "软件包 $package 存在于yum源中" - } - - # 检查命令参数是否支持 - check_command_option() { - local command=$1 - local option=$2 - LOG_INFO "检查命令 $command 是否支持参数 $option" - $command --help 2>&1 | grep -q "$option" - if [ $? -ne 0 ]; then - LOG_ERROR "命令 $command 不支持参数 $option" - exit 255 - fi - LOG_INFO "命令 $command 支持参数 $option" - } - - # 检查命令执行结果 - check_command_result() { - local result=$1 - local expected=$2 - local error_message=$3 - if [ $result -ne $expected ]; then - LOG_ERROR "$error_message" - exit $result - fi - } - - # 检查是否已安装软件包 - check_installed() { - local package=$1 - LOG_INFO "检查软件包 $package 是否已安装" - rpm -q "$package" &>/dev/null - return $? - } - - # 安装软件包 - install_package() { - local package=$1 - LOG_INFO "安装软件包: $package" - dnf install -y "$package" - CHECK_RESULT $? 0 0 "安装软件包 $package 失败" - } - - # 卸载软件包 - uninstall_package() { - local package=$1 - LOG_INFO "卸载软件包: $package" - dnf remove -y "$package" - CHECK_RESULT $? 0 0 "卸载软件包 $package 失败" - } - - # 主测试函数 - test_mingw32_meson_build() { - LOG_INFO "开始测试 mingw32-meson 命令的 build 子命令" - - # 定义需要测试的软件包 - PACKAGE="mingw32-filesystem" - COMMAND="mingw32-meson" - SUBCOMMAND="build" - - # 检查软件包是否在yum源中存在 - check_package_in_repo "$PACKAGE" - - # 检查命令是否支持build子命令 - check_command_option "$COMMAND" "$SUBCOMMAND" - - # 检查环境是否已安装 - check_installed "$PACKAGE" - local already_installed=$? - - # 如果未安装,则安装 - if [ $already_installed -ne 0 ]; then - install_package "$PACKAGE" - else - LOG_INFO "软件包 $PACKAGE 已安装,跳过安装步骤" - fi - - # 测试build子命令 - LOG_INFO "测试 mingw32-meson build 子命令" - $COMMAND $SUBCOMMAND --help - CHECK_RESULT $? 0 0 "mingw32-meson build 子命令执行失败" - - # 清理环境:如果之前未安装,则卸载 - if [ $already_installed -ne 0 ]; then - uninstall_package "$PACKAGE" - else - LOG_INFO "保持软件包 $PACKAGE 的安装状态" - fi - - LOG_INFO "测试完成" - } - - # 执行测试 - test_mingw32_meson_build -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-meson_configure.sh b/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-meson_configure.sh deleted file mode 100644 index c786a482746..00000000000 --- a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-meson_configure.sh +++ /dev/null @@ -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-02-28 -# @License : Mulan PSL v2 -# @Desc : 测试 mingw32-meson 命令的 configure 子命令 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已经安装了必要的软件包 - LOG_INFO "检查mingw32-filesystem和mingw32-meson是否已安装" - rpm -q mingw32-filesystem mingw32-meson > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "软件包已安装,测试结束后将保持安装状态" - INSTALLED="true" - else - LOG_INFO "软件包未安装,将在测试过程中安装" - INSTALLED="false" - fi - - # 检查yum源中是否有mingw32-filesystem和mingw32-meson软件包 - LOG_INFO "检查yum源中是否有mingw32-filesystem和mingw32-meson软件包" - dnf list available mingw32-filesystem mingw32-meson > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中没有mingw32-filesystem或mingw32-meson软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "安装mingw32-filesystem和mingw32-meson软件包" - dnf install -y mingw32-filesystem mingw32-meson - CHECK_RESULT $? 0 0 "安装mingw32-filesystem和mingw32-meson失败" - fi - - # 测试mingw32-meson命令的configure子命令 - LOG_INFO "测试mingw32-meson configure子命令的基本功能" - mingw32-meson configure --help > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "mingw32-meson configure子命令不存在或不支持" - - LOG_INFO "测试mingw32-meson configure子命令的参数检查" - mingw32-meson configure --invalid-option > /dev/null 2>&1 - if [ $? -ne 255 ]; then - LOG_ERROR "mingw32-meson configure子命令参数检查失败" - exit 255 - fi - - LOG_INFO "测试mingw32-meson configure子命令的实际配置功能" - mkdir -p test_build_dir - cd test_build_dir - mingw32-meson configure ../ > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "mingw32-meson configure子命令执行失败" - cd .. - rm -rf test_build_dir - - # 清理环境:如果测试前未安装,则卸载软件包 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "卸载mingw32-filesystem和mingw32-meson软件包" - dnf remove -y mingw32-filesystem mingw32-meson - CHECK_RESULT $? 0 0 "卸载mingw32-filesystem和mingw32-meson失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-meson_help.sh b/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-meson_help.sh deleted file mode 100644 index 4aff8fd2104..00000000000 --- a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-meson_help.sh +++ /dev/null @@ -1,101 +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-28 -# @License : Mulan PSL v2 -# @Desc : 测试 mingw32-meson 命令的帮助信息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 初始化环境变量 - LOG_FILE="/tmp/test_mingw32-meson_help.log" - - # 清理日志文件 - > $LOG_FILE - - # 定义软件包名称 - PACKAGE_NAME="mingw32-filesystem" - COMMAND_NAME="mingw32-meson" - - # 步骤1:检查yum源中是否存在指定软件包 - LOG_INFO "检查yum源中是否存在软件包:$PACKAGE_NAME" - dnf list available $PACKAGE_NAME &> /dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到软件包:$PACKAGE_NAME" - exit 255 - fi - - # 步骤2:检查系统是否已安装指定软件包 - LOG_INFO "检查系统是否已安装软件包:$PACKAGE_NAME" - rpm -q $PACKAGE_NAME &> /dev/null - if [ $? -eq 0 ]; then - LOG_INFO "软件包 $PACKAGE_NAME 已安装,跳过安装步骤" - INSTALLED_BEFORE="yes" - else - LOG_INFO "软件包 $PACKAGE_NAME 未安装,开始安装" - INSTALLED_BEFORE="no" - dnf install -y $PACKAGE_NAME &>> $LOG_FILE - CHECK_RESULT $? 0 0 "安装软件包 $PACKAGE_NAME 失败" - fi - - # 步骤3:检查 mingw32-meson 命令是否存在 - LOG_INFO "检查命令 $COMMAND_NAME 是否存在" - which $COMMAND_NAME &> /dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "命令 $COMMAND_NAME 不存在" - if [ "$INSTALLED_BEFORE" = "no" ]; then - dnf remove -y $PACKAGE_NAME &>> $LOG_FILE - LOG_INFO "已卸载软件包 $PACKAGE_NAME" - fi - exit 255 - fi - - # 步骤4:检查 mingw32-meson 命令是否支持 --help 参数 - LOG_INFO "检查命令 $COMMAND_NAME 是否支持 --help 参数" - $COMMAND_NAME --help &> /dev/null - if [ $? -eq 255 ]; then - LOG_ERROR "命令 $COMMAND_NAME 不支持 --help 参数" - if [ "$INSTALLED_BEFORE" = "no" ]; then - dnf remove -y $PACKAGE_NAME &>> $LOG_FILE - LOG_INFO "已卸载软件包 $PACKAGE_NAME" - fi - exit 255 - fi - - # 步骤5:执行 mingw32-meson --help 命令 - LOG_INFO "执行命令 $COMMAND_NAME --help" - $COMMAND_NAME --help &>> $LOG_FILE - CHECK_RESULT $? 0 0 "执行 $COMMAND_NAME --help 命令失败" - - # 步骤6:验证帮助信息输出是否包含关键字 - LOG_INFO "验证帮助信息输出是否包含关键字 "usage" 或 "options"" - $COMMAND_NAME --help 2>&1 | grep -q -E "usage|options" - CHECK_RESULT $? 0 0 "帮助信息输出不符合预期" - - # 步骤7:环境恢复 - LOG_INFO "开始环境恢复" - if [ "$INSTALLED_BEFORE" = "no" ]; then - dnf remove -y $PACKAGE_NAME &>> $LOG_FILE - CHECK_RESULT $? 0 0 "卸载软件包 $PACKAGE_NAME 失败" - LOG_INFO "已卸载软件包 $PACKAGE_NAME,环境恢复完成" - else - LOG_INFO "软件包 $PACKAGE_NAME 保持安装状态,无需卸载" - fi - - LOG_INFO "测试脚本执行完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-meson_install.sh b/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-meson_install.sh deleted file mode 100644 index 1b121f3f6ff..00000000000 --- a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-meson_install.sh +++ /dev/null @@ -1,75 +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-28 -# @License : Mulan PSL v2 -# @Desc : 测试 mingw32-meson 命令的 install 子命令 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "开始测试 mingw32-meson 命令的 install 子命令" - - # 检查 yum 源中是否存在 mingw32-filesystem 和 mingw32-meson 软件包 - LOG_INFO "步骤1:检查 yum 源中是否存在 mingw32-filesystem 和 mingw32-meson 软件包" - if ! dnf list available mingw32-filesystem mingw32-meson &>/dev/null; then - LOG_ERROR "yum 源中未找到 mingw32-filesystem 或 mingw32-meson 软件包" - exit 255 - fi - - # 检查当前环境是否已安装 mingw32-filesystem 和 mingw32-meson - LOG_INFO "步骤2:检查当前环境是否已安装 mingw32-filesystem 和 mingw32-meson" - if rpm -q mingw32-filesystem mingw32-meson &>/dev/null; then - LOG_INFO "环境已安装 mingw32-filesystem 和 mingw32-meson,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "环境未安装 mingw32-filesystem 和 mingw32-meson,将进行安装测试" - INSTALLED=false - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤3:安装 mingw32-filesystem 和 mingw32-meson 软件包" - dnf install -y mingw32-filesystem mingw32-meson - CHECK_RESULT $? 0 0 "安装 mingw32-filesystem 和 mingw32-meson 失败" - fi - - # 测试 mingw32-meson install 子命令的基本功能 - LOG_INFO "步骤4:测试 mingw32-meson install 子命令的基本功能" - mingw32-meson install --help - CHECK_RESULT $? 0 0 "mingw32-meson install 子命令 --help 参数执行失败" - - # 测试一个不支持的参数 - LOG_INFO "步骤5:测试 mingw32-meson install 子命令不支持参数的情况" - if mingw32-meson install --invalid-option 2>&1 | grep -q "unrecognized option"; then - LOG_INFO "检测到不支持的参数,符合预期" - else - LOG_ERROR "未检测到不支持的参数,测试失败" - exit 255 - fi - - # 清理环境:如果之前未安装,则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "步骤6:清理环境,卸载 mingw32-filesystem 和 mingw32-meson 软件包" - dnf remove -y mingw32-filesystem mingw32-meson - CHECK_RESULT $? 0 0 "卸载 mingw32-filesystem 和 mingw32-meson 失败" - fi - - LOG_INFO "测试完成,环境已恢复" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-meson_setup.sh b/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-meson_setup.sh deleted file mode 100644 index d2076b12a85..00000000000 --- a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-meson_setup.sh +++ /dev/null @@ -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-02-28 -# @License : Mulan PSL v2 -# @Desc : 测试 mingw32-meson 命令最基本的 setup 子命令 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装 mingw32-filesystem 和 mingw32-meson - LOG_INFO "检查是否已安装 mingw32-filesystem 和 mingw32-meson" - if rpm -q mingw32-filesystem mingw32-meson &>/dev/null; then - LOG_INFO "软件包已安装,测试结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "软件包未安装,将在测试过程中安装并在测试结束后卸载" - INSTALLED=0 - fi - - # 检查yum源中是否有 mingw32-filesystem 和 mingw32-meson 软件包 - LOG_INFO "检查yum源中是否有 mingw32-filesystem 和 mingw32-meson 软件包" - if ! dnf list available mingw32-filesystem mingw32-meson &>/dev/null; then - LOG_ERROR "yum源中缺少 mingw32-filesystem 或 mingw32-meson 软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装 mingw32-filesystem 和 mingw32-meson 软件包" - dnf install -y mingw32-filesystem mingw32-meson - CHECK_RESULT $? 0 0 "安装 mingw32-filesystem 和 mingw32-meson 失败" - fi - - # 测试 mingw32-meson 命令最基本的 setup 子命令 - LOG_INFO "测试 mingw32-meson 命令最基本的 setup 子命令" - mingw32-meson setup --help &>/dev/null - CHECK_RESULT $? 0 0 "mingw32-meson setup 子命令不支持或执行失败" - - LOG_INFO "执行 mingw32-meson setup 命令测试" - mingw32-meson setup --help | grep -q "usage:" - CHECK_RESULT $? 0 0 "mingw32-meson setup 命令输出不符合预期" - - # 清理环境:如果之前未安装,则卸载软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载 mingw32-filesystem 和 mingw32-meson 软件包" - dnf remove -y mingw32-filesystem mingw32-meson - CHECK_RESULT $? 0 0 "卸载 mingw32-filesystem 和 mingw32-meson 失败" - else - LOG_INFO "保持 mingw32-filesystem 和 mingw32-meson 软件包安装状态" - fi - - LOG_INFO "测试脚本执行完毕" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-meson_test.sh b/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-meson_test.sh deleted file mode 100644 index 6dbb09a1b23..00000000000 --- a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-meson_test.sh +++ /dev/null @@ -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-02-28 -# @License : Mulan PSL v2 -# @Desc : 测试 mingw32-meson 命令的 test 子命令 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 mingw32-meson 命令的 test 子命令" - LOG_INFO "检查 yum 源中是否存在 mingw32-filesystem 和 mingw32-meson 软件包" - dnf list available mingw32-filesystem mingw32-meson &>/dev/null - if [ $? -ne 0 ]; then - LOG_ERROR "yum 源中未找到 mingw32-filesystem 或 mingw32-meson 软件包" - exit 255 - fi - - LOG_INFO "检查当前环境中是否已安装 mingw32-filesystem 和 mingw32-meson" - rpm -q mingw32-filesystem mingw32-meson &>/dev/null - if [ $? -eq 0 ]; then - already_installed=1 - LOG_INFO "软件包已安装,测试结束后将保持安装状态" - else - already_installed=0 - LOG_INFO "软件包未安装,将进行安装作为测试步骤" - fi - - if [ $already_installed -eq 0 ]; then - LOG_INFO "安装 mingw32-filesystem 和 mingw32-meson 软件包" - dnf install -y mingw32-filesystem mingw32-meson - CHECK_RESULT $? 0 0 "安装 mingw32-filesystem 和 mingw32-meson 失败" - fi - - LOG_INFO "检查 mingw32-meson 命令是否支持 test 子命令" - mingw32-meson --help | grep -q "test" - if [ $? -ne 0 ]; then - LOG_ERROR "mingw32-meson 命令不支持 test 子命令" - if [ $already_installed -eq 0 ]; then - LOG_INFO "清理环境,卸载已安装的软件包" - dnf remove -y mingw32-filesystem mingw32-meson - fi - exit 255 - fi - - LOG_INFO "执行 mingw32-meson test 命令测试" - mingw32-meson test --help - CHECK_RESULT $? 0 0 "mingw32-meson test 命令执行失败" - - if [ $already_installed -eq 0 ]; then - LOG_INFO "清理环境,卸载已安装的软件包" - dnf remove -y mingw32-filesystem mingw32-meson - CHECK_RESULT $? 0 0 "卸载 mingw32-filesystem 和 mingw32-meson 失败" - else - LOG_INFO "环境已安装软件包,保持安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-meson_version.sh b/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-meson_version.sh deleted file mode 100644 index 54a728328a3..00000000000 --- a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-meson_version.sh +++ /dev/null @@ -1,74 +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-28 -# @License : Mulan PSL v2 -# @Desc : 测试 mingw32-meson 命令的版本信息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装mingw32-filesystem和mingw32-meson - LOG_INFO "检查是否已安装mingw32-filesystem和mingw32-meson" - rpm -q mingw32-filesystem mingw32-meson > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "软件包已安装,测试结束后将保持安装状态" - INSTALLED=1 - else - LOG_INFO "软件包未安装,将在测试过程中安装" - INSTALLED=0 - fi - - # 检查yum源中是否有mingw32-filesystem和mingw32-meson软件包 - LOG_INFO "检查yum源中是否有mingw32-filesystem和mingw32-meson软件包" - dnf list available mingw32-filesystem mingw32-meson > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中缺少mingw32-filesystem或mingw32-meson软件包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "安装mingw32-filesystem和mingw32-meson软件包" - dnf install -y mingw32-filesystem mingw32-meson - CHECK_RESULT $? 0 0 "安装mingw32-filesystem和mingw32-meson失败" - fi - - # 测试mingw32-meson命令的版本信息 - LOG_INFO "测试mingw32-meson命令的版本信息" - mingw32-meson --version - CHECK_RESULT $? 0 0 "执行mingw32-meson --version失败" - - # 测试mingw32-meson命令是否支持--version参数 - LOG_INFO "验证mingw32-meson命令是否支持--version参数" - mingw32-meson --version > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "mingw32-meson命令不支持--version参数" - exit 255 - fi - - # 如果测试前未安装,则卸载软件包以恢复环境 - if [ $INSTALLED -eq 0 ]; then - LOG_INFO "卸载mingw32-filesystem和mingw32-meson软件包以恢复环境" - dnf remove -y mingw32-filesystem mingw32-meson - CHECK_RESULT $? 0 0 "卸载mingw32-filesystem和mingw32-meson失败" - else - LOG_INFO "测试前软件包已安装,保持安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-pkg-config__at.sh b/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-pkg-config__at.sh deleted file mode 100644 index 9c996296cba..00000000000 --- a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-pkg-config__at.sh +++ /dev/null @@ -1,78 +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-28 -# @License : Mulan PSL v2 -# @Desc : 测试 mingw32-pkg-config 的 @ 参数,从文件读取额外的命令行参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 环境检查:判断是否已安装 mingw32-filesystem 和 mingw32-pkg-config - LOG_INFO "检查是否已安装 mingw32-filesystem 和 mingw32-pkg-config" - dnf list installed mingw32-filesystem mingw32-pkg-config > /dev/null 2>&1 - installed=$? - - if [ $installed -eq 0 ]; then - LOG_INFO "软件包已安装,测试结束后将保持安装状态" - need_cleanup=0 - else - LOG_INFO "软件包未安装,将在测试结束后卸载" - need_cleanup=1 - fi - - # 检查 yum 源中是否存在所需软件包 - LOG_INFO "检查 yum 源中是否存在 mingw32-filesystem 和 mingw32-pkg-config" - dnf list available mingw32-filesystem mingw32-pkg-config > /dev/null 2>&1 - CHECK_RESULT $? 0 255 "yum 源中缺少所需软件包" - - # 安装软件包(如果未安装) - if [ $installed -ne 0 ]; then - LOG_INFO "安装 mingw32-filesystem 和 mingw32-pkg-config" - dnf install -y mingw32-filesystem mingw32-pkg-config - CHECK_RESULT $? 0 0 "安装软件包失败" - fi - - # 测试 mingw32-pkg-config 的 @ 参数 - LOG_INFO "测试 mingw32-pkg-config 的 @ 参数:从文件读取额外的命令行参数" - - # 创建一个临时文件,包含额外的参数 - tmpfile=$(mktemp /tmp/pkgconfig_args.XXXXXX) - echo "--cflags" > $tmpfile - - # 测试 @ 参数是否存在 - LOG_INFO "检查 mingw32-pkg-config 是否支持 @ 参数" - mingw32-pkg-config --help | grep -q "@" - CHECK_RESULT $? 0 255 "mingw32-pkg-config 不支持 @ 参数" - - # 执行测试命令:使用 @ 参数从文件读取额外参数 - LOG_INFO "执行 mingw32-pkg-config @$tmpfile gtk+-3.0" - mingw32-pkg-config "@$tmpfile" gtk+-3.0 > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "使用 @ 参数从文件读取额外参数失败" - - # 清理临时文件 - rm -f $tmpfile - - # 环境恢复:如果测试前未安装,则卸载软件包 - if [ $need_cleanup -eq 1 ]; then - LOG_INFO "卸载测试安装的软件包" - dnf remove -y mingw32-filesystem mingw32-pkg-config - CHECK_RESULT $? 0 0 "卸载软件包失败" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-pkg-config__cflags.sh b/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-pkg-config__cflags.sh deleted file mode 100644 index 0f4bd94367e..00000000000 --- a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-pkg-config__cflags.sh +++ /dev/null @@ -1,76 +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-28 -# @License : Mulan PSL v2 -# @Desc : 测试 mingw32-pkg-config 的 --cflags 参数,输出指定软件包的编译标志 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 mingw32-pkg-config 的 --cflags 参数功能" - - # 检查是否已安装 mingw32-filesystem 和 mingw32-pkg-config - LOG_INFO "检查 mingw32-filesystem 和 mingw32-pkg-config 是否已安装" - dnf list installed mingw32-filesystem mingw32-pkg-config >/dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "软件包已安装,测试后保持安装状态" - INSTALLED="true" - else - LOG_INFO "软件包未安装,将在测试前安装" - INSTALLED="false" - fi - - # 检查 yum 源中是否存在软件包 - LOG_INFO "检查 yum 源中是否存在 mingw32-filesystem 和 mingw32-pkg-config" - dnf list available mingw32-filesystem mingw32-pkg-config >/dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum 源中不存在 mingw32-filesystem 或 mingw32-pkg-config" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "安装 mingw32-filesystem 和 mingw32-pkg-config" - dnf install -y mingw32-filesystem mingw32-pkg-config - CHECK_RESULT $? 0 0 "安装 mingw32-filesystem 和 mingw32-pkg-config 失败" - fi - - # 检查 mingw32-pkg-config 是否支持 --cflags 参数 - LOG_INFO "检查 mingw32-pkg-config 是否支持 --cflags 参数" - mingw32-pkg-config --cflags --help >/dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "mingw32-pkg-config 不支持 --cflags 参数" - exit 255 - fi - - # 测试 mingw32-pkg-config 的 --cflags 参数 - LOG_INFO "测试 mingw32-pkg-config 的 --cflags 参数,输出指定软件包的编译标志" - mingw32-pkg-config --cflags mingw32-filesystem - CHECK_RESULT $? 0 0 "mingw32-pkg-config --cflags 参数执行失败" - - # 环境恢复 - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "卸载测试安装的 mingw32-filesystem 和 mingw32-pkg-config" - dnf remove -y mingw32-filesystem mingw32-pkg-config - CHECK_RESULT $? 0 0 "卸载 mingw32-filesystem 和 mingw32-pkg-config 失败" - else - LOG_INFO "保持 mingw32-filesystem 和 mingw32-pkg-config 的安装状态" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-pkg-config__exists.sh b/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-pkg-config__exists.sh deleted file mode 100644 index c59d9099f5f..00000000000 --- a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-pkg-config__exists.sh +++ /dev/null @@ -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-02-28 -# @License : Mulan PSL v2 -# @Desc : 测试 mingw32-pkg-config 的 --exists 参数,检查指定软件包是否存在 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 mingw32-pkg-config 的 --exists 参数功能" - LOG_INFO "步骤1:检查系统中是否已安装 mingw32-filesystem 和 mingw32-pkg-config 软件包" - - # 检查 mingw32-filesystem 是否已安装 - rpm -q mingw32-filesystem > /dev/null 2>&1 - filesystem_installed=$? - - # 检查 mingw32-pkg-config 是否已安装 - rpm -q mingw32-pkg-config > /dev/null 2>&1 - pkgconfig_installed=$? - - # 如果两个软件包都已安装,则标记为已安装状态 - if [ $filesystem_installed -eq 0 ] && [ $pkgconfig_installed -eq 0 ]; then - already_installed=1 - LOG_INFO "检测到 mingw32-filesystem 和 mingw32-pkg-config 已安装,测试结束后将保持安装状态" - else - already_installed=0 - LOG_INFO "检测到 mingw32-filesystem 或 mingw32-pkg-config 未安装,将在测试前安装,并在测试后卸载" - fi - - LOG_INFO "步骤2:检查 yum 源中是否存在 mingw32-filesystem 和 mingw32-pkg-config 软件包" - dnf list available mingw32-filesystem mingw32-pkg-config > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "yum 源中未找到 mingw32-filesystem 或 mingw32-pkg-config 软件包" - if [ $? -ne 0 ]; then - LOG_ERROR "yum 源中缺少必要的软件包,退出测试" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ $already_installed -eq 0 ]; then - LOG_INFO "步骤3:安装 mingw32-filesystem 和 mingw32-pkg-config 软件包" - dnf install -y mingw32-filesystem mingw32-pkg-config - CHECK_RESULT $? 0 0 "安装 mingw32-filesystem 或 mingw32-pkg-config 失败" - fi - - LOG_INFO "步骤4:验证 mingw32-pkg-config 命令是否支持 --exists 参数" - mingw32-pkg-config --help | grep -q "\-\-exists" - CHECK_RESULT $? 0 0 "mingw32-pkg-config 命令不支持 --exists 参数" - if [ $? -ne 0 ]; then - LOG_ERROR "mingw32-pkg-config 命令不支持 --exists 参数,退出测试" - exit 255 - fi - - LOG_INFO "步骤5:使用 --exists 参数检查一个存在的软件包(例如 glib-2.0)" - mingw32-pkg-config --exists glib-2.0 - CHECK_RESULT $? 0 0 "使用 --exists 参数检查 glib-2.0 失败" - - LOG_INFO "步骤6:使用 --exists 参数检查一个不存在的软件包" - mingw32-pkg-config --exists nonexistent-package-12345 > /dev/null 2>&1 - CHECK_RESULT $? 1 0 "使用 --exists 参数检查不存在的软件包时未返回预期失败" - - LOG_INFO "步骤7:清理测试环境,恢复原始状态" - if [ $already_installed -eq 0 ]; then - LOG_INFO "卸载测试安装的 mingw32-filesystem 和 mingw32-pkg-config 软件包" - dnf remove -y mingw32-filesystem mingw32-pkg-config - CHECK_RESULT $? 0 0 "卸载 mingw32-filesystem 或 mingw32-pkg-config 失败" - else - LOG_INFO "测试前软件包已安装,保持安装状态,无需卸载" - fi - - LOG_INFO "测试完成" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-pkg-config__h.sh b/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-pkg-config__h.sh deleted file mode 100644 index b53efc66dcc..00000000000 --- a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-pkg-config__h.sh +++ /dev/null @@ -1,87 +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-28 -# @License : Mulan PSL v2 -# @Desc : 测试 mingw32-pkg-config 的 -h 参数,显示帮助信息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - set -e - - LOG_INFO "开始测试:验证mingw32-pkg-config的-h参数显示帮助信息" - - # 检查环境是否已安装mingw32-pkg-config - LOG_INFO "步骤1:检查mingw32-pkg-config是否已安装" - if rpm -q mingw32-pkg-config &>/dev/null; then - LOG_INFO "mingw32-pkg-config已安装,测试后将保持安装状态" - already_installed=true - else - LOG_INFO "mingw32-pkg-config未安装,将在测试中安装并最终卸载" - already_installed=false - fi - - # 检查yum源中是否有mingw32-pkg-config - LOG_INFO "步骤2:检查yum源中是否有mingw32-pkg-config包" - if ! dnf list available mingw32-pkg-config &>/dev/null; then - LOG_ERROR "yum源中未找到mingw32-pkg-config包" - exit 255 - fi - - # 如果未安装,则安装软件包 - if [ "$already_installed" = false ]; then - LOG_INFO "步骤3:安装mingw32-pkg-config" - dnf install -y mingw32-pkg-config - CHECK_RESULT $? 0 0 "安装mingw32-pkg-config失败" - fi - - # 测试-h参数 - LOG_INFO "步骤4:执行mingw32-pkg-config -h命令" - output=$(mingw32-pkg-config -h 2>&1) - exit_code=$? - - # 检查-h参数是否被支持 - if [ $exit_code -eq 255 ]; then - LOG_ERROR "mingw32-pkg-config不支持-h参数" - exit 255 - fi - - # 检查命令是否成功执行 - CHECK_RESULT $exit_code 0 0 "mingw32-pkg-config -h命令执行失败" - - # 检查输出是否包含帮助信息 - LOG_INFO "步骤5:验证输出是否包含帮助信息" - if echo "$output" | grep -q "Usage:\|用法:" || echo "$output" | grep -q "help\|帮助"; then - LOG_INFO "帮助信息显示正确" - else - LOG_ERROR "帮助信息显示不正确" - exit 1 - fi - - # 环境恢复 - LOG_INFO "步骤6:恢复测试环境" - if [ "$already_installed" = false ]; then - LOG_INFO "卸载mingw32-pkg-config" - dnf remove -y mingw32-pkg-config - CHECK_RESULT $? 0 0 "卸载mingw32-pkg-config失败" - else - LOG_INFO "保持mingw32-pkg-config安装状态" - fi - - LOG_INFO "测试完成:mingw32-pkg-config的-h参数测试通过" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-pkg-config__libs.sh b/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-pkg-config__libs.sh deleted file mode 100644 index 12d68140a12..00000000000 --- a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-pkg-config__libs.sh +++ /dev/null @@ -1,82 +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-28 -# @License : Mulan PSL v2 -# @Desc : 测试 mingw32-pkg-config 的 --libs 参数,输出指定软件包的链接库标志 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - LOG_INFO "开始测试 mingw32-pkg-config 的 --libs 参数,输出指定软件包的链接库标志" - - LOG_INFO "步骤1: 检查环境中是否已安装 mingw32-filesystem 和 mingw32-pkg-config" - dnf list installed mingw32-filesystem mingw32-pkg-config > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "检测到软件包已安装,标记为已安装状态" - INSTALLED="true" - else - LOG_INFO "未检测到软件包安装,标记为未安装状态" - INSTALLED="false" - fi - - LOG_INFO "步骤2: 检查yum源中是否存在 mingw32-filesystem 和 mingw32-pkg-config" - dnf list available mingw32-filesystem mingw32-pkg-config > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到 mingw32-filesystem 或 mingw32-pkg-config 软件包" - exit 255 - fi - - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "步骤3: 安装 mingw32-filesystem 和 mingw32-pkg-config 软件包" - dnf install -y mingw32-filesystem mingw32-pkg-config - CHECK_RESULT $? 0 0 "安装 mingw32-filesystem 和 mingw32-pkg-config 失败" - fi - - LOG_INFO "步骤4: 检查 mingw32-pkg-config 是否支持 --libs 参数" - mingw32-pkg-config --help | grep -q "\-\-libs" - if [ $? -ne 0 ]; then - LOG_ERROR "mingw32-pkg-config 不支持 --libs 参数" - exit 255 - fi - - LOG_INFO "步骤5: 使用 mingw32-pkg-config --libs 获取一个已知软件包的链接库标志" - # 假设测试一个常见的 mingw32 软件包,例如 mingw32-zlib - mingw32-pkg-config --list-all | grep -q "mingw32-zlib" - if [ $? -eq 0 ]; then - LOG_INFO "找到 mingw32-zlib 软件包,测试 --libs 参数" - mingw32-pkg-config --libs mingw32-zlib - CHECK_RESULT $? 0 0 "执行 mingw32-pkg-config --libs mingw32-zlib 失败" - else - LOG_INFO "未找到 mingw32-zlib,测试一个虚拟包以验证参数功能" - # 测试参数本身,预期会返回错误,但命令应能执行 - mingw32-pkg-config --libs nonexistentpackage 2>/dev/null - # 此处不检查结果,因为包不存在是预期行为之一,主要验证命令能解析--libs参数 - LOG_INFO "--libs 参数测试完成" - fi - - LOG_INFO "步骤6: 环境清理,恢复原始状态" - if [ "$INSTALLED" = "false" ]; then - LOG_INFO "卸载测试安装的软件包 mingw32-filesystem 和 mingw32-pkg-config" - dnf remove -y mingw32-filesystem mingw32-pkg-config - CHECK_RESULT $? 0 0 "卸载 mingw32-filesystem 和 mingw32-pkg-config 失败" - else - LOG_INFO "环境已安装,保持安装状态" - fi - - LOG_INFO "测试脚本执行完毕" -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-pkg-config__v.sh b/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-pkg-config__v.sh deleted file mode 100644 index cbb9bd7423d..00000000000 --- a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-pkg-config__v.sh +++ /dev/null @@ -1,62 +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-11 -# @License : Mulan PSL v2 -# @Desc : 测试 mingw32-pkg-config 的 -v 参数,用于显示版本信息 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - # 检查是否已安装 mingw32-pkg-config - LOG_INFO "检查是否已安装 mingw32-pkg-config" - rpm -q mingw32-pkg-config > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "mingw32-pkg-config 已安装,脚本结束时保持安装状态" - installed=true - else - LOG_INFO "mingw32-pkg-config 未安装,将在测试完成后卸载" - installed=false - fi - - # 检查 yum 源中是否有 mingw32-pkg-config - LOG_INFO "检查 yum 源中是否有 mingw32-pkg-config" - dnf list available mingw32-pkg-config > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum 源中未找到 mingw32-pkg-config,退出" - exit 255 - fi - - # 安装 mingw32-pkg-config(如果未安装) - if ! $installed; then - LOG_INFO "正在安装 mingw32-pkg-config" - dnf install -y mingw32-pkg-config > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装 mingw32-pkg-config 失败" - fi - - # 测试 -v 参数 - LOG_INFO "测试 mingw32-pkg-config -v 参数" - mingw32-pkg-config -v > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "-v 参数测试失败" - - # 清理环境(如果之前未安装) - if ! $installed; then - LOG_INFO "卸载 mingw32-pkg-config" - dnf remove -y mingw32-pkg-config > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载 mingw32-pkg-config失败" - fi -} - -main "$@" \ No newline at end of file diff --git a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-pkg-config_v.sh b/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-pkg-config_v.sh deleted file mode 100644 index 9d50d6505f0..00000000000 --- a/testcases/function_test/pkg_test/mingw-filesystem/mingw32-filesystem/test_mingw32-filesystem_mingw32-pkg-config_v.sh +++ /dev/null @@ -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-11-30 -# @License : Mulan PSL v2 -# @Desc : 测试 mingw32-pkg-config 的 -v 参数 -# ############################################ - -source "$OET_PATH/libs/locallibs/common_lib.sh" - -function run_test() { - - # 检查是否已安装mingw32-pkg-config - LOG_INFO "检查是否已安装mingw32-pkg-config" - rpm -q mingw32-pkg-config > /dev/null 2>&1 - if [ $? -eq 0 ]; then - LOG_INFO "mingw32-pkg-config已安装,脚本结束时将保持安装状态" - INSTALLED=true - else - LOG_INFO "mingw32-pkg-config未安装,将在测试完成后卸载" - INSTALLED=false - fi - - # 检查yum源中是否有mingw32-pkg-config软件包 - LOG_INFO "检查yum源中是否有mingw32-pkg-config软件包" - dnf list available mingw32-pkg-config > /dev/null 2>&1 - if [ $? -ne 0 ]; then - LOG_ERROR "yum源中未找到mingw32-pkg-config软件包" - exit 255 - fi - - # 若未安装则安装软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "开始安装mingw32-pkg-config" - dnf install -y mingw32-pkg-config > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "安装mingw32-pkg-config失败" - fi - - # 测试-v参数 - LOG_INFO "测试mingw32-pkg-config的-v参数" - mingw32-pkg-config -v > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "-v参数不支持或执行失败" - - # 清理环境:若脚本开始时未安装则卸载软件包 - if [ "$INSTALLED" = false ]; then - LOG_INFO "卸载mingw32-pkg-config" - dnf remove -y mingw32-pkg-config > /dev/null 2>&1 - CHECK_RESULT $? 0 0 "卸载mingw32-pkg-config失败" - fi - - LOG_INFO "测试脚本执行完毕,环境已恢复" - -} - -main "$@" \ No newline at end of file