mirror of
https://github.com/nix-community/home-manager
synced 2024-11-26 14:40:29 +00:00
tests: add mainProgram to stub packages
This is to avoid warnings being printed while tests are run.
This commit is contained in:
parent
835465e8ba
commit
baf222f2fb
1 changed files with 6 additions and 2 deletions
|
@ -33,7 +33,8 @@ let
|
||||||
|
|
||||||
defaultBuildScript = "mkdir $out";
|
defaultBuildScript = "mkdir $out";
|
||||||
|
|
||||||
dummyPackage = pkgs.runCommandLocal "dummy" { } defaultBuildScript;
|
dummyPackage = pkgs.runCommandLocal "dummy" { meta.mainProgram = "dummy"; }
|
||||||
|
defaultBuildScript;
|
||||||
|
|
||||||
mkStubPackage = { name ? "dummy", outPath ? null, version ? null
|
mkStubPackage = { name ? "dummy", outPath ? null, version ? null
|
||||||
, buildScript ? defaultBuildScript }:
|
, buildScript ? defaultBuildScript }:
|
||||||
|
@ -41,7 +42,10 @@ let
|
||||||
pkg = if name == "dummy" && buildScript == defaultBuildScript then
|
pkg = if name == "dummy" && buildScript == defaultBuildScript then
|
||||||
dummyPackage
|
dummyPackage
|
||||||
else
|
else
|
||||||
pkgs.runCommandLocal name { pname = name; } buildScript;
|
pkgs.runCommandLocal name {
|
||||||
|
pname = name;
|
||||||
|
meta.mainProgram = name;
|
||||||
|
} buildScript;
|
||||||
in pkg // optionalAttrs (outPath != null) {
|
in pkg // optionalAttrs (outPath != null) {
|
||||||
inherit outPath;
|
inherit outPath;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue