mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-13 05:20:00 -08:00
The mode table and the 'which mode produced this filter set' derivation are filter semantics, not widget code, so they belong next to CardFilter rather than in an anonymous namespace in the client. Moving them also makes them testable: filter_mode_test pins every mode, the Custom fallback and the 'keep the live mode when it still fits' rule.
99 lines
2 KiB
CMake
99 lines
2 KiB
CMake
cmake_minimum_required(VERSION 3.16)
|
|
project(CardDatabaseTests VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}")
|
|
|
|
# ------------------------
|
|
# Definitions
|
|
# ------------------------
|
|
add_definitions("-DCARDDB_DATADIR=\"${CMAKE_CURRENT_SOURCE_DIR}/data/\"")
|
|
|
|
# ------------------------
|
|
# Card Database Test
|
|
# ------------------------
|
|
cockatrice_add_test(
|
|
NAME
|
|
carddatabase_test
|
|
SOURCES
|
|
${VERSION_STRING_CPP}
|
|
carddatabase_test.cpp
|
|
mocks.cpp
|
|
LIBS
|
|
libcockatrice_card
|
|
)
|
|
|
|
# ------------------------
|
|
# Guard to match condition for libcockatrice_filters in the root CMakeLists.txt
|
|
# ------------------------
|
|
if(WITH_ORACLE OR WITH_CLIENT)
|
|
# ------------------------
|
|
# Filter String Test
|
|
# ------------------------
|
|
cockatrice_add_test(
|
|
NAME
|
|
filter_string_test
|
|
SOURCES
|
|
${VERSION_STRING_CPP}
|
|
filter_string_test.cpp
|
|
mocks.cpp
|
|
LIBS
|
|
libcockatrice_filters
|
|
)
|
|
|
|
# ------------------------
|
|
# Filter Tree Test
|
|
# ------------------------
|
|
cockatrice_add_test(
|
|
NAME
|
|
filter_tree_test
|
|
SOURCES
|
|
${VERSION_STRING_CPP}
|
|
filter_tree_test.cpp
|
|
mocks.cpp
|
|
LIBS
|
|
libcockatrice_filters
|
|
)
|
|
|
|
# ------------------------
|
|
# Filter Mode Test
|
|
# ------------------------
|
|
cockatrice_add_test(
|
|
NAME
|
|
filter_mode_test
|
|
SOURCES
|
|
${VERSION_STRING_CPP}
|
|
filter_mode_test.cpp
|
|
mocks.cpp
|
|
LIBS
|
|
libcockatrice_filters
|
|
)
|
|
|
|
# ------------------------
|
|
# Visual Display Model Test
|
|
# ------------------------
|
|
cockatrice_add_test(
|
|
NAME
|
|
visual_display_model_test
|
|
SOURCES
|
|
${VERSION_STRING_CPP}
|
|
visual_display_model_test.cpp
|
|
mocks.cpp
|
|
LIBS
|
|
libcockatrice_card
|
|
libcockatrice_models
|
|
)
|
|
endif()
|
|
|
|
# ------------------------
|
|
# Load Benchmark (manual, not run in CI)
|
|
# ------------------------
|
|
cockatrice_add_manual_test(
|
|
NAME
|
|
load_benchmark
|
|
SOURCES
|
|
${VERSION_STRING_CPP}
|
|
load_benchmark.cpp
|
|
mocks.cpp
|
|
LIBS
|
|
libcockatrice_card
|
|
libcockatrice_models
|
|
MANUAL
|
|
)
|