about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/common.sh.in2
-rw-r--r--tests/gc-runtime.sh2
-rw-r--r--tests/simple.sh2
-rw-r--r--tests/tarball.sh6
4 files changed, 6 insertions, 6 deletions
diff --git a/tests/common.sh.in b/tests/common.sh.in
index 316d5f6896bb..4565a490adfd 100644
--- a/tests/common.sh.in
+++ b/tests/common.sh.in
@@ -2,7 +2,7 @@ set -e
 
 datadir="@datadir@"
 
-export TEST_ROOT=${TMPDIR:-/tmp}/nix-test
+export TEST_ROOT=$(realpath ${TMPDIR:-/tmp}/nix-test)
 export NIX_STORE_DIR
 if ! NIX_STORE_DIR=$(readlink -f $TEST_ROOT/store 2> /dev/null); then
     # Maybe the build directory is symlinked.
diff --git a/tests/gc-runtime.sh b/tests/gc-runtime.sh
index a44195756f52..4c5028005c57 100644
--- a/tests/gc-runtime.sh
+++ b/tests/gc-runtime.sh
@@ -10,7 +10,7 @@ esac
 set -m # enable job control, needed for kill
 
 profiles="$NIX_STATE_DIR"/profiles
-rm -f $profiles/*
+rm -rf $profiles
 
 nix-env -p $profiles/test -f ./gc-runtime.nix -i gc-runtime
 
diff --git a/tests/simple.sh b/tests/simple.sh
index 8f9d782a6c81..37631b648c67 100644
--- a/tests/simple.sh
+++ b/tests/simple.sh
@@ -18,7 +18,7 @@ if test "$text" != "Hello World!"; then exit 1; fi
 nix-store --delete $outPath
 if test -e $outPath/hello; then false; fi
 
-outPath="$(NIX_REMOTE=local?store=/foo\&real=$TMPDIR/real-store nix-instantiate --readonly-mode hash-check.nix)"
+outPath="$(NIX_REMOTE=local?store=/foo\&real=$TEST_ROOT/real-store nix-instantiate --readonly-mode hash-check.nix)"
 if test "$outPath" != "/foo/lfy1s6ca46rm5r6w4gg9hc0axiakjcnm-dependencies.drv"; then
     echo "hashDerivationModulo appears broken, got $outPath"
     exit 1
diff --git a/tests/tarball.sh b/tests/tarball.sh
index 329e73b91696..ba534c6261ad 100644
--- a/tests/tarball.sh
+++ b/tests/tarball.sh
@@ -15,11 +15,11 @@ tarball=$TEST_ROOT/tarball.tar.xz
 
 nix-env -f file://$tarball -qa --out-path | grep -q dependencies
 
-nix-build -o $TMPDIR/result file://$tarball
+nix-build -o $TEST_ROOT/result file://$tarball
 
-nix-build -o $TMPDIR/result '<foo>' -I foo=file://$tarball
+nix-build -o $TEST_ROOT/result '<foo>' -I foo=file://$tarball
 
-nix-build -o $TMPDIR/result -E "import (fetchTarball file://$tarball)"
+nix-build -o $TEST_ROOT/result -E "import (fetchTarball file://$tarball)"
 
 nix-instantiate --eval -E '1 + 2' -I fnord=file://no-such-tarball.tar.xz
 nix-instantiate --eval -E 'with <fnord/xyzzy>; 1 + 2' -I fnord=file://no-such-tarball.tar.xz