about summary refs log tree commit diff
path: root/tests/substitutes2.sh
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2007-08-13T13·15+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2007-08-13T13·15+0000
commit550ba9ebb4b1b2415c9930879cfa6937f7fa916a (patch)
tree3c15b0a01c59be162a17bb003d09fbd80ba01aa1 /tests/substitutes2.sh
parent3757ee589f46a401fdacaa2126e6bf4902eee23d (diff)
* Fix the tests.
Diffstat (limited to 'tests/substitutes2.sh')
-rw-r--r--tests/substitutes2.sh18
1 files changed, 7 insertions, 11 deletions
diff --git a/tests/substitutes2.sh b/tests/substitutes2.sh
index 416e815360c2..0bbc13913dac 100644
--- a/tests/substitutes2.sh
+++ b/tests/substitutes2.sh
@@ -1,25 +1,21 @@
 source common.sh
 
+clearStore
+
 # Instantiate.
-drvPath=$($nixinstantiate substitutes2.nix)
+drvPath=$($nixinstantiate simple.nix)
 echo "derivation is $drvPath"
 
 # Find the output path.
 outPath=$($nixstore -qvvvvv "$drvPath")
 echo "output path is $outPath"
 
-regSub() {
-    (echo $1 && echo "" && echo $2 && echo 3 && echo $outPath && echo Hallo && echo Wereld && echo 0) | $nixstore --register-substitutes
-}
-
-# Register a substitute for the output path.
-regSub $outPath $(pwd)/substituter.sh
+echo $outPath > $TEST_ROOT/sub-paths
 
-# Register another substitute for the output path.  This one takes
-# precedence over the previous one.  It will fail.
-regSub $outPath $(pwd)/substituter2.sh
+# First try a substituter that fails, then one that succeeds
+export NIX_SUBSTITUTERS=$(pwd)/substituter2.sh:$(pwd)/substituter.sh
 
 $nixstore -rvv "$drvPath"
 
 text=$(cat "$outPath"/hello)
-if test "$text" != "Hallo Wereld"; then exit 1; fi
+if test "$text" != "Hallo Wereld"; then echo "wrong substitute output: $text"; exit 1; fi