test(flatpak): point flatpak tests at the external plugin sources

Rewires the flatpak unit, integration and plugin-manager tests to compile
against plugins/flatpak-provider, and updates plugin-manager.test to treat
flatpak as a runtime-loaded plugin rather than a registered built-in.

Generated with Codebuff 🤖
Co-Authored-By: Codebuff <noreply@codebuff.com>
This commit is contained in:
BlackAngelTV committed 2026-08-29 20:34:50 +02:00
1 parent bd13a1404b
commit e81f5ee0cd
2 files changed
+22 -14

No files matched your search

+10 -8
View File
@@ -16,21 +16,23 @@ int main(int argc, char* argv[]) {
PluginManager pm;
pm.registerBuiltin({"pacman", "Pacman", "1.0.0", "Natif Arch Linux", "FWS"},
new PacmanManager());
// Flatpak ships an install hint so the app can offer to install the tool
// (pacman -S flatpak) when it is missing on the system.
pm.registerBuiltin({"flatpak", "Flatpak", "1.0.0", "Flatpak", "FWS",
false, "", false, "flatpak"},
new FlatpakManager());
// Flatpak now ships as an external plugin (dropped next to the test binary
// by CMake, like the sample plugin) rather than a compiled-in provider.
pm.discoverExternal();
// Built-ins + the sample plugin dropped next to the test binary.
// pacman built-in + the flatpak and sample plugins dropped next to the
// test binary.
assert(pm.providers().size() == 3);
// Install hints are exposed per provider; the sample plugin omits its
// optional hint symbol, which must read back as empty.
// optional hint symbol (must read back empty), while the flatpak plugin
// declares the OS package backing its tool.
const auto& providers = pm.providers();
for (const auto& entry : providers) {
if (entry.info.id == "flatpak") assert(entry.info.installHint == "flatpak");
if (entry.info.id == "flatpak") {
assert(!entry.info.builtin);
assert(entry.info.installHint == "flatpak");
}
if (entry.info.id == "sample") assert(entry.info.installHint.empty());
}
assert(pm.findAvailable("flatpak") != nullptr);