hello: Use callPackage for test
This commit is contained in:
parent
2afc03a084
commit
40ab3b8738
|
@ -1,5 +1,5 @@
|
||||||
{ lib
|
{ callPackage
|
||||||
, runCommand
|
, lib
|
||||||
, stdenv
|
, stdenv
|
||||||
, fetchurl
|
, fetchurl
|
||||||
, nixos
|
, nixos
|
||||||
|
@ -28,12 +28,7 @@ stdenv.mkDerivation (self: {
|
||||||
(nixos { environment.noXlibs = true; }).pkgs.hello;
|
(nixos { environment.noXlibs = true; }).pkgs.hello;
|
||||||
};
|
};
|
||||||
|
|
||||||
passthru.tests.run = runCommand "hello-test-run" {
|
passthru.tests.run = callPackage ./test.nix { hello = self; };
|
||||||
nativeBuildInputs = [ self ];
|
|
||||||
} ''
|
|
||||||
diff -U3 --color=auto <(hello) <(echo 'Hello, world!')
|
|
||||||
touch $out
|
|
||||||
'';
|
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
description = "A program that produces a familiar, friendly greeting";
|
description = "A program that produces a familiar, friendly greeting";
|
||||||
|
|
8
pkgs/applications/misc/hello/test.nix
Normal file
8
pkgs/applications/misc/hello/test.nix
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
{ runCommand, hello }:
|
||||||
|
|
||||||
|
runCommand "hello-test-run" {
|
||||||
|
nativeBuildInputs = [ hello ];
|
||||||
|
} ''
|
||||||
|
diff -U3 --color=auto <(hello) <(echo 'Hello, world!')
|
||||||
|
touch $out
|
||||||
|
''
|
Loading…
Reference in a new issue