nixos/testing: allow setting test-wide warnings and assertions
This allows us to e.g. use `mkRemovedOptionModule` which will come in handy in the upcoming commits.
This commit is contained in:
@@ -80,6 +80,10 @@ in
|
||||
};
|
||||
};
|
||||
|
||||
imports = [
|
||||
../../modules/misc/assertions.nix
|
||||
];
|
||||
|
||||
config = {
|
||||
rawTestDerivation = hostPkgs.stdenv.mkDerivation config.rawTestDerivationArg;
|
||||
rawTestDerivationArg =
|
||||
@@ -131,7 +135,7 @@ in
|
||||
};
|
||||
test = lib.lazyDerivation {
|
||||
# lazyDerivation improves performance when only passthru items and/or meta are used.
|
||||
derivation = config.rawTestDerivation;
|
||||
derivation = lib.asserts.checkAssertWarn config.assertions config.warnings config.rawTestDerivation;
|
||||
inherit (config) passthru meta;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user