From 7adaa6d4466063893c9ac6b5b7d71c423be34b69 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 21 Jul 2006 12:46:54 +0000 Subject: [PATCH] * Test for runtime root finding. --- tests/Makefile.am | 5 ++++- tests/common.sh.in | 10 ++++++---- tests/gc-runtime.builder.sh | 8 ++++++++ tests/gc-runtime.nix.in | 7 +++++++ tests/gc-runtime.sh | 39 +++++++++++++++++++++++++++++++++++++ 5 files changed, 64 insertions(+), 5 deletions(-) create mode 100644 tests/gc-runtime.builder.sh create mode 100644 tests/gc-runtime.nix.in create mode 100644 tests/gc-runtime.sh diff --git a/tests/Makefile.am b/tests/Makefile.am index 8a432d899..cab1f6a32 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 f96f28d20..12162649e 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 000000000..a8c2d3e09 --- /dev/null +++ b/tests/gc-runtime.builder.sh @@ -0,0 +1,8 @@ +mkdir $out + +cat > $out/program <