From 4be5a2c096083234e62117ce6016c4c9aa573aff Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 21 Dec 2011 14:42:06 +0000 Subject: [PATCH] * Add a test for unsafeDiscardOutputDependency. Not really related to multiple outputs, but good to have anyway. --- tests/multiple-outputs.nix | 10 ++++++++++ tests/multiple-outputs.sh | 6 ++++++ 2 files changed, 16 insertions(+) diff --git a/tests/multiple-outputs.nix b/tests/multiple-outputs.nix index 9ce1f3dcf..405999ce7 100644 --- a/tests/multiple-outputs.nix +++ b/tests/multiple-outputs.nix @@ -42,6 +42,16 @@ rec { ''; }; + d = mkDerivation { + name = "multiple-outputs-d"; + drv = builtins.unsafeDiscardOutputDependency b.drvPath; + builder = builtins.toFile "builder.sh" + '' + mkdir $out + echo $drv > $out/drv + ''; + }; + cyclic = (mkDerivation { name = "cyclic-outputs"; outputs = [ "a" "b" ]; diff --git a/tests/multiple-outputs.sh b/tests/multiple-outputs.sh index aa328fdbc..e95c6b404 100644 --- a/tests/multiple-outputs.sh +++ b/tests/multiple-outputs.sh @@ -14,6 +14,12 @@ drvPath2=$(nix-instantiate multiple-outputs.nix -A c) grep -q 'multiple-outputs-a.drv",\["first","second"\]' $drvPath grep -q 'multiple-outputs-b.drv",\["out"\]' $drvPath +# While we're at it, test the ‘unsafeDiscardOutputDependency’ primop. +outPath=$(nix-build multiple-outputs.nix -A d) +drvPath=$(cat $outPath/drv) +outPath=$(nix-store -q $drvPath) +! [ -e "$outPath" ] + # Do a build of something that depends on a derivation with multiple # outputs. echo "building b..."