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

@ -7,16 +7,16 @@ set +e
opts="--option build-cache-failure true --print-build-trace"
# This build should fail, and the failure should be cached.
log=$($nixbuild $opts negative-caching.nix -A fail 2>&1) && fail "should fail"
log=$(nix-build $opts negative-caching.nix -A fail 2>&1) && fail "should fail"
echo "$log" | grep -q "@ build-failed" || fail "no build-failed trace"
# Do it again. The build shouldn't be tried again.
log=$($nixbuild $opts negative-caching.nix -A fail 2>&1) && fail "should fail"
log=$(nix-build $opts negative-caching.nix -A fail 2>&1) && fail "should fail"
echo "$log" | grep -q "FAIL" && fail "failed build not cached"
echo "$log" | grep -q "@ build-failed .* cached" || fail "trace doesn't say cached"
# Check that --keep-going works properly with cached failures.
log=$($nixbuild $opts --keep-going negative-caching.nix -A depOnFail 2>&1) && fail "should fail"
log=$(nix-build $opts --keep-going negative-caching.nix -A depOnFail 2>&1) && fail "should fail"
echo "$log" | grep -q "FAIL" && fail "failed build not cached (2)"
echo "$log" | grep -q "@ build-failed .* cached" || fail "trace doesn't say cached (2)"
echo "$log" | grep -q "@ build-succeeded .*-succeed" || fail "didn't keep going"