diff options
Diffstat (limited to 'tests/nix-build.sh')
-rw-r--r-- | tests/nix-build.sh | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/nix-build.sh b/tests/nix-build.sh new file mode 100644 index 000000000000..23f8ce99875f --- /dev/null +++ b/tests/nix-build.sh @@ -0,0 +1,17 @@ +source common.sh + +$nixstore --gc + +(cd $TEST_ROOT && $NIX_BIN_DIR/nix-build ../dependencies.nix) +test "$(cat $TEST_ROOT/result/foobar)" = FOOBAR + +# The result should be retained by a GC. +target=$(ls -l $TEST_ROOT/result | sed 's/.*->\ //') +echo target is $target +$nixstore --gc +test -e $target/foobar + +# But now it should be gone. +rm $TEST_ROOT/result +$nixstore --gc +if test -e $target/foobar; then false; fi |