- W18.1 (王测+林深): Remove g_max_tokens dead API, UTF-8 bounds protection, deduplicate token counting, 0xC0/0xC1 handling, add 13 test blocks (36 checks) - W18.2 (赵码+朱晴): Fix /context no-session error message, /status 3-state connection display - W18.3 (曹武+徐磊): plugin_loader security audit — 9 dimensions, rating C, 1 HIGH + 2 MEDIUM findings - W18.4 (马奔+胡桐): CI dual-platform matrix (Ubuntu clang-18 + Windows clang-cl), ccache, build timing baseline Build 0 error, ctest 5/5 pass, metadata check clean. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
90 lines
2.5 KiB
CMake
90 lines
2.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)
|