From 1f3b0ede7d9b6292e054f8e5ecc52a83cbba1f09 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 20 Dec 2011 17:08:43 +0000 Subject: [PATCH] * Add a (currently failing) test that checks whether mutually recursive outputs are properly rejected. * Add a (also failing) test for "nix-build -A ". --- tests/multiple-outputs.nix | 11 +++++++++++ tests/multiple-outputs.sh | 11 +++++++++++ 2 files changed, 22 insertions(+) diff --git a/tests/multiple-outputs.nix b/tests/multiple-outputs.nix index a4cf0caea..7be96703d 100644 --- a/tests/multiple-outputs.nix +++ b/tests/multiple-outputs.nix @@ -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; + } diff --git a/tests/multiple-outputs.sh b/tests/multiple-outputs.sh index dadd2e25f..d4185c55b 100644 --- a/tests/multiple-outputs.sh +++ b/tests/multiple-outputs.sh @@ -5,3 +5,14 @@ echo "Testing multiple outputs..." outPath=$(nix-build multiple-outputs.nix -A b) echo "output path is $outPath" [ "$(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