test-utilities: version test

Extract 'version test' to a reusable test utility as discussed in
https://github.com/NixOS/nixpkgs/pull/119636#issuecomment-826137021 and
This commit is contained in:
Arnout Engelen
2021-05-07 09:53:35 +02:00
parent 39e6bf7647
commit b68130fd2c
5 changed files with 57 additions and 11 deletions
+9 -1
View File
@@ -1,4 +1,9 @@
{ lib, stdenv, fetchurl }:
{ lib
, stdenv
, fetchurl
, testVersion
, hello
}:
stdenv.mkDerivation rec {
pname = "hello";
@@ -11,6 +16,9 @@ stdenv.mkDerivation rec {
doCheck = true;
passthru.tests.version =
testVersion { package = hello; };
meta = with lib; {
description = "A program that produces a familiar, friendly greeting";
longDescription = ''