* Add a (currently failing) test that checks whether mutually
recursive outputs are properly rejected. * Add a (also failing) test for "nix-build -A <output-name>".
This commit is contained in:
parent
46e42c92c1
commit
1f3b0ede7d
2 changed files with 22 additions and 0 deletions
|
@ -32,4 +32,15 @@ rec {
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
cyclic = (mkDerivation {
|
||||||
|
name = "cyclic-outputs";
|
||||||
|
outputs = [ "a" "b" ];
|
||||||
|
builder = builtins.toFile "builder.sh"
|
||||||
|
''
|
||||||
|
mkdir $a $b
|
||||||
|
echo $a > $b/foo
|
||||||
|
echo $b > $a/bar
|
||||||
|
'';
|
||||||
|
}).a;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,3 +5,14 @@ echo "Testing multiple outputs..."
|
||||||
outPath=$(nix-build multiple-outputs.nix -A b)
|
outPath=$(nix-build multiple-outputs.nix -A b)
|
||||||
echo "output path is $outPath"
|
echo "output path is $outPath"
|
||||||
[ "$(cat "$outPath"/file)" = "success" ]
|
[ "$(cat "$outPath"/file)" = "success" ]
|
||||||
|
|
||||||
|
# Make sure that nix-build works on derivations with multiple outputs.
|
||||||
|
nix-build multiple-outputs.nix -A a.first
|
||||||
|
|
||||||
|
# Cyclic outputs should be rejected.
|
||||||
|
if nix-build multiple-outputs.nix -A cyclic; then
|
||||||
|
echo "Cyclic outputs incorrectly accepted!"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
clearStore
|
||||||
|
|
Loading…
Reference in a new issue