From f2d2aeb272f923c03a5c81c4a5a25febd6b9738d Mon Sep 17 00:00:00 2001 From: csh Date: Sun, 21 Dec 2025 15:47:27 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=AA=20test:=20wire=20ast/symbol=20scri?= =?UTF-8?q?pts=20into=20ctest?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lsp-server/test/test_ast/CMakeLists.txt | 8 ++++++++ lsp-server/test/test_ast/test.sh | 2 +- lsp-server/test/test_symbol/CMakeLists.txt | 8 ++++++++ lsp-server/test/test_symbol/test.sh | 2 +- 4 files changed, 18 insertions(+), 2 deletions(-) diff --git a/lsp-server/test/test_ast/CMakeLists.txt b/lsp-server/test/test_ast/CMakeLists.txt index e85fed5..96a7cdf 100644 --- a/lsp-server/test/test_ast/CMakeLists.txt +++ b/lsp-server/test/test_ast/CMakeLists.txt @@ -64,3 +64,11 @@ target_compile_options( -Wall -Wextra -Wpedantic $<$:-g -O0> -Wno-import-implementation-partition-unit-in-interface-unit $<$:-O3>) + +if(BUILD_TESTS) + add_test(NAME test_ast_script + COMMAND ${CMAKE_COMMAND} -E env + TEST_AST_OVERRIDE=$ + BUILD_PRESET=ctest + bash ${CMAKE_CURRENT_SOURCE_DIR}/test.sh) +endif() diff --git a/lsp-server/test/test_ast/test.sh b/lsp-server/test/test_ast/test.sh index f4280c5..83b6543 100644 --- a/lsp-server/test/test_ast/test.sh +++ b/lsp-server/test/test_ast/test.sh @@ -27,7 +27,7 @@ TEST_AST="${TEST_AST_OVERRIDE:-$(find_test_ast "$REPO_ROOT/build/$BUILD_PRESET") # 需要测试的目录列表(可以自行添加) DIRECTORIES=( - "/mnt/c/Programs/Tinysoft/TSLGen2/funcext" + "$REPO_ROOT/test/test_tree_sitter/test" # "./another_directory" ) diff --git a/lsp-server/test/test_symbol/CMakeLists.txt b/lsp-server/test/test_symbol/CMakeLists.txt index 26b04b6..4953475 100644 --- a/lsp-server/test/test_symbol/CMakeLists.txt +++ b/lsp-server/test/test_symbol/CMakeLists.txt @@ -103,3 +103,11 @@ target_compile_options( -Wall -Wextra -Wpedantic $<$:-g -O0> -Wno-import-implementation-partition-unit-in-interface-unit $<$:-O3>) + +if(BUILD_TESTS) + add_test(NAME test_symbol_script + COMMAND ${CMAKE_COMMAND} -E env + TEST_SYMBOL_OVERRIDE=$ + BUILD_PRESET=ctest + bash ${CMAKE_CURRENT_SOURCE_DIR}/test.sh) +endif() diff --git a/lsp-server/test/test_symbol/test.sh b/lsp-server/test/test_symbol/test.sh index 872336b..eebf73f 100644 --- a/lsp-server/test/test_symbol/test.sh +++ b/lsp-server/test/test_symbol/test.sh @@ -27,7 +27,7 @@ TEST_SYMBOL="${TEST_SYMBOL_OVERRIDE:-$(find "$REPO_ROOT/build/$BUILD_PRESET" -ty # 需要测试的目录列表(可以自行添加) DIRECTORIES=( - "/mnt/c/Programs/Tinysoft/TSLGen2/funcext" + "$REPO_ROOT/test/test_tree_sitter/test" # "./another_directory" )