The read/write surface the dispatcher handlers need, so download.add persists and download.list / download.get project real rows when the engine lands. - store/tasks — TaskRow (1:1 with the schema), insert / get / remove / set_state / count, and list(filter, sort, offset, limit) that does all the WHERE / ORDER BY / LIMIT in SQL (M1 DoD: a 1000-row list never materialised client-side). Filter covers states / category / queue / case-insensitive filename+url substring / date range; sort is a whitelisted column + direction with NULLs last, default newest-first; the enum spellings in a state IN (...) come from proto::to_string, never from user text. to_summary() projects a row onto proto::TaskSummary including the flattened error block when the task failed / retry_wait / auto-paused. - store/settings — key -> JSON-text with a built-in default table mirroring Settings.schema.json / ADR 0012; get_raw / set_raw / overrides plus typed get_int / get_string / get_string_array for the governor config and saveTo.allowedRoots. Full settings.get/set wire projection lands with those handlers. - veloxd_store now links velox::proto + nlohmann_json for the projection. Test veloxd.store_tasks: insert/get round trip, PK duplicate rejected, the error-block projection, list total+paging+sort+every filter, set_state pause_reason clear-on-unpause, remove, and settings default vs override. ASan+UBSan and TSan clean; 34 daemon/cli tests green. Co-Authored-By: Claude Sonnet 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Upd9WhG9oppieig5nRDLig
23 lines
1.1 KiB
CMake
23 lines
1.1 KiB
CMake
# daemon unit + integration tests. Registered with ctest; run via `ctest --preset dev`.
|
|
# No external test framework — each file is a small self-checking binary.
|
|
|
|
function(veloxd_test name)
|
|
cmake_parse_arguments(T "" "" "LIBS" ${ARGN})
|
|
add_executable(veloxd_${name}_test ${name}_test.cpp)
|
|
target_link_libraries(veloxd_${name}_test PRIVATE ${T_LIBS})
|
|
target_compile_options(veloxd_${name}_test PRIVATE -Wall -Wextra -Wpedantic -Werror)
|
|
add_test(NAME veloxd.${name} COMMAND veloxd_${name}_test)
|
|
set_tests_properties(veloxd.${name} PROPERTIES TIMEOUT 30)
|
|
endfunction()
|
|
|
|
veloxd_test(ndjson LIBS veloxd_rpc)
|
|
veloxd_test(uds_roundtrip LIBS veloxd_rpc)
|
|
veloxd_test(store_migrations LIBS veloxd_store)
|
|
veloxd_test(pairings LIBS veloxd_store veloxd_rpc)
|
|
veloxd_test(ws_frame LIBS veloxd_rpc)
|
|
veloxd_test(ws_server LIBS veloxd_rpc)
|
|
veloxd_test(sched_window LIBS veloxd_sched)
|
|
veloxd_test(sched_governor LIBS veloxd_sched)
|
|
veloxd_test(safepath LIBS veloxd_fs)
|
|
veloxd_test(store_tasks LIBS veloxd_store)
|