Merge pull request #86024 from Infinisil/lib-tests-pkgs

This commit is contained in:
Silvan Mosberger 2020-04-29 01:20:14 +02:00 committed by GitHub
commit aa3dde806e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 8 deletions

View file

@ -1,10 +1,11 @@
# to run these tests:
# nix-build nixpkgs/lib/tests/maintainers.nix
# If nothing is output, all tests passed
{ pkgs ? import ../.. {} }:
# to run these tests (and the others)
# nix-build nixpkgs/lib/tests/release.nix
{ # The pkgs used for dependencies for the testing itself
pkgs
, lib
}:
let
inherit (pkgs) lib;
inherit (lib) types;
maintainerModule = { config, ... }: {

View file

@ -1,8 +1,17 @@
{ pkgs ? import ../.. {} }:
{ # The pkgs used for dependencies for the testing itself
# Don't test properties of pkgs.lib, but rather the lib in the parent directory
pkgs ? import ../.. {} // { lib = throw "pkgs.lib accessed, but the lib tests should use nixpkgs' lib path directly!"; }
}:
pkgs.runCommandNoCC "nixpkgs-lib-tests" {
buildInputs = [ pkgs.nix (import ./check-eval.nix) (import ./maintainers.nix { inherit pkgs; }) ];
NIX_PATH = "nixpkgs=${toString pkgs.path}";
buildInputs = [
pkgs.nix
(import ./check-eval.nix)
(import ./maintainers.nix {
inherit pkgs;
lib = import ../.;
})
];
} ''
datadir="${pkgs.nix}/share"
export TEST_ROOT=$(pwd)/test-tmp