summaryrefslogtreecommitdiffstats
path: root/lib/tests/release.nix
blob: 280c88cee66bc415d196b96ced679a91c2568a9e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
{
  # The pkgs used for dependencies for the testing itself
  # Don't test properties of pkgs.lib, but rather the lib in the parent directory
  system ? builtins.currentSystem,
  pkgs ? import ../.. { inherit system; } // {
    lib = throw "pkgs.lib accessed, but the lib tests should use nixpkgs' lib path directly!";
  },
  # For testing someone may edit impure.nix to return cross pkgs, use `pkgsBuildBuild` directly so everything here works.
  pkgsBB ? pkgs.pkgsBuildBuild,
  nix ? pkgs-nixVersions.stable,
  nixVersions ? [
    nix
    pkgs-nixVersions.latest
  ],
  pkgs-nixVersions ? import ./nix-for-tests.nix { pkgs = pkgsBB; },
}:

let
  lib = import ../.;
  testWithNix =
    nix:
    import ./test-with-nix.nix {
      inherit lib nix;
      pkgs = pkgsBB;
    };

in
pkgsBB.symlinkJoin {
  name = "nixpkgs-lib-tests";
  paths = map testWithNix nixVersions ++ [
    (import ./nix-unit.nix {
      inherit pkgs;
    })
    (import ./maintainers.nix {
      inherit pkgs;
      lib = import ../.;
    })
    (import ./teams.nix {
      inherit pkgs;
      lib = import ../.;
    })
  ];
}