* Add a test for unsafeDiscardOutputDependency. Not really related to

multiple outputs, but good to have anyway.
This commit is contained in:
Eelco Dolstra 2011-12-21 14:42:06 +00:00
parent 179409b911
commit 4be5a2c096
2 changed files with 16 additions and 0 deletions

View file

@ -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" ];

View file

@ -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..."