1
0
Fork 0
selfhostblocks/default.nix
2023-03-07 00:18:56 -08:00

26 lines
839 B
Nix

{ pkgs ? import <nixpkgs> {}
}:
let
utils = pkgs.callPackage ./utils.nix {};
in
with builtins;
with pkgs.lib.attrsets;
with pkgs.lib.lists;
with pkgs.lib.strings;
rec {
customPkgs = import ./all-packages.nix;
tests = pkgs.callPackage ./tests { inherit utils; };
runtests =
let
onlytests = filterAttrs (name: value: name != "override" && name != "overrideDerivation") tests;
failingtests = filterAttrs (name: value: length value > 0) onlytests;
formatFailure = failure: toString failure; # TODO: make this more pretty
formattedFailureGroups = mapAttrsToList (name: failures: "${name}:\n${concatMapStringsSep "\n" formatFailure failures}") failingtests;
in
if length formattedFailureGroups == 0 then
"no failing test"
else
concatStringsSep "\n" formattedFailureGroups;
}