From 917800e5744d6401cdf6c78932155a7d67e88260 Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Sun, 24 Sep 2023 09:48:27 +0200 Subject: [PATCH] tests: add mainProgram to stub packages This is to avoid warnings being printed while tests are run. --- tests/stubs.nix | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/stubs.nix b/tests/stubs.nix index 5dee8e43a..e9ecbed70 100644 --- a/tests/stubs.nix +++ b/tests/stubs.nix @@ -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;