nix-super/tests/substitutes.sh

23 lines
509 B
Bash
Raw Normal View History

source common.sh
2007-08-13 16:15:02 +03:00
clearStore
# Instantiate.
2007-08-13 16:15:02 +03:00
drvPath=$($nixinstantiate simple.nix)
echo "derivation is $drvPath"
# Find the output path.
2006-03-01 14:51:18 +02:00
outPath=$($nixstore -qvv "$drvPath")
echo "output path is $outPath"
2007-08-13 16:15:02 +03:00
echo $outPath > $TEST_ROOT/sub-paths
2007-08-13 16:15:02 +03:00
export NIX_SUBSTITUTERS=$(pwd)/substituter.sh
$nixstore -r "$drvPath" --dry-run 2>&1 | grep -q "1.00 MiB.*2.00 MiB"
2006-03-01 14:51:18 +02:00
$nixstore -rvv "$drvPath"
text=$(cat "$outPath"/hello)
2007-08-13 16:15:02 +03:00
if test "$text" != "Hallo Wereld"; then echo "wrong substitute output: $text"; exit 1; fi