mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-11 20:43:25 -08:00
[Tests] Add a shared in-memory server test fixture
Add tests/support/server_test_fixture as a built-but-unshipped static target: an InMemoryServer_DatabaseInterface with configurable auth, a user table, session bookkeeping, ban state, id counters, and chat-log capture, plus FakeServer and ServerTestFixture. Migrate server_game_join_test to it, removing the first private copy of the mock.
This commit is contained in:
parent
3b379618c3
commit
2187e47a60
4 changed files with 266 additions and 44 deletions
|
|
@ -171,6 +171,11 @@ endfunction()
|
|||
|
||||
# --- Unit tests ------------------------------------------------------------------
|
||||
|
||||
# Test-only server double and fixture, shared by the server tests. Built, never installed.
|
||||
add_library(testsupport_server STATIC support/server_test_fixture.cpp)
|
||||
target_link_libraries(testsupport_server PUBLIC libcockatrice_network_server_remote)
|
||||
target_include_directories(testsupport_server PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
cockatrice_add_test(NAME image_request_queue_test SOURCES image_request_queue_test.cpp)
|
||||
cockatrice_add_test(NAME image_redirect_chain_test SOURCES image_redirect_chain_test.cpp)
|
||||
cockatrice_add_test(NAME expression_test SOURCES expression_test.cpp LIBS libcockatrice_utility)
|
||||
|
|
@ -377,6 +382,9 @@ cockatrice_add_test(
|
|||
LIBS
|
||||
libcockatrice_network_server_remote
|
||||
libcockatrice_rng
|
||||
testsupport_server
|
||||
INCLUDE_DIRS
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
LABELS
|
||||
server
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue