mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-02-20 19:16:11 +00:00
hello: Use callPackage for test
This commit is contained in:
parent
2afc03a084
commit
40ab3b8738
@ -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";
|
||||
|
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 New Issue
Block a user