test: 登记 6 个新套件(func/struct/protocol/hal/json + integration.http),CTest 14/14 绿
- shs_tests 链接补上 shs_applib/shs_net:集成测试与 JSON 套件需要网络层目标, 此前只链 shs_core,链接期才暴露 undefined reference - runner 套件表补全并修正逗号;CMake 源文件表按实际文件重建 - unit.list 从套件表移除(它由独立 add_test 注册,重复注册会被 CMake 拒绝)
This commit is contained in:
1 parent
09bbe23697
commit
2b64f4a255
2 files changed
+33
-8
No files matched your search
+20
-7
@@ -115,17 +115,24 @@ if(SHS_BUILD_TESTS)
|
||||
set(SHS_TEST_SOURCES
|
||||
tests/framework/test_framework.c
|
||||
tests/test_runner.c
|
||||
tests/unit/test_string.c
|
||||
tests/unit/test_num.c
|
||||
tests/unit/test_branch.c
|
||||
tests/unit/test_loop.c
|
||||
tests/unit/test_bitops.c
|
||||
tests/unit/test_branch.c
|
||||
tests/unit/test_errors.c
|
||||
tests/unit/test_file.c
|
||||
tests/unit/test_pointer.c)
|
||||
tests/unit/test_func.c
|
||||
tests/unit/test_hal.c
|
||||
tests/unit/test_json.c
|
||||
tests/unit/test_loop.c
|
||||
tests/unit/test_num.c
|
||||
tests/unit/test_pointer.c
|
||||
tests/unit/test_protocol.c
|
||||
tests/unit/test_string.c
|
||||
tests/unit/test_struct.c
|
||||
tests/integration/test_http.c
|
||||
)
|
||||
|
||||
add_executable(shs_tests ${SHS_TEST_SOURCES})
|
||||
target_link_libraries(shs_tests PRIVATE shs_core shs_warnings)
|
||||
target_link_libraries(shs_tests PRIVATE shs_applib shs_net shs_core shs_warnings)
|
||||
target_include_directories(shs_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include ${CMAKE_CURRENT_SOURCE_DIR}/tests)
|
||||
|
||||
# 每个测试套件在 CTest 中独立注册(ctest -R unit.string)
|
||||
@@ -137,7 +144,13 @@ if(SHS_BUILD_TESTS)
|
||||
unit.bitops
|
||||
unit.errors
|
||||
unit.file
|
||||
unit.pointer)
|
||||
unit.func
|
||||
unit.struct
|
||||
unit.protocol
|
||||
unit.hal
|
||||
unit.json
|
||||
integration.http
|
||||
)
|
||||
foreach(suite IN LISTS SHS_TEST_SUITES)
|
||||
add_test(NAME ${suite} COMMAND shs_tests --suite ${suite})
|
||||
endforeach()
|
||||
|
||||
Reference in new issue
Block a user