The scriptable client, built now rather than last: it is how the daemon gets exercised before the GUI is pointed at it (AGENT-DAEMON.md). - src/client — synchronous blocking RPC over the Unix socket: resolve $XDG_RUNTIME_DIR/velox/velox.sock, connect, session.hello, one framed request/reply per call. Distinguishes transport failure (exit 3) from a daemon-returned error (exit 1). - src/main — subcommands add/ls/pause/resume/rm; --json prints the raw JSON-RPC result or error; --dir/--out/--segments on add; --delete-file on rm. Usage errors exit 2. ls works end to end against veloxd today (empty table). add and the bulk verbs reach the daemon and surface its "not implemented" (-32603) cleanly until the store lands — the plumbing is done, the commands light up as handlers do. Test velox.client: the real Client against an in-process UdsServer — no-daemon path, session.hello, download.list, and a not-implemented method surfacing as an RPC error rather than a transport error. ASan+UBSan clean; full tree (21 tests, incl. conformance) green. Co-Authored-By: Claude Sonnet 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Upd9WhG9oppieig5nRDLig
14 lines
738 B
CMake
14 lines
738 B
CMake
# CLI integration test: a real in-process UdsServer on a temp socket, the real Client
|
|
# against it. Links veloxd_rpc for the server half.
|
|
|
|
add_executable(velox_client_test client_test.cpp ${CMAKE_CURRENT_SOURCE_DIR}/../src/client.cpp)
|
|
target_include_directories(velox_client_test PRIVATE
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../src
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../../daemon/tests
|
|
)
|
|
target_compile_features(velox_client_test PRIVATE cxx_std_23)
|
|
target_compile_options(velox_client_test PRIVATE -Wall -Wextra -Wpedantic -Werror)
|
|
target_link_libraries(velox_client_test PRIVATE veloxd_rpc velox::proto nlohmann_json::nlohmann_json)
|
|
add_test(NAME velox.client COMMAND velox_client_test)
|
|
set_tests_properties(velox.client PROPERTIES TIMEOUT 30)
|