Cockatrice/tests/picture_loader_benchmark/CMakeLists.txt
BruebachL 518c7e6125
[Network] Add a configured QNetworkAccessManager factory (#7628)
* [Network] Add a configured QNetworkAccessManager factory

Every HTTP caller built its own QNetworkAccessManager, so the system proxy
and a transfer timeout were easy to omit. Add NetworkManagerFactory::create()
as the single place that applies the process-wide proxy configuration and a
transfer timeout, and use it at all 14 construction sites.

Per-site settings such as disk caches and manual redirect policies stay with
their callers.

* [Tests] Link libcockatrice_network into the tests that compile its headers

release_channel.cpp and card_picture_loader_worker.cpp now include
libcockatrice/network/network_manager.h, but the test targets that compile
them only linked libcockatrice_settings, so the include directory never
reached them and every platform failed with "file not found":
loader_local_matching_test and picture_loader_benchmark_test.

libcockatrice_network is an INTERFACE library, so linking it costs these
targets nothing but hands over the include path.

---------

Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
2026-10-25 00:33:43 +02:00

25 lines
955 B
CMake

# Manual benchmark hitting the real card image hosts. Not registered with CTest: it requires a
# cards.xml, touches the network for minutes at a time, and needs network access. Build it
# explicitly and run by hand.
cockatrice_add_manual_test(
NAME
picture_loader_benchmark_test
SOURCES
${VERSION_STRING_CPP}
../../cockatrice/src/interface/card_picture_loader/card_picture_loader_local.cpp
../../cockatrice/src/interface/card_picture_loader/card_picture_to_load.cpp
../../cockatrice/src/interface/card_picture_loader/card_picture_loader_worker.cpp
../../cockatrice/src/interface/card_picture_loader/card_picture_loader_worker_work.cpp
../../cockatrice/src/client/settings/cache_settings.h
picture_loader_benchmark.cpp
settings_cache_mock.cpp
LIBS
libcockatrice_card
libcockatrice_interfaces
libcockatrice_network
libcockatrice_settings
libcockatrice_utility
INCLUDE_DIRS
${CMAKE_SOURCE_DIR}/cockatrice/src
MANUAL
)