1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-12-27 20:29:47 +01:00

tests: add mainProgram to stub packages

This is to avoid warnings being printed while tests are run.
This commit is contained in:
Robert Helgesson 2023-09-24 09:48:27 +02:00
parent 835465e8ba
commit baf222f2fb
No known key found for this signature in database
GPG key ID: 36BDAA14C2797E89

View file

@ -33,7 +33,8 @@ let
defaultBuildScript = "mkdir $out";
dummyPackage = pkgs.runCommandLocal "dummy" { } defaultBuildScript;
dummyPackage = pkgs.runCommandLocal "dummy" { meta.mainProgram = "dummy"; }
defaultBuildScript;
mkStubPackage = { name ? "dummy", outPath ? null, version ? null
, buildScript ? defaultBuildScript }:
@ -41,7 +42,10 @@ let
pkg = if name == "dummy" && buildScript == defaultBuildScript then
dummyPackage
else
pkgs.runCommandLocal name { pname = name; } buildScript;
pkgs.runCommandLocal name {
pname = name;
meta.mainProgram = name;
} buildScript;
in pkg // optionalAttrs (outPath != null) {
inherit outPath;