nix/tests/substitutes2.sh

22 lines
529 B
Bash
Raw Normal View History

source common.sh
2007-08-13 13:15:02 +00:00
clearStore
# Instantiate.
2007-08-13 13:15:02 +00:00
drvPath=$($nixinstantiate simple.nix)
echo "derivation is $drvPath"
# Find the output path.
2006-03-01 12:51:18 +00:00
outPath=$($nixstore -qvvvvv "$drvPath")
echo "output path is $outPath"
2007-08-13 13:15:02 +00:00
echo $outPath > $TEST_ROOT/sub-paths
2007-08-13 13:15:02 +00:00
# First try a substituter that fails, then one that succeeds
export NIX_SUBSTITUTERS=$(pwd)/substituter2.sh:$(pwd)/substituter.sh
$nixstore -j0 -rvv "$drvPath"
text=$(cat "$outPath"/hello)
2007-08-13 13:15:02 +00:00
if test "$text" != "Hallo Wereld"; then echo "wrong substitute output: $text"; exit 1; fi