- W21.1: ci-sanitize preset 独立 Linux-clang + ci-threadsan (TSan) - W21.2: anthropic tool_use content_block 解析 + configure 缓存 tools_json - W21.3: --prompt 非交互批处理模式 - W21.4: session auto-save 失败告警 + 当前目录 fallback - W21.5: smoke 补 tool_calls 边界用例 4 块 12 断言 - W21.6: anthropic 11 块 78 CHECK + deepseek 12 块 78 CHECK Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
180 lines
4.9 KiB
CMake
180 lines
4.9 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)
|
|
|
|
# ============================================================
|
|
# dstalk-anthropic-plugin-test — Anthropic AI 插件单元测试
|
|
# W21.6 (qa-wang): 通过 #include source 访问 static 函数
|
|
# ============================================================
|
|
|
|
add_executable(dstalk-anthropic-plugin-test
|
|
anthropic_plugin_test.cpp
|
|
)
|
|
|
|
target_include_directories(dstalk-anthropic-plugin-test
|
|
PRIVATE ${CMAKE_SOURCE_DIR}/dstalk-core/include
|
|
)
|
|
|
|
target_compile_definitions(dstalk-anthropic-plugin-test
|
|
PRIVATE
|
|
BOOST_JSON_HEADER_ONLY
|
|
BOOST_ALL_NO_LIB
|
|
)
|
|
|
|
target_link_libraries(dstalk-anthropic-plugin-test
|
|
PRIVATE
|
|
dstalk
|
|
boost::boost
|
|
)
|
|
|
|
add_test(NAME dstalk-anthropic-plugin-test COMMAND dstalk-anthropic-plugin-test)
|
|
|
|
# ============================================================
|
|
# dstalk-deepseek-plugin-test — DeepSeek AI 插件单元测试
|
|
# W21.6 (qa-wang): 通过 #include source 访问 static 函数
|
|
# ============================================================
|
|
|
|
add_executable(dstalk-deepseek-plugin-test
|
|
deepseek_plugin_test.cpp
|
|
)
|
|
|
|
target_include_directories(dstalk-deepseek-plugin-test
|
|
PRIVATE ${CMAKE_SOURCE_DIR}/dstalk-core/include
|
|
)
|
|
|
|
target_compile_definitions(dstalk-deepseek-plugin-test
|
|
PRIVATE
|
|
BOOST_JSON_HEADER_ONLY
|
|
BOOST_ALL_NO_LIB
|
|
)
|
|
|
|
target_link_libraries(dstalk-deepseek-plugin-test
|
|
PRIVATE
|
|
dstalk
|
|
boost::boost
|
|
)
|
|
|
|
add_test(NAME dstalk-deepseek-plugin-test COMMAND dstalk-deepseek-plugin-test)
|