From eb44afe2be68a2f8d17c5395d371a7e61dd6f7a4 Mon Sep 17 00:00:00 2001 From: csh Date: Sun, 21 Dec 2025 15:57:38 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=AA=20test:=20ignore=20IDS=5FAuditExpr?= =?UTF-8?q?=20in=20ast/symbol=20scripts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lsp-server/test/test_ast/test.sh | 18 ++++++++++++++++++ lsp-server/test/test_symbol/test.sh | 18 ++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/lsp-server/test/test_ast/test.sh b/lsp-server/test/test_ast/test.sh index 83b6543..76690db 100644 --- a/lsp-server/test/test_ast/test.sh +++ b/lsp-server/test/test_ast/test.sh @@ -14,6 +14,7 @@ REPO_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)" # 指定 build 预设(默认 codex,可通过 BUILD_PRESET 或 --preset 覆盖) BUILD_PRESET=${BUILD_PRESET:-codex} +IGNORES=("IDS_AuditExpr.tsf") find_test_ast() { local search_dir="$1" @@ -48,6 +49,18 @@ print_usage() { exit 0 } +should_ignore() { + local file="$1" + local base + base="$(basename "$file")" + for ignore in "${IGNORES[@]}"; do + if [[ "$base" == "$ignore" ]]; then + return 0 + fi + done + return 1 +} + # 解析命令行参数 while [[ $# -gt 0 ]]; do case $1 in @@ -99,6 +112,7 @@ echo -e "${BLUE}========================================${NC}" echo -e "${CYAN}测试工具: $TEST_AST${NC}" echo -e "${CYAN}Build 预设: $BUILD_PRESET${NC}" echo -e "${CYAN}跟随软链接: 是${NC}" +echo -e "${CYAN}忽略文件: ${IGNORES[*]}${NC}" if [ $VERBOSE -eq 1 ]; then echo -e "${CYAN}详细模式: 开启${NC}" fi @@ -131,6 +145,10 @@ for dir in "${DIRECTORIES[@]}"; do # 递归查找所有.tsf文件(-L 选项跟随符号链接) while IFS= read -r -d '' file; do + if should_ignore "$file"; then + echo -e "${YELLOW}跳过忽略文件: $file${NC}" + continue + fi ((total_files++)) # 显示文件路径(包括软链接信息) diff --git a/lsp-server/test/test_symbol/test.sh b/lsp-server/test/test_symbol/test.sh index eebf73f..0df53fa 100644 --- a/lsp-server/test/test_symbol/test.sh +++ b/lsp-server/test/test_symbol/test.sh @@ -24,6 +24,7 @@ find_test_symbol() { BUILD_PRESET=${BUILD_PRESET:-codex} TEST_SYMBOL="${TEST_SYMBOL_OVERRIDE:-$(find "$REPO_ROOT/build/$BUILD_PRESET" -type f -name test_symbol -path "*/test/test_symbol/*" -print -quit 2>/dev/null)}" +IGNORES=("IDS_AuditExpr.tsf") # 需要测试的目录列表(可以自行添加) DIRECTORIES=( @@ -48,6 +49,18 @@ print_usage() { exit 0 } +should_ignore() { + local file="$1" + local base + base="$(basename "$file")" + for ignore in "${IGNORES[@]}"; do + if [[ "$base" == "$ignore" ]]; then + return 0 + fi + done + return 1 +} + # 解析命令行参数 while [[ $# -gt 0 ]]; do case $1 in @@ -99,6 +112,7 @@ echo -e "${BLUE}========================================${NC}" echo -e "${CYAN}测试工具: $TEST_SYMBOL${NC}" echo -e "${CYAN}Build 预设: $BUILD_PRESET${NC}" echo -e "${CYAN}跟随软链接: 是${NC}" +echo -e "${CYAN}忽略文件: ${IGNORES[*]}${NC}" if [ $VERBOSE -eq 1 ]; then echo -e "${CYAN}详细模式: 开启${NC}" fi @@ -131,6 +145,10 @@ for dir in "${DIRECTORIES[@]}"; do # 递归查找所有.tsf文件(-L 选项跟随符号链接) while IFS= read -r -d '' file; do + if should_ignore "$file"; then + echo -e "${YELLOW}跳过忽略文件: $file${NC}" + continue + fi ((total_files++)) # 显示文件路径(包括软链接信息)