🧪 test: wire ast/symbol scripts into ctest

This commit is contained in:
csh 2025-12-21 15:47:27 +08:00
parent bb0cbde79c
commit f2d2aeb272
4 changed files with 18 additions and 2 deletions

View File

@ -64,3 +64,11 @@ target_compile_options(
-Wall -Wextra -Wpedantic $<$<CONFIG:Debug>:-g -O0> -Wall -Wextra -Wpedantic $<$<CONFIG:Debug>:-g -O0>
-Wno-import-implementation-partition-unit-in-interface-unit -Wno-import-implementation-partition-unit-in-interface-unit
$<$<CONFIG:Release>:-O3>) $<$<CONFIG:Release>:-O3>)
if(BUILD_TESTS)
add_test(NAME test_ast_script
COMMAND ${CMAKE_COMMAND} -E env
TEST_AST_OVERRIDE=$<TARGET_FILE:test_ast>
BUILD_PRESET=ctest
bash ${CMAKE_CURRENT_SOURCE_DIR}/test.sh)
endif()

View File

@ -27,7 +27,7 @@ TEST_AST="${TEST_AST_OVERRIDE:-$(find_test_ast "$REPO_ROOT/build/$BUILD_PRESET")
# 需要测试的目录列表(可以自行添加) # 需要测试的目录列表(可以自行添加)
DIRECTORIES=( DIRECTORIES=(
"/mnt/c/Programs/Tinysoft/TSLGen2/funcext" "$REPO_ROOT/test/test_tree_sitter/test"
# "./another_directory" # "./another_directory"
) )

View File

@ -103,3 +103,11 @@ target_compile_options(
-Wall -Wextra -Wpedantic $<$<CONFIG:Debug>:-g -O0> -Wall -Wextra -Wpedantic $<$<CONFIG:Debug>:-g -O0>
-Wno-import-implementation-partition-unit-in-interface-unit -Wno-import-implementation-partition-unit-in-interface-unit
$<$<CONFIG:Release>:-O3>) $<$<CONFIG:Release>:-O3>)
if(BUILD_TESTS)
add_test(NAME test_symbol_script
COMMAND ${CMAKE_COMMAND} -E env
TEST_SYMBOL_OVERRIDE=$<TARGET_FILE:test_symbol>
BUILD_PRESET=ctest
bash ${CMAKE_CURRENT_SOURCE_DIR}/test.sh)
endif()

View File

@ -27,7 +27,7 @@ TEST_SYMBOL="${TEST_SYMBOL_OVERRIDE:-$(find "$REPO_ROOT/build/$BUILD_PRESET" -ty
# 需要测试的目录列表(可以自行添加) # 需要测试的目录列表(可以自行添加)
DIRECTORIES=( DIRECTORIES=(
"/mnt/c/Programs/Tinysoft/TSLGen2/funcext" "$REPO_ROOT/test/test_tree_sitter/test"
# "./another_directory" # "./another_directory"
) )