diff --git a/tests/Makefile.am b/tests/Makefile.am index 8a432d89..cab1f6a3 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -13,11 +13,13 @@ fallback.sh: fallback.nix gc-concurrent.sh: gc-concurrent.nix gc-concurrent2.nix user-envs.sh: user-envs.nix fixed.sh: fixed.nix +gc-runtime.sh: gc-runtime.nix TESTS = init.sh hash.sh lang.sh add.sh simple.sh dependencies.sh \ locking.sh parallel.sh build-hook.sh substitutes.sh substitutes2.sh \ fallback.sh nix-push.sh gc.sh gc-concurrent.sh verify.sh nix-pull.sh \ - referrers.sh user-envs.sh logging.sh nix-build.sh misc.sh fixed.sh + referrers.sh user-envs.sh logging.sh nix-build.sh misc.sh fixed.sh \ + gc-runtime.sh XFAIL_TESTS = @@ -39,5 +41,6 @@ EXTRA_DIST = $(TESTS) \ fallback.nix.in \ user-envs.nix.in user-envs.builder.sh \ fixed.nix.in fixed.builder1.sh fixed.builder2.sh \ + gc-runtime.nix.in gc-runtime.builder.sh \ $(wildcard lang/*.nix) $(wildcard lang/*.exp) \ common.sh.in diff --git a/tests/common.sh.in b/tests/common.sh.in index f96f28d2..12162649 100644 --- a/tests/common.sh.in +++ b/tests/common.sh.in @@ -1,10 +1,12 @@ set -e -# Maybe the build directory is symlinked. -export NIX_IGNORE_SYMLINK_STORE=1 - export TEST_ROOT=$(pwd)/test-tmp -export NIX_STORE_DIR=$TEST_ROOT/store +export NIX_STORE_DIR +if ! NIX_STORE_DIR=$(readlink -f $TEST_ROOT/store); then + # Maybe the build directory is symlinked. + export NIX_IGNORE_SYMLINK_STORE=1 + NIX_STORE_DIR=$TEST_ROOT/store +fi export NIX_DATA_DIR=$TEST_ROOT/data export NIX_LOCALSTATE_DIR=$TEST_ROOT/var export NIX_LOG_DIR=$TEST_ROOT/var/log/nix diff --git a/tests/gc-runtime.builder.sh b/tests/gc-runtime.builder.sh new file mode 100644 index 00000000..a8c2d3e0 --- /dev/null +++ b/tests/gc-runtime.builder.sh @@ -0,0 +1,8 @@ +mkdir $out + +cat > $out/program <