infra/tests/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

27 lines
510 B
Nix
Raw Normal View History

args@{
self,
lib,
system,
pkgs,
inputs,
...
2024-08-27 11:17:30 +00:00
}:
let
nixos-lib = import (inputs.nixpkgs + "/nixos/lib") { };
2024-08-27 11:17:30 +00:00
loadTestFiles =
with lib;
dir:
mapAttrs' (
name: _:
let
test = ((import (dir + "/${name}")) args);
in
{
name = "test-" + (lib.strings.removeSuffix ".nix" name);
value = nixos-lib.runTest test;
}
) (filterAttrs (name: _: (hasSuffix ".nix" name) && name != "default.nix") (builtins.readDir dir));
in
loadTestFiles ./.