Files
Dario Gabriel LipicarandClaude Opus 5 819a586cab docs: retire references to files, outputs and pins that no longer exist
Sweep of documentation and comments the shell split and the pin retirement
made false. No behaviour change except one dead nix binding, below.

flake.nix
  * Deletes `appImage = import ./nix/appimage.nix {...}`. That file is NOT in
    the tree; the binding survived only because nix is lazy and nothing ever
    forced it. Anyone referencing `appImage` would have hit a file-not-found at
    eval. The shipped AppImage is the `bin-appimage` output, built by
    nix-bundle-appimage.
  * Four stale `Rev-pinned:` comment blocks -- logos-module-loader-qt,
    logos-liblogos, logos-capability-module, logos-package-manager-ui. None of
    those inputs carries a rev or ref any more; 3c21c1f retired the pins and
    left every explanation behind. The logos-package-manager-ui one was a
    DUPLICATED pair of near-identical paragraphs describing two different revs
    of the same dead pin.

    Rewritten rather than deleted, because two carried constraints that outlive
    the pin and would be expensive to rediscover: capability_module fails CLOSED
    without `token_registry` / `token_delivery`, and package-manager-ui is
    loaded IN-PROCESS so it must match the host runtime's generation.

nix/coverage.nix
  * --filter now lists BOTH app/ and src/. The split moved AppsFilterProxy,
    ModulesFilterProxy, InstallEnums, ShortcutBridge and WorkspaceArea into
    src/, and all five are still compiled into unit-test binaries via srcdeps --
    so their .gcno/.gcda were produced and then discarded, and four of the ten
    test binaries contributed nothing to the published numbers. failUnderLine
    defaults to 0, so this cannot break the build.
  * Its scope note still listed MainContainer as an app/ source.

app/CMakeLists.txt
  * The logos_core-last rule is load-bearing on the mingw link and its comment
    justified it by LogosSharedFromDll.cmake emptying the static archives --
    a file deleted in #348, and contradicted by the comment 14 lines below.
    The rule stands; only its stated reason was gone, which is precisely how
    someone deletes it and gets four undefined references.

docs/project.md
  * The app/ tree listed LogosQmlBridge.h/cpp, mdiview.h/cpp, mdichild.h/cpp
    and an app/qml/ subtree of nine QML files. None exists; the QML lives at
    src/Basecamp/. Replaced with the sources actually there.
  * The nix/ listing named appimage.nix, macos-bundle.nix and macos-dmg.nix --
    none of which exists -- and omitted symbol-gate.nix, which :193 relies on
    as the thing enforcing the shell boundary.
  * MainContainer's section still said app/; 9b8cf6e recorded R100 into src/.
    It also said MainContainer creates MainUIBackend, which Window now owns.
  * LogosQmlBridge's section cited app/ paths for an EXTERNAL header that
    arrives from a flake input.
  * MdiView / MdiChild sections describe classes that no longer exist; the role
    is src/WorkspaceArea.
  * Advertised a `.#bin-macos-dmg` output that is not defined anywhere.

tests/shutdown-tests.mjs
  * Pointed at app/main.cpp:224-254 as "the orderly teardown". Those lines are
    startup. The reference was already wrong when written and has since moved
    twice, so it now names the block instead of line-numbering it.

doctests/basecamp-modules-bundle.test.yaml
  * "Basecamp's *own* shell is deliberately NOT here: it is carried as a
    main_ui plugin again" -- a fold-era clause left in front of its own
    replacement, negating the rest of the sentence and the assertion below it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-22 19:56:02 -03:00

108 lines
3.9 KiB
Nix

