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" )