3
0
Fork 0
forked from mirrors/nixpkgs

Revert "Add packageTests"

This reverts commit 87b3740d66.

packageTests wasn't inherently wrong, but I am not fully convinced
that it is necessary. Specifically, it would only be used by:

 - `nix-build`, which is going to be a legacy command in the mid term
 - ofborg, perhaps, not even implemented

whereas the following use cases do not need it:

 - `nix build` (experimental command with a future, unlike `nix-build`)
 - `release.nix` (Hydra), might use similar logic but not reuse this

Further, considering that this is only necessary for tests of
functions, I am hesitant to introduce it.
Meanwhile, it should not hinder the rest of the PR.
This commit is contained in:
Robert Hensing 2021-09-21 14:24:40 +02:00
parent ac78ae80a4
commit 8651143b79

View file

@ -119,24 +119,6 @@ with pkgs;
callTest = t: t.test;
};
### Traversal for package tests
# Whereas most tests can be run with `nix-build -A my-package.tests`, this
# does not work for tests on a __functor attrset.
# TODO: enable these on hydra.nixos.org?
packageTests = let
getTests = attrs:
if builtins.typeOf attrs != "set"
then {}
else if lib.isDerivation attrs
then lib.recurseIntoAttrs attrs.tests or {}
else if attrs?__functor
then lib.recurseIntoAttrs attrs.tests or {}
else lib.mapAttrs (k: if k == "recurseForDerivations" then v: v else getTests) attrs;
in
getTests pkgs;
### BUILD SUPPORT
auditBlasHook = makeSetupHook