about summary refs log tree commit diff
path: root/lib/get-tests.nix
blob: f14ee3cc121ef8403f1f7201c429daa958433079 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
{ system ? builtins.currentSystem
, nixpkgs ? import ../nixpkgs-path.nix
, vuizvuiTests ? ../tests
, excludeVuizvuiGames ? false
}:

with import "${nixpkgs}/lib";

{
  nixos = let
    upstreamTests = (import "${nixpkgs}/nixos/release.nix" {
      inherit nixpkgs;
    }).tests;
    isTestOrJob = attr: (attr.type or null) == "derivation" || attr ? test;
    isTestOrSystems = attr: isTestOrJob attr || attr ? ${system};
    cond = attr: !isTestOrSystems attr;
    reduce = attr: if isTestOrJob attr then attr else attr.${system};
  in mapAttrsRecursiveCond cond (path: reduce) upstreamTests;

  vuizvui = removeAttrs (import vuizvuiTests {
    inherit system;
    nixpkgsPath = nixpkgs;
  }) (optional excludeVuizvuiGames "games");
}