From 218e3da75b90b005de2132e10be4d23712bae78b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20Br=C3=BCbach?= <44814898+BruebachL@users.noreply.github.com> Date: Sun, 8 Nov 2026 15:07:51 +0100 Subject: [PATCH] [CI] Link the version string and RNG stub into the test targets The distribution libgtest.a now used by the Linux images makes the linker pull more translation units out of libcockatrice_network than the fetched googletest did. Those units reference VERSION_STRING and the global rng, which several test targets never defined, so the instrumented Ubuntu 26.04 legs failed at link: undefined reference to `VERSION_STRING' undefined reference to `rng' Add the generated version string source wherever a test links the network umbrella, and define the rng stub in the tests that pull the server game classes without declaring it. This matches what the neighbouring server tests already do. A full Debug build and ctest suite in the ci-ubuntu2604 image (system libgtest.a) is green: 841 tests pass. Fixes the nightly failures introduced by #6894. --- tests/CMakeLists.txt | 7 +++++++ tests/client_login_status_test.cpp | 4 ++++ tests/server_dump_zone_test.cpp | 4 ++++ tests/theme_migration/theme_migration_test.cpp | 4 ++++ 4 files changed, 19 insertions(+) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 84b9f02bf..0450e5b8a 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -300,6 +300,7 @@ cockatrice_add_test( NAME server_card_counter_test SOURCES + ${VERSION_STRING_CPP} server_card_counter_test.cpp LIBS libcockatrice_network @@ -310,6 +311,7 @@ cockatrice_add_test( NAME server_dump_zone_test SOURCES + ${VERSION_STRING_CPP} server_dump_zone_test.cpp LIBS libcockatrice_rng @@ -321,6 +323,7 @@ cockatrice_add_test( NAME server_counter_test SOURCES + ${VERSION_STRING_CPP} server_counter_test.cpp LIBS libcockatrice_network @@ -332,6 +335,7 @@ cockatrice_add_test( server_developer_role_test NO_SANITIZE SOURCES + ${VERSION_STRING_CPP} server_developer_role_test.cpp LIBS libcockatrice_network @@ -344,6 +348,7 @@ cockatrice_add_test( server_moderator_role_test NO_SANITIZE SOURCES + ${VERSION_STRING_CPP} server_moderator_role_test.cpp LIBS libcockatrice_network @@ -390,6 +395,7 @@ cockatrice_add_test( NAME local_client_lifetime_test SOURCES + ${VERSION_STRING_CPP} local_client_lifetime_test.cpp LIBS libcockatrice_network @@ -411,6 +417,7 @@ cockatrice_add_test( NAME latency_tracker_test SOURCES + ${VERSION_STRING_CPP} latency_tracker_test.cpp LIBS libcockatrice_network diff --git a/tests/client_login_status_test.cpp b/tests/client_login_status_test.cpp index d8ea63550..a2e073973 100644 --- a/tests/client_login_status_test.cpp +++ b/tests/client_login_status_test.cpp @@ -13,6 +13,10 @@ #include #include #include +#include + +// Referenced by other translation units in the server_remote library. +RNG_Abstract *rng = nullptr; namespace { diff --git a/tests/server_dump_zone_test.cpp b/tests/server_dump_zone_test.cpp index 71c410655..e3284efbb 100644 --- a/tests/server_dump_zone_test.cpp +++ b/tests/server_dump_zone_test.cpp @@ -7,8 +7,12 @@ #include #include #include +#include #include +// Referenced by other translation units in the server_remote library. +RNG_Abstract *rng = nullptr; + namespace { /// Indices a dump request resolves to, as the handler would walk them. diff --git a/tests/theme_migration/theme_migration_test.cpp b/tests/theme_migration/theme_migration_test.cpp index d77c2f62d..a953c9f0b 100644 --- a/tests/theme_migration/theme_migration_test.cpp +++ b/tests/theme_migration/theme_migration_test.cpp @@ -9,12 +9,16 @@ #include #include #include +#include #include // Owned by main.cpp in the real application; pixel_map_generator.cpp references // it, so the test binary needs a definition even though it never renders. ThemeManager *themeManager = nullptr; +// Referenced by other translation units in the server_remote library. +RNG_Abstract *rng = nullptr; + namespace { const QString LEGACY = QStringLiteral("Default");