🧪 test: ignore IDS_AuditExpr in ast/symbol scripts

This commit is contained in:
csh 2025-12-21 15:57:38 +08:00
parent fbf6c85baa
commit eb44afe2be
2 changed files with 36 additions and 0 deletions

View File

@ -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++))
# 显示文件路径(包括软链接信息)

View File

@ -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++))
# 显示文件路径(包括软链接信息)