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

+32 -8
View File
@@ -252,12 +252,28 @@ in-tree flow calls `new_docker_build.sh` (the Release 2 driver). See
## Step 6 — Code coverage (lcov)
`--run-coverage` is available and is mutually exclusive with
`--run-jenkins-builder`. In the current tree it only passes
`-DRUN_COVERAGE=ON` / `-DCOVERAGE_OUTPUT_DIR` to the configure — those
variables are not consumed by any `CMakeLists.txt` yet, so no lcov
data is collected. The option is kept for the (still to be wired)
coverage step.
`--run-coverage` builds the whole Release 2 scope instrumented
(`-O0 -g --coverage`, overriding the RelWithDebInfo flags), runs the
ctest suite and collects an lcov report inside the container
(lcov + genhtml ship in the `legatus-qt6:1.0` image):
```bash
./new_docker_build.sh --run-coverage
```
The report is written to
`<pipeline-root>/coverage/<PROJECT>/<OS_VERSION>/` (default:
`coverage/guez/26.04/`), next to `qt-migration-legatus/` and outside
the tree:
- `html/index.html` — browser report (line + branch coverage)
- `coverage.info` — lcov tracefile, filtered to `qt-migration-legatus/*`
- `coverage_summary.txt` — totals (line / branch hit rate)
`--coverage-output-dir DIR` moves the report; `DIR` must be an absolute
path under the pipeline root (relative values are ignored and the
default above is used). The option is mutually exclusive with
`--run-jenkins-builder`.
## Options reference
@@ -279,8 +295,8 @@ The main ones:
| `--run-jenkins-builder` | off | produce the DEB packages (Step 4) |
| `--package-output-dir DIR` | `./packages-out` | pass-through (see Step 4 note) |
| `--lts-version / --project / --build-number / --build-tag` | `1.0` / `guez` / `1` / `manual-build` | package metadata |
| `--run-coverage` | off | coverage flag pass-through (Step 6) |
| `--coverage-output-dir DIR` | `./coverage-out` | pass-through (see Step 6) |
| `--run-coverage` | off | instrument with `-O0 --coverage`, run ctest, collect the lcov report (Step 6); mutually exclusive with `--run-jenkins-builder` |
| `--coverage-output-dir DIR` | `<pipeline-root>/coverage/<project>/<os>` | report dir — only absolute paths under the pipeline root are honored (Step 6) |
Environment overrides: `BUILD_GROUP1/3/5/6`, `RUN_CTEST`, `TESTS_ONLY`,
`USE_PREBUILT_IMAGE`, `DOCKER_IMAGE`, `CMAKE_BUILD_FLAGS`,
@@ -302,6 +318,14 @@ Environment overrides: `BUILD_GROUP1/3/5/6`, `RUN_CTEST`, `TESTS_ONLY`,
`QT_PLUGIN_PATH` from Step 3).
- **`GrantleeParserSmoke`: `ktexttemplate_defaulttags` not found** →
run ctest/tests with the system plugin dir prepended (Step 3).
- **Coverage build fails to link with `undefined reference` to
`DTC::GenericDtcSC<...>::readAlive(...)` etc.** — a call to a pure
virtual function only links at `-O1` and above (GCC rewrites it to
`__cxa_pure_virtual`); at `-O0` the raw symbol stays undefined. This
was triggered by the one-line forwarders in
`Lts/DDS/DTC/generic_dtc.h`, which have been removed: the concrete
classes in `generic_dtc_impl.h` implement every method `final`, so
the forwarders were dead code (and a latent infinite recursion).
- **Stale build tree** → the driver always recreates `../build/`; for
manual builds delete `../build/` and rerun Step 2 if CMake behaves
oddly.