- W20.1: CLI tool_calls→execute→result→re-call 循环(5轮上限) - W20.2: deepseek 流式 tool_calls 增量解析(configure 缓存,无 ABI break) - W20.3: plugin_loader 回归测试 5 块 32 断言(路径/原子性/mock 日志) - W20.4: plugin_loader ABI 契约校验(name/version/on_init 字段验证) - W20.5: ASan/UBSan CMake preset + CI sanitizer job(PR-only Linux) - W20.6: session auto-save(on_shutdown 写 %APPDATA%/dstalk/session.json) Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
126 lines
3.5 KiB
CMake
126 lines
3.5 KiB
CMake
# ============================================================
|
|
# tests — 单元测试
|
|
# ============================================================
|
|
|
|
add_executable(dstalk-smoke-test
|
|
smoke_test.cpp
|
|
)
|
|
|
|
target_link_libraries(dstalk-smoke-test
|
|
PRIVATE dstalk
|
|
)
|
|
|
|
add_test(NAME dstalk-smoke-test COMMAND dstalk-smoke-test)
|
|
|
|
# ============================================================
|
|
# dstalk-host-api-test — host API 单元测试
|
|
# ============================================================
|
|
|
|
add_executable(dstalk-host-api-test
|
|
host_api_test.cpp
|
|
${CMAKE_SOURCE_DIR}/dstalk-core/src/service_registry.cpp
|
|
)
|
|
|
|
target_include_directories(dstalk-host-api-test
|
|
PRIVATE ${CMAKE_SOURCE_DIR}/dstalk-core/src
|
|
)
|
|
|
|
target_compile_features(dstalk-host-api-test
|
|
PRIVATE cxx_std_17
|
|
)
|
|
|
|
target_link_libraries(dstalk-host-api-test
|
|
PRIVATE dstalk
|
|
)
|
|
|
|
add_test(NAME dstalk-host-api-test COMMAND dstalk-host-api-test)
|
|
|
|
# ============================================================
|
|
# dstalk-event-bus-test — EventBus 单元测试
|
|
# ============================================================
|
|
|
|
add_executable(dstalk-event-bus-test
|
|
event_bus_test.cpp
|
|
${CMAKE_SOURCE_DIR}/dstalk-core/src/event_bus.cpp
|
|
)
|
|
|
|
target_include_directories(dstalk-event-bus-test
|
|
PRIVATE ${CMAKE_SOURCE_DIR}/dstalk-core/src
|
|
)
|
|
|
|
target_compile_features(dstalk-event-bus-test
|
|
PRIVATE cxx_std_17
|
|
)
|
|
|
|
add_test(NAME dstalk-event-bus-test COMMAND dstalk-event-bus-test)
|
|
|
|
# ============================================================
|
|
# dstalk-service-registry-test — ServiceRegistry 补充单元测试
|
|
# ============================================================
|
|
|
|
add_executable(dstalk-service-registry-test
|
|
service_registry_test.cpp
|
|
${CMAKE_SOURCE_DIR}/dstalk-core/src/service_registry.cpp
|
|
)
|
|
|
|
target_include_directories(dstalk-service-registry-test
|
|
PRIVATE ${CMAKE_SOURCE_DIR}/dstalk-core/src
|
|
)
|
|
|
|
target_compile_features(dstalk-service-registry-test
|
|
PRIVATE cxx_std_17
|
|
)
|
|
|
|
add_test(NAME dstalk-service-registry-test COMMAND dstalk-service-registry-test)
|
|
|
|
# ============================================================
|
|
# dstalk-context-plugin-test — Context 插件单元测试
|
|
# W18.1 (qa-wang + architect-lin): 覆盖 token 计数/trim/UTF-8 边界
|
|
# ============================================================
|
|
|
|
add_executable(dstalk-context-plugin-test
|
|
context_plugin_test.cpp
|
|
)
|
|
|
|
target_link_libraries(dstalk-context-plugin-test
|
|
PRIVATE dstalk
|
|
)
|
|
|
|
add_test(NAME dstalk-context-plugin-test COMMAND dstalk-context-plugin-test)
|
|
|
|
# ============================================================
|
|
# dstalk-plugin-loader-test — PluginLoader 安全回归测试
|
|
# W20.3 (qa-xu): 覆盖 W19 F-18.3-1~5 修复验证
|
|
# ============================================================
|
|
|
|
add_executable(dstalk-plugin-loader-test
|
|
plugin_loader_test.cpp
|
|
${CMAKE_SOURCE_DIR}/dstalk-core/src/plugin_loader.cpp
|
|
${CMAKE_SOURCE_DIR}/dstalk-core/src/boost_json.cpp
|
|
)
|
|
|
|
target_include_directories(dstalk-plugin-loader-test
|
|
PRIVATE ${CMAKE_SOURCE_DIR}/dstalk-core/src
|
|
)
|
|
|
|
target_compile_features(dstalk-plugin-loader-test
|
|
PRIVATE cxx_std_17
|
|
)
|
|
|
|
find_package(Boost REQUIRED CONFIG)
|
|
|
|
target_compile_definitions(dstalk-plugin-loader-test
|
|
PRIVATE
|
|
BOOST_JSON_HEADER_ONLY
|
|
BOOST_ALL_NO_LIB
|
|
DSTALK_TEST_PLUGINS_DIR="${CMAKE_BINARY_DIR}/plugins"
|
|
)
|
|
|
|
target_link_libraries(dstalk-plugin-loader-test
|
|
PRIVATE
|
|
dstalk
|
|
boost::boost
|
|
)
|
|
|
|
add_test(NAME dstalk-plugin-loader-test COMMAND dstalk-plugin-loader-test)
|