test(lsp_server): update test scripts and tsf cases

This commit is contained in:
csh
2026-01-08 15:51:54 +08:00
parent b2a1bb6685
commit f056b0cad1
3 changed files with 34 additions and 5 deletions
+5 -3
View File
@@ -21,14 +21,13 @@ find_test_ast() {
if [ ! -d "$search_dir" ]; then
return 1
fi
find "$search_dir" -type f -name test_ast -path "*/test/test_ast/*" -print -quit 2>/dev/null
find "$search_dir" -type f -name test_ast \( -path "*/test/test_ast" -o -path "*/test/test_ast/*" \) -print -quit 2>/dev/null
}
TEST_AST="${TEST_AST_OVERRIDE:-$(find_test_ast "$REPO_ROOT/build/$BUILD_PRESET")}"
# 需要测试的目录列表(可以自行添加)
DIRECTORIES=(
"$REPO_ROOT/test/test_tree_sitter/test"
"$HOME/windows_share/tsf"
# "./another_directory"
)
@@ -86,6 +85,9 @@ while [[ $# -gt 0 ]]; do
esac
done
# 解析参数后再定位 test_ast
TEST_AST="${TEST_AST_OVERRIDE:-$(find_test_ast "$REPO_ROOT/build/$BUILD_PRESET")}"
# 检查 test_ast 是否存在
if [ -z "$TEST_AST" ] || [ ! -f "$TEST_AST" ]; then
echo -e "${RED}错误: 找不到 test_ast 可执行文件${NC}"