[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.
This commit is contained in:
Lukas Brübach 2026-11-08 15:07:51 +01:00
parent b445f81c9d
commit 218e3da75b
4 changed files with 19 additions and 0 deletions

View file

@ -9,12 +9,16 @@
#include <QStringLiteral>
#include <QTemporaryDir>
#include <gtest/gtest.h>
#include <libcockatrice/rng/rng_abstract.h>
#include <string>
// 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");