* Add a test to check that when we cannot realise a closure

expression, we should invalidate it and go back to the derivation
  for which it is a successor.
This commit is contained in:
Eelco Dolstra 2004-06-24 14:35:01 +00:00
parent ec32627621
commit a29c8ac51c
3 changed files with 26 additions and 3 deletions

View file

@ -19,9 +19,11 @@ parallel.sh: parallel.nix
build-hook.sh: build-hook.nix
substitutes.sh: substitutes.nix substituter.nix
substitutes2.sh: substitutes2.nix substituter.nix substituter2.nix
fall-back.sh: fall-back.nix
TESTS = init.sh simple.sh dependencies.sh locking.sh parallel.sh \
build-hook.sh substitutes.sh substitutes2.sh
#TESTS = init.sh simple.sh dependencies.sh locking.sh parallel.sh \
# build-hook.sh substitutes.sh substitutes2.sh
TESTS = init.sh fall-back.sh
XFAIL_TESTS =
@ -34,4 +36,5 @@ EXTRA_DIST = $(TESTS) \
parallel.nix.in parallel.builder.sh \
build-hook.nix.in build-hook.hook.sh \
substitutes.nix.in substituter.nix.in substituter.builder.sh \
substitutes2.nix.in substituter2.nix.in substituter2.builder.sh
substitutes2.nix.in substituter2.nix.in substituter2.builder.sh \
fall-back.nix.in

6
tests/fall-back.nix.in Normal file
View file

@ -0,0 +1,6 @@
derivation {
name = "fall-back";
system = "@system@";
builder = "@shell@";
args = ["-e" "-x" ./simple.builder.sh];
}

14
tests/fall-back.sh Normal file
View file

@ -0,0 +1,14 @@
storeExpr=$($TOP/src/nix-instantiate/nix-instantiate fall-back.nix)
echo "store expr is $storeExpr"
# Register a non-existant successor.
suc=$NIX_STORE_DIR/deadbeafdeadbeafdeadbeafdeadbeaf-s.store
$TOP/src/nix-store/nix-store --successor $storeExpr $suc
outPath=$($TOP/src/nix-store/nix-store -qnfvvvvv "$storeExpr")
echo "output path is $outPath"
text=$(cat "$outPath"/hello)
if test "$text" != "Hello World!"; then exit 1; fi