about summary refs log tree commit diff
path: root/tests/multiple-outputs.sh
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2011-12-21T13·47+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2011-12-21T13·47+0000
commit179409b9112ee9d9f858a124e0b109a46fe835c9 (patch)
treeb7ff9b07510defc768d7fce77a4263918bd4630f /tests/multiple-outputs.sh
parentedd9359bebe012ae40e9e1538dab8f91e2d58d3e (diff)
* Add a test for referring to another derivation's ‘drvPath’. This
  currently fails in read-only mode.

Diffstat (limited to 'tests/multiple-outputs.sh')
-rw-r--r--tests/multiple-outputs.sh20
1 files changed, 19 insertions, 1 deletions
diff --git a/tests/multiple-outputs.sh b/tests/multiple-outputs.sh
index 8a7ae22364c4..aa328fdbc689 100644
--- a/tests/multiple-outputs.sh
+++ b/tests/multiple-outputs.sh
@@ -1,18 +1,36 @@
 source common.sh
 
-echo "Testing multiple outputs..."
+clearStore
 
+# Test whether read-only evaluation works when referring to the
+# ‘drvPath’ attribute.
+echo "evaluating c..."
+drvPath=$(nix-instantiate multiple-outputs.nix -A c --readonly-mode)
+
+# And check whether the resulting derivation explicitly depends on all
+# outputs.
+drvPath2=$(nix-instantiate multiple-outputs.nix -A c)
+[ "$drvPath" = "$drvPath2" ]
+grep -q 'multiple-outputs-a.drv",\["first","second"\]' $drvPath
+grep -q 'multiple-outputs-b.drv",\["out"\]' $drvPath
+
+# Do a build of something that depends on a derivation with multiple
+# outputs.
+echo "building b..."
 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.
+echo "building a.first..."
 nix-build multiple-outputs.nix -A a.first
 
 # Cyclic outputs should be rejected.
+echo "building cyclic..."
 if nix-build multiple-outputs.nix -A cyclic; then
     echo "Cyclic outputs incorrectly accepted!"
     exit 1
 fi
 
+echo "collecting garbage..."
 nix-store --gc