Wire --run-coverage end to end and remove the DTC pure-virtual forwarders

- new_docker_build.sh: --run-coverage now instruments the RelWithDebInfo
  build with -O0 -g --coverage (CMAKE_*_FLAGS_RELWITHDEBINFO), runs ctest
  and collects an lcov report (capture/extract/genhtml/summary) under
  <pipeline-root>/coverage/<project>/<os>; the lcov steps share an
  ignore-errors list for the -O0 data quirks (inconsistent, count, ...).
- Lts/DDS/DTC/generic_dtc.h: remove the one-line forwarders that called
  the pure virtuals of GenericDtcSC (latent infinite recursion, and an
  undefined symbol at link time at -O0, e.g. coverage builds); the
  concrete classes in generic_dtc_impl.h implement every method final,
  and the 'using' declarations keep the base methods accessible.
- README.md: document the coverage flow (Step 6), update the option
  rows and add a troubleshooting entry for the -O0 pure-virtual link
  failure.
This commit is contained in:
berrux-dev committed 2026-11-20 10:02:20 +01:00
1 parent aa519a56d2
commit 72c87230fd
3 files changed
+131 -38

No files matched your search

@@ -59,13 +59,12 @@ class GenericDtc
using BaseClass::takeAlive;
using BaseClass::takeDisposed;
using BaseClass::SubscriberCallback;
bool setSubscriberCallback(const typename BaseClass::SubscriberCallback& callback) override { return BaseClass::setSubscriberCallback(callback); }
bool readAlive(TopicType& data) { return BaseClass::readAlive(data); }
bool takeAlive(TopicType& data) { return BaseClass::takeAlive(data); }
bool takeDisposed(TopicType& data) { return BaseClass::takeDisposed(data); }
bool hasSamples() const { return BaseClass::hasSamples(); }
DRO_OBJECT* dataReader() const override { return BaseClass::dataReader(); }
bool waitForHistoricalData(int timeoutMSec) { return BaseClass::waitForHistoricalData(timeoutMSec); }
// NOTE: the methods of GenericDtcSC are deliberately NOT overridden here.
// They stay pure and are implemented by the concrete classes in
// generic_dtc_impl.h; calls through this class dispatch virtually.
// One-line forwarders like `return BaseClass::readAlive(data);` must not be
// re-introduced: they are a latent infinite recursion at runtime and an
// undefined pure-virtual symbol at link time at -O0 (e.g. coverage builds).
};
template <typename DRO_OBJECT>
@@ -82,13 +81,12 @@ class GenericDtcSampleInfo
using BaseClass::takeAlive;
using BaseClass::takeDisposed;
using BaseClass::SubscriberCallback;
bool setSubscriberCallback(const typename BaseClass::SubscriberCallback& callback) override { return BaseClass::setSubscriberCallback(callback); }
bool readAlive(TopicType& data) { return BaseClass::readAlive(data); }
bool takeAlive(TopicType& data) { return BaseClass::takeAlive(data); }
bool takeDisposed(TopicType& data) { return BaseClass::takeDisposed(data); }
bool hasSamples() const { return BaseClass::hasSamples(); }
DRO_OBJECT* dataReader() const override { return BaseClass::dataReader(); }
bool waitForHistoricalData(int timeoutMSec) { return BaseClass::waitForHistoricalData(timeoutMSec); }
// NOTE: the methods of GenericDtcSC are deliberately NOT overridden here.
// They stay pure and are implemented by the concrete classes in
// generic_dtc_impl.h; calls through this class dispatch virtually.
// One-line forwarders like `return BaseClass::readAlive(data);` must not be
// re-introduced: they are a latent infinite recursion at runtime and an
// undefined pure-virtual symbol at link time at -O0 (e.g. coverage builds).
};
template <typename DRO_OBJECT>
@@ -105,13 +103,12 @@ class Ddtc
using BaseClass::takeAlive;
using BaseClass::takeDisposed;
using BaseClass::SubscriberCallback;
bool setSubscriberCallback(const typename BaseClass::SubscriberCallback& callback) override { return BaseClass::setSubscriberCallback(callback); }
bool readAlive(TopicType& data) { return BaseClass::readAlive(data); }
bool takeAlive(TopicType& data) { return BaseClass::takeAlive(data); }
bool takeDisposed(TopicType& data) { return BaseClass::takeDisposed(data); }
bool hasSamples() const { return BaseClass::hasSamples(); }
DRO_OBJECT* dataReader() const override { return BaseClass::dataReader(); }
bool waitForHistoricalData(int timeoutMSec) { return BaseClass::waitForHistoricalData(timeoutMSec); }
// NOTE: the methods of GenericDtcSC are deliberately NOT overridden here.
// They stay pure and are implemented by the concrete classes in
// generic_dtc_impl.h; calls through this class dispatch virtually.
// One-line forwarders like `return BaseClass::readAlive(data);` must not be
// re-introduced: they are a latent infinite recursion at runtime and an
// undefined pure-virtual symbol at link time at -O0 (e.g. coverage builds).
};
template <typename DRO_OBJECT>
@@ -128,12 +125,11 @@ class DdtcSampleInfo
using BaseClass::takeAlive;
using BaseClass::takeDisposed;
using BaseClass::SubscriberCallback;
bool setSubscriberCallback(const typename BaseClass::SubscriberCallback& callback) override { return BaseClass::setSubscriberCallback(callback); }
bool readAlive(TopicType& data) { return BaseClass::readAlive(data); }
bool takeAlive(TopicType& data) { return BaseClass::takeAlive(data); }
bool takeDisposed(TopicType& data) { return BaseClass::takeDisposed(data); }
bool hasSamples() const { return BaseClass::hasSamples(); }
DRO_OBJECT* dataReader() const override { return BaseClass::dataReader(); }
bool waitForHistoricalData(int timeoutMSec) { return BaseClass::waitForHistoricalData(timeoutMSec); }
// NOTE: the methods of GenericDtcSC are deliberately NOT overridden here.
// They stay pure and are implemented by the concrete classes in
// generic_dtc_impl.h; calls through this class dispatch virtually.
// One-line forwarders like `return BaseClass::readAlive(data);` must not be
// re-introduced: they are a latent infinite recursion at runtime and an
// undefined pure-virtual symbol at link time at -O0 (e.g. coverage builds).
};
} // namespace DTC