[Server] Smoke-test the dev server end to end

Spawns servatrice-dev on an ephemeral port and drives a real RemoteClient through login, room list, room join and game creation, asserting each response and the Event_GameJoined payload. The test is WITH_SERVER-gated, links only the client remote library, and keeps the dev server's throwaway settings inside a temporary directory.
This commit is contained in:
Lukas Brübach 2026-11-10 09:28:47 +01:00
parent 95b3294c46
commit 16e6e8e3ae
2 changed files with 308 additions and 0 deletions

View file

@ -394,6 +394,25 @@ cockatrice_add_test(
LABELS
server
)
if(WITH_SERVER)
# The only test that starts a separately scheduled server process. servatrice-dev is built by the
# servatrice subdirectory, which exists only when WITH_SERVER is on; the binary path is baked in
# because CTest runs the test from its own working directory.
cockatrice_add_test(
NAME
server_dev_smoke_test
SOURCES
${VERSION_STRING_CPP}
server_dev_smoke_test.cpp
LIBS
libcockatrice_network_client_remote
LABELS
server
DEFINITIONS
"SERVATRICE_DEV_BINARY=\"$<TARGET_FILE:servatrice-dev>\""
)
add_dependencies(server_dev_smoke_test servatrice-dev)
endif()
cockatrice_add_test(
NAME
client_login_status_test