From e5c16c95829f4f14763ba1f66f6e26f5f1792b29 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 27 Jan 2005 17:48:50 +0000 Subject: * Add missing substitutes files to dist. * Add a garbage collector test. --- tests/gc.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 tests/gc.sh (limited to 'tests/gc.sh') diff --git a/tests/gc.sh b/tests/gc.sh new file mode 100644 index 000000000..9aeda43e7 --- /dev/null +++ b/tests/gc.sh @@ -0,0 +1,14 @@ +storeExpr=$($TOP/src/nix-instantiate/nix-instantiate dependencies.nix) +outPath=$($TOP/src/nix-store/nix-store -rvv "$storeExpr") + +# Set a GC root. +ln -s $outPath "$NIX_LOCALSTATE_DIR"/nix/gcroots/foo + +$NIX_BIN_DIR/nix-collect-garbage + +# Check that the root and its dependencies haven't been deleted. +cat $outPath/foobar +cat $outPath/input-2/bar + +# Check that the derivation has been GC'd. +if cat $storeExpr > /dev/null; then false; fi -- cgit v1.2.3