1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-10 21:29:48 +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 committed by Mikilio
parent 9711ed2e82
commit 917800e574
No known key found for this signature in database
GPG key ID: 5B2F1A890CF33F3F

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;