TetraIF migration and Unittest Implementation for it

Entire-Checkpoint: 14d1fef0cf36
This commit is contained in:
berrux-dev committed 2026-09-12 13:54:34 +02:00
1 parent a86f9b5bac
commit ba212f9dce
78 files changed
+1611 -640

No files matched your search

+70 -67
View File
@@ -1,88 +1,91 @@
# Unified build/CI image for the Legatus Qt6 migration.
#
# Build (context is ci/, which holds the RTI licence file):
# docker build -f ci/Dockerfile.ci -t legatus-build:26.04 ci
#
# RTI Connext is not baked into the image, it is mounted at run time:
# -v /path/to/rti_connext_dds-7.7.0:/opt/rti_connext_dds-7.7.0:ro
#
# Qt comes from the Ubuntu 26.04 packages (6.10.2). It is deliberately not
# installed through aqtinstall: libkf6texttemplate-dev, which Lts/Common/CodeGen
# requires, is linked against the distribution Qt6, and loading a second Qt6
# from /opt/Qt beside it would put two copies of QtCore in the same process.
FROM ubuntu:26.04
ENV DEBIAN_FRONTEND=noninteractive
ENV QT_VERSION=6.10.2
ENV QT_ARCH=linux_gcc_64
ENV QT_BASE_DIR=/opt/Qt
ENV QT_ROOT=/opt/Qt/6.10.2/gcc_64
ENV Qt6_ROOT=/opt/Qt/6.10.2/gcc_64
ENV CMAKE_PREFIX_PATH=/usr/local:/opt/Qt/6.10.2/gcc_64
ENV PATH=/opt/Qt/6.10.2/gcc_64/bin:$PATH
ENV LD_LIBRARY_PATH=/opt/Qt/6.10.2/gcc_64/lib:${LD_LIBRARY_PATH:-}
RUN apt-get update && \
apt-get install -y --no-install-recommends \
# Toolchain, CI tooling (policy checks and formatting), Qt 6.10.2 with every
# module the project's find_package() calls ask for, KDE text templating for
# Lts/Common/CodeGen, GoogleTest, and the third-party libraries the services link.
RUN apt-get update -qq && apt-get install -y -qq --no-install-recommends \
build-essential \
g++ \
make \
cmake \
ninja-build \
pkg-config \
binutils \
gdb \
file \
less \
git \
ca-certificates \
openssh-client \
python3 \
python3-pip \
python3-venv \
clang-format \
cmake \
ninja-build \
git \
g++ \
make \
ca-certificates \
openssh-client \
pkg-config \
libpq-dev \
libbz2-dev \
qt6-base-dev \
qt6-tools-dev \
qt6-tools-dev-tools \
qt6-l10n-tools \
qt6-declarative-dev \
qt6-multimedia-dev \
qt6-positioning-dev \
qt6-serialport-dev \
qt6-svg-dev \
qt6-webengine-dev \
qt6-websockets-dev \
qt6-5compat-dev \
libgl-dev \
libkf6texttemplate-dev \
libgtest-dev \
libboost-all-dev \
libxml2-dev \
libbz2-dev \
libcurl4-openssl-dev \
libpq-dev \
libssl-dev \
libcurl4-openssl-dev && \
rm -rf /var/lib/apt/lists/*
libxml2-dev \
&& rm -rf /var/lib/apt/lists/*
# Install Qt 6.10.2 via aqtinstall
RUN python3 -m venv /opt/venv && \
/opt/venv/bin/pip install --upgrade pip setuptools wheel && \
/opt/venv/bin/pip install aqtinstall && \
mkdir -p "${QT_BASE_DIR}" && \
/opt/venv/bin/python -m aqt install-qt linux desktop "${QT_VERSION}" "${QT_ARCH}" -m qtmultimedia qtserialport qtimageformats qtwebsockets qtwebengine qtpdf qtwebview --outputdir "${QT_BASE_DIR}" && \
test -f "${QT_ROOT}/lib/cmake/Qt6/Qt6Config.cmake"
# Headless Qt, for tests that instantiate widgets.
ENV QT_QPA_PLATFORM=offscreen
# Install Log4Qt for Qt6
RUN git clone --depth 1 https://github.com/MEONMedical/Log4Qt.git /tmp/log4qt && \
cd /tmp/log4qt && \
mkdir -p build && cd build && \
cmake -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_STANDARD=23 \
-DCMAKE_CXX_EXTENSIONS=OFF \
-DCMAKE_PREFIX_PATH="${QT_ROOT}" \
-DCMAKE_INSTALL_PREFIX="/usr/local" \
-DBUILD_SHARED_LIBS=ON .. && \
cmake --build . -- -j$(nproc) && \
cmake --install . && \
rm -rf /tmp/log4qt
# Log4Qt is deliberately NOT installed. Its public header log4qt/level.h declares
# a defaulted C++20 operator<=>, so every consumer must be compiled with
# -std=c++20 or later. This project targets C++17, and pulling Log4Qt in makes
# Z/src/NGLLogger fail to compile. NGLLogger falls back to its own log4qt_stub.h
# when the package is absent. Re-enabling Log4Qt would require moving the whole
# project to C++20 first.
# Create minimal CMake config for Log4Qt
RUN mkdir -p /usr/local/lib/cmake/Log4Qt && \
cat > /usr/local/lib/cmake/Log4Qt/Log4QtConfig.cmake << 'EOF'
if (NOT TARGET Log4Qt::log4qt)
add_library(Log4Qt::log4qt UNKNOWN IMPORTED)
set_target_properties(Log4Qt::log4qt PROPERTIES
IMPORTED_LOCATION "/usr/local/lib/liblog4qt.so"
INTERFACE_INCLUDE_DIRECTORIES "/usr/local/include"
)
endif()
set(Log4Qt_FOUND TRUE CACHE INTERNAL "Log4Qt found by package config")
set(Log4Qt_INCLUDE_DIRS "/usr/local/include" CACHE INTERNAL "Log4Qt include dir")
set(Log4Qt_LIBRARIES "/usr/local/lib/liblog4qt.so" CACHE INTERNAL "Log4Qt library")
EOF
# RTI Connext DDS - mounted at run time, see the header comment.
ENV RTI_CONNEXT_HOME=/opt/rti_connext_dds-7.7.0 \
NDDSHOME=/opt/rti_connext_dds-7.7.0 \
DDS_PATH=/opt/rti_connext_dds-7.7.0 \
PATH=/opt/rti_connext_dds-7.7.0/bin:$PATH \
LD_LIBRARY_PATH=/opt/rti_connext_dds-7.7.0/lib/x64Linux4gcc8.5.0
# Set Qt platform for headless testing
# ArcGIS SDK configuration
# Developer licence file. Override RTI_LICENSE_FILE to point at another one.
COPY rti_license.dat /root/rti_license.dat
ENV RTI_LICENSE_FILE=/root/rti_license.dat
# ArcGIS SDK - only needed with -DBUILD_ARCGIS=ON, mounted at run time.
ENV ARCGIS_ROOT=/repo/external/ArcGIS/MapsSDK_Qt_300.0.0/ArcGIS_Maps_SDK_Qt_300.0.0/qt300.0.0/sdk
ENV ARCGIS_INC_DIR=${ARCGIS_ROOT}/include
ENV ARCGIS_LIB_DIR=${ARCGIS_ROOT}/linux/x64/lib
# Set Qt platform for headless testing
ENV QT_QPA_PLATFORM=offscreen
# Configure git for containerized environments
# Containerised checkouts are owned by a different uid than the build user.
RUN git config --global --add safe.directory "*"
# Setup RTI Connext license (developer license file)
COPY rti_license.dat /root/rti_license.dat
ENV RTI_LICENSE_FILE=/root/rti_license.dat
WORKDIR /workspace
CMD ["bash"]