stdenv: add tests for inputDerivation with allowedReferences, etc.
Co-authored-by: infinisil <github@infinisil.com> !fixup every test needs a meta field? !fixup refactor inputDerivation tests !fixup fix tests
This commit is contained in:
@@ -216,6 +216,22 @@ let
|
||||
touch $out
|
||||
'';
|
||||
};
|
||||
|
||||
testInputDerivationDep = stdenv.mkDerivation {
|
||||
name = "test-input-derivation-dependency";
|
||||
buildCommand = "touch $out";
|
||||
};
|
||||
testInputDerivation =
|
||||
attrs:
|
||||
(stdenv.mkDerivation (
|
||||
attrs
|
||||
// {
|
||||
buildInputs = [ testInputDerivationDep ];
|
||||
}
|
||||
)).inputDerivation
|
||||
// {
|
||||
meta = { };
|
||||
};
|
||||
in
|
||||
|
||||
{
|
||||
@@ -356,6 +372,55 @@ in
|
||||
touch $out
|
||||
'';
|
||||
|
||||
test-inputDerivation-structured = testInputDerivation {
|
||||
name = "test-inDrv-structured";
|
||||
__structuredAttrs = true;
|
||||
};
|
||||
|
||||
test-inputDerivation-allowedReferences = testInputDerivation {
|
||||
name = "test-inDrv-allowedReferences";
|
||||
allowedReferences = [ ];
|
||||
};
|
||||
|
||||
test-inputDerivation-disallowedReferences = testInputDerivation {
|
||||
name = "test-inDrv-disallowedReferences";
|
||||
disallowedReferences = [ "${testInputDerivationDep}" ];
|
||||
};
|
||||
|
||||
test-inputDerivation-allowedRequisites = testInputDerivation {
|
||||
name = "test-inDrv-allowedRequisites";
|
||||
allowedRequisites = [ ];
|
||||
};
|
||||
|
||||
test-inputDerivation-disallowedRequisites = testInputDerivation {
|
||||
name = "test-inDrv-disallowedRequisites";
|
||||
disallowedRequisites = [ "${testInputDerivationDep}" ];
|
||||
};
|
||||
|
||||
test-inputDerivation-structured-allowedReferences = testInputDerivation {
|
||||
name = "test-inDrv-structured-allowedReferences";
|
||||
__structuredAttrs = true;
|
||||
outputChecks.out.allowedReferences = [ ];
|
||||
};
|
||||
|
||||
test-inputDerivation-structured-disallowedReferences = testInputDerivation {
|
||||
name = "test-inDrv-structured-disallowedReferences";
|
||||
__structuredAttrs = true;
|
||||
outputChecks.out.disallowedReferences = [ "${testInputDerivationDep}" ];
|
||||
};
|
||||
|
||||
test-inputDerivation-structured-allowedRequisites = testInputDerivation {
|
||||
name = "test-inDrv-structured-allowedRequisites";
|
||||
__structuredAttrs = true;
|
||||
outputChecks.out.allowedRequisites = [ ];
|
||||
};
|
||||
|
||||
test-inputDerivation-structured-disallowedRequisites = testInputDerivation {
|
||||
name = "test-inDrv-structured-disallowedRequisites";
|
||||
__structuredAttrs = true;
|
||||
outputChecks.out.disallowedRequisites = [ "${testInputDerivationDep}" ];
|
||||
};
|
||||
|
||||
test-prepend-append-to-var = testPrependAndAppendToVar {
|
||||
name = "test-prepend-append-to-var";
|
||||
stdenv' = bootStdenv;
|
||||
|
||||
Reference in New Issue
Block a user