1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-07 18:31:49 +02:00

* Refactoring: remove unnecessary variables from the tests.

This commit is contained in:
Eelco Dolstra 2011-10-10 21:32:34 +00:00
parent cd6d02c366
commit 8af7d766f0
33 changed files with 220 additions and 235 deletions

View file

@ -2,36 +2,36 @@ source common.sh
clearStore
drvPath=$($nixinstantiate dependencies.nix)
drvPath=$(nix-instantiate dependencies.nix)
echo "derivation is $drvPath"
$nixstore -q --tree "$drvPath" | grep ' +---.*builder1.sh'
nix-store -q --tree "$drvPath" | grep ' +---.*builder1.sh'
# Test Graphviz graph generation.
$nixstore -q --graph "$drvPath" > $TEST_ROOT/graph
nix-store -q --graph "$drvPath" > $TEST_ROOT/graph
if test -n "$dot"; then
# Does it parse?
$dot < $TEST_ROOT/graph
fi
outPath=$($nixstore -rvv "$drvPath") || fail "build failed"
outPath=$(nix-store -rvv "$drvPath") || fail "build failed"
# Test Graphviz graph generation.
$nixstore -q --graph "$outPath" > $TEST_ROOT/graph
nix-store -q --graph "$outPath" > $TEST_ROOT/graph
if test -n "$dot"; then
# Does it parse?
$dot < $TEST_ROOT/graph
fi
$nixstore -q --tree "$outPath" | grep '+---.*dependencies-input-2'
nix-store -q --tree "$outPath" | grep '+---.*dependencies-input-2'
echo "output path is $outPath"
text=$(cat "$outPath"/foobar)
if test "$text" != "FOOBAR"; then exit 1; fi
deps=$($nixstore -quR "$drvPath")
deps=$(nix-store -quR "$drvPath")
echo "output closure contains $deps"
@ -45,8 +45,8 @@ if echo "$deps" | grep -q "dependencies-input-1"; then exit 1; fi
input2OutPath=$(echo "$deps" | grep "dependencies-input-2")
# The referrers closure of input-2 should include outPath.
$nixstore -q --referrers-closure "$input2OutPath" | grep "$outPath"
nix-store -q --referrers-closure "$input2OutPath" | grep "$outPath"
# Check that the derivers are set properly.
test $($nixstore -q --deriver "$outPath") = "$drvPath"
$nixstore -q --deriver "$input2OutPath" | grep -q -- "-input-2.drv"
test $(nix-store -q --deriver "$outPath") = "$drvPath"
nix-store -q --deriver "$input2OutPath" | grep -q -- "-input-2.drv"