guix/tests/substitutes.sh

23 lines
509 B
Bash
Raw Normal View History

source common.sh
2007-08-13 13:15:02 +00:00
clearStore
# Instantiate.
drvPath=$(nix-instantiate simple.nix)
echo "derivation is $drvPath"
# Find the output path.
outPath=$(nix-store -qvv "$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
export NIX_SUBSTITUTERS=$(pwd)/substituter.sh
nix-store -r "$drvPath" --dry-run 2>&1 | grep -q "1.00 MiB.*2.00 MiB"
nix-store -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