# Line/branch coverage for the C++ unit-test suite.
#
# Reuses tests/CMakeLists.txt verbatim — same targets, same ctest run as
# `nix build .#unit-tests` — but compiled with --coverage, then reported
# through gcovr. Build:
#
# nix build .#coverage -L && open result/coverage.html
#
# Report-only by default (failUnderLine = 0). Raise the threshold as the
# test plan phases land, either here or from the caller in flake.nix, and the
# derivation starts failing the build when coverage regresses below it.
#
# Scope caveat: gcovr only sees files that were compiled into the test
# binaries. Sources no unit test links at all (PackageCoordinator,
# UIPluginManager, PluginLoader, MainUIBackend app-side; MainContainer and
# MainShellView shell-side) produce no
# .gcno and therefore do NOT appear in the report as 0% — the percentage here
# is "coverage of the code under unit test", not of all of app/. Adding a
# source to tests/CMakeLists.txt is what pulls it into the denominator.
{ pkgs, src, logosPackageHeaders, failUnderLine ? 0, failUnderBranch ? 0 }:
let
# gcov reader matching the stdenv compiler: clang emits gcov data only
# llvm-cov of the same LLVM version can parse, gcc emits data for its own
# gcov. Mismatching the two is the usual cause of "unknown gcov version".
gcovExecutable =
if pkgs.stdenv.cc.isClang
then "${pkgs.llvmPackages.libllvm}/bin/llvm-cov gcov"
else "${pkgs.stdenv.cc.cc}/bin/gcov";
in
pkgs.stdenv.mkDerivation {
pname = "logos-basecamp-coverage";
version = "0.0.0";
inherit src;
nativeBuildInputs = [
pkgs.cmake
pkgs.ninja
pkgs.pkg-config
pkgs.qt6.wrapQtAppsHook
pkgs.gcovr
];
buildInputs = [
pkgs.qt6.qtbase
pkgs.qt6.qtdeclarative # Qt::Qml — InstallEnums.h includes <QtQml/qqml.h>
];
dontUseCmakeConfigure = true;
buildPhase = ''
runHook preBuild
# -fprofile-update=atomic keeps counters correct if a test ever spawns
# threads; Debug already implies -O0 -g, which keeps line mapping exact.
cmake -S tests -B build-cov -GNinja -DCMAKE_BUILD_TYPE=Debug \
-DLOGOS_PACKAGE_HEADERS="${logosPackageHeaders}/include" \
-DCMAKE_CXX_FLAGS="--coverage -fprofile-update=atomic" \
-DCMAKE_EXE_LINKER_FLAGS="--coverage"
cmake --build build-cov
runHook postBuild
'';
# Running the suite is what writes the .gcda counters next to the .gcno
# files in build-cov, so the report below depends on this phase.
doCheck = true;
checkPhase = ''
runHook preCheck
export QT_QPA_PLATFORM=offscreen
${pkgs.lib.optionalString pkgs.stdenv.isLinux ''
export QT_PLUGIN_PATH="${pkgs.qt6.qtbase}/${pkgs.qt6.qtbase.qtPluginPrefix}"
''}
ctest --test-dir build-cov --output-on-failure
runHook postCheck
'';
installPhase = ''
runHook preInstall
mkdir -p $out
# --filter keeps the report to production code (the tests' own translation
# units and CMake's *_autogen moc stubs are excluded). BOTH trees are
# listed: the shell split moved AppsFilterProxy, ModulesFilterProxy,
# InstallEnums, ShortcutBridge and WorkspaceArea into src/, and all five are
# still compiled into unit-test binaries via tests/CMakeLists.txt's srcdeps.
# With app/ alone their .gcno/.gcda were produced and then discarded, so
# four of the ten test binaries contributed nothing to the numbers.
gcovr \
--root "$PWD" \
--filter 'app/' \
--filter 'src/' \
--exclude '.*_autogen.*' \
--gcov-executable "${gcovExecutable}" \
--exclude-unreachable-branches \
--exclude-throw-branches \
--print-summary \
--html-title "logos-basecamp unit-test coverage" \
--txt "$out/coverage.txt" \
--html-details "$out/coverage.html" \
--cobertura "$out/coverage.xml" \
--json-summary "$out/summary.json" \
--fail-under-line ${toString failUnderLine} \
--fail-under-branch ${toString failUnderBranch}
cat $out/coverage.txt
runHook postInstall
'';
}