hello: Use callPackage for test

This commit is contained in:
Robert Hensing 2021-04-26 14:47:18 +02:00
parent 2afc03a084
commit 40ab3b8738
2 changed files with 11 additions and 8 deletions

View file

@ -1,5 +1,5 @@
{ lib
, runCommand
{ callPackage
, lib
, stdenv
, fetchurl
, nixos
@ -28,12 +28,7 @@ stdenv.mkDerivation (self: {
(nixos { environment.noXlibs = true; }).pkgs.hello;
};
passthru.tests.run = runCommand "hello-test-run" {
nativeBuildInputs = [ self ];
} ''
diff -U3 --color=auto <(hello) <(echo 'Hello, world!')
touch $out
'';
passthru.tests.run = callPackage ./test.nix { hello = self; };
meta = with lib; {
description = "A program that produces a familiar, friendly greeting";

View file

@ -0,0 +1,8 @@
{ runCommand, hello }:
runCommand "hello-test-run" {
nativeBuildInputs = [ hello ];
} ''
diff -U3 --color=auto <(hello) <(echo 'Hello, world!')
touch $out
''