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"; 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;