lib/tests: Allow overriding pkgs independent of lib being tested
This commit is contained in:
parent
d0b1de5491
commit
a89b773984
|
@ -1,10 +1,11 @@
|
||||||
# to run these tests:
|
# to run these tests (and the others)
|
||||||
# nix-build nixpkgs/lib/tests/maintainers.nix
|
# nix-build nixpkgs/lib/tests/release.nix
|
||||||
# If nothing is output, all tests passed
|
{ # The pkgs used for dependencies for the testing itself
|
||||||
{ pkgs ? import ../.. {} }:
|
pkgs
|
||||||
|
, lib
|
||||||
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
inherit (pkgs) lib;
|
|
||||||
inherit (lib) types;
|
inherit (lib) types;
|
||||||
|
|
||||||
maintainerModule = { config, ... }: {
|
maintainerModule = { config, ... }: {
|
||||||
|
|
|
@ -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" {
|
pkgs.runCommandNoCC "nixpkgs-lib-tests" {
|
||||||
buildInputs = [ pkgs.nix (import ./check-eval.nix) (import ./maintainers.nix { inherit pkgs; }) ];
|
buildInputs = [
|
||||||
NIX_PATH = "nixpkgs=${toString pkgs.path}";
|
pkgs.nix
|
||||||
|
(import ./check-eval.nix)
|
||||||
|
(import ./maintainers.nix {
|
||||||
|
inherit pkgs;
|
||||||
|
lib = import ../.;
|
||||||
|
})
|
||||||
|
];
|
||||||
} ''
|
} ''
|
||||||
datadir="${pkgs.nix}/share"
|
datadir="${pkgs.nix}/share"
|
||||||
export TEST_ROOT=$(pwd)/test-tmp
|
export TEST_ROOT=$(pwd)/test-tmp
|
||||||
|
|
Loading…
Reference in New Issue