about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--tests/build-hook.sh2
-rw-r--r--tests/export-graph.sh8
-rw-r--r--tests/export.sh2
-rw-r--r--tests/fetchurl.sh2
-rw-r--r--tests/fixed.sh10
-rw-r--r--tests/import-derivation.sh2
-rw-r--r--tests/logging.sh2
-rw-r--r--tests/multiple-outputs.nix9
-rw-r--r--tests/negative-caching.sh6
-rw-r--r--tests/nix-build.sh2
-rw-r--r--tests/parallel.sh2
-rw-r--r--tests/secure-drv-outputs.sh2
12 files changed, 25 insertions, 24 deletions
diff --git a/tests/build-hook.sh b/tests/build-hook.sh
index c733b2680408..681f65cc3b6c 100644
--- a/tests/build-hook.sh
+++ b/tests/build-hook.sh
@@ -2,7 +2,7 @@ source common.sh
 
 export NIX_BUILD_HOOK="build-hook.hook.sh"
 
-outPath=$(nix-build build-hook.nix)
+outPath=$(nix-build build-hook.nix --no-out-link)
 
 echo "output path is $outPath"
 
diff --git a/tests/export-graph.sh b/tests/export-graph.sh
index 7adbefd120ce..7f6f83d87c3b 100644
--- a/tests/export-graph.sh
+++ b/tests/export-graph.sh
@@ -4,14 +4,14 @@ clearStore
 clearProfiles
 
 checkRef() {
-    nix-store -q --references ./result | grep -q "$1" || fail "missing reference $1"
+    nix-store -q --references $TEST_ROOT/result | grep -q "$1" || fail "missing reference $1"
 }
 
 # Test the export of the runtime dependency graph.
 
-outPath=$(nix-build ./export-graph.nix -A runtimeGraph)
+outPath=$(nix-build ./export-graph.nix -A runtimeGraph -o $TEST_ROOT/result)
 
-test $(nix-store -q --references ./result | wc -l) = 2 || fail "bad nr of references"
+test $(nix-store -q --references $TEST_ROOT/result | wc -l) = 2 || fail "bad nr of references"
 
 checkRef input-2
 for i in $(cat $outPath); do checkRef $i; done
@@ -20,7 +20,7 @@ for i in $(cat $outPath); do checkRef $i; done
 
 nix-store --gc # should force rebuild of input-1
 
-outPath=$(nix-build ./export-graph.nix -A buildGraph)
+outPath=$(nix-build ./export-graph.nix -A buildGraph -o $TEST_ROOT/result)
 
 checkRef input-1
 checkRef input-1.drv
diff --git a/tests/export.sh b/tests/export.sh
index 136819742071..ec7560f19728 100644
--- a/tests/export.sh
+++ b/tests/export.sh
@@ -2,7 +2,7 @@ source common.sh
 
 clearStore
 
-outPath=$(nix-build dependencies.nix)
+outPath=$(nix-build dependencies.nix --no-out-link)
 
 nix-store --export $outPath > $TEST_ROOT/exp
 
diff --git a/tests/fetchurl.sh b/tests/fetchurl.sh
index bb6180ca3954..6acc87eafca8 100644
--- a/tests/fetchurl.sh
+++ b/tests/fetchurl.sh
@@ -4,6 +4,6 @@ clearStore
 
 hash=$(nix-hash --flat --type sha256 ./fetchurl.nix)
 
-outPath=$(nix-build ./fetchurl.nix --argstr filename $(pwd)/fetchurl.nix --argstr sha256 $hash)
+outPath=$(nix-build ./fetchurl.nix --argstr filename $(pwd)/fetchurl.nix --argstr sha256 $hash --no-out-link)
 
 cmp $outPath fetchurl.nix
diff --git a/tests/fixed.sh b/tests/fixed.sh
index 164791564b9a..ed0d06dd29cb 100644
--- a/tests/fixed.sh
+++ b/tests/fixed.sh
@@ -6,13 +6,13 @@ export IMPURE_VAR1=foo
 export IMPURE_VAR2=bar
 
 echo 'testing good...'
-nix-build fixed.nix -A good
+nix-build fixed.nix -A good --no-out-link
 
 echo 'testing good2...'
-nix-build fixed.nix -A good2
+nix-build fixed.nix -A good2 --no-out-link
 
 echo 'testing bad...'
-nix-build fixed.nix -A bad && fail "should fail"
+nix-build fixed.nix -A bad --no-out-link && fail "should fail"
 
 echo 'testing reallyBad...'
 nix-instantiate fixed.nix -A reallyBad && fail "should fail"
@@ -25,12 +25,12 @@ test $(nix-instantiate fixed.nix -A good.1 | wc -l) = 1
 # Only one should run at the same time.
 echo 'testing parallelSame...'
 clearStore
-nix-build fixed.nix -A parallelSame -j2
+nix-build fixed.nix -A parallelSame --no-out-link -j2
 
 # Fixed-output derivations with a recursive SHA-256 hash should
 # produce the same path as "nix-store --add".
 echo 'testing sameAsAdd...'
-out=$(nix-build fixed.nix -A sameAsAdd)
+out=$(nix-build fixed.nix -A sameAsAdd --no-out-link)
 
 # This is what fixed.builder2 produces...
 rm -rf $TEST_ROOT/fixed
diff --git a/tests/import-derivation.sh b/tests/import-derivation.sh
index 93a53a830af8..98d61ef49b9c 100644
--- a/tests/import-derivation.sh
+++ b/tests/import-derivation.sh
@@ -7,6 +7,6 @@ if nix-instantiate --readonly-mode ./import-derivation.nix; then
     exit 1
 fi
 
-outPath=$(nix-build ./import-derivation.nix)
+outPath=$(nix-build ./import-derivation.nix --no-out-link)
 
 [ "$(cat $outPath)" = FOO579 ]
diff --git a/tests/logging.sh b/tests/logging.sh
index 2879354cb24d..117d483716a6 100644
--- a/tests/logging.sh
+++ b/tests/logging.sh
@@ -4,7 +4,7 @@ clearStore
 
 # Produce an escaped log file.
 set -x
-nix-build --log-type escapes -vv dependencies.nix 2> $TEST_ROOT/log.esc
+nix-build --log-type escapes -vv dependencies.nix --no-out-link 2> $TEST_ROOT/log.esc
 
 # Convert it to an XML representation.
 nix-log2xml < $TEST_ROOT/log.esc > $TEST_ROOT/log.xml
diff --git a/tests/multiple-outputs.nix b/tests/multiple-outputs.nix
index 6add7dd6f997..4a9010d1868e 100644
--- a/tests/multiple-outputs.nix
+++ b/tests/multiple-outputs.nix
@@ -9,8 +9,9 @@ rec {
       ''
         mkdir $first $second
         test -z $all
-        echo "second" > $first/file
-        echo "first" > $second/file
+        echo "first" > $first/file
+        echo "second" > $second/file
+        ln -s $first $second/link
       '';
     helloString = "Hello, world!";
   };
@@ -26,8 +27,8 @@ rec {
         mkdir $out
         test "$firstOutput $secondOutput" = "$allOutputs"
         test "$defaultOutput" = "$firstOutput"
-        test "$(cat $firstOutput/file)" = "second"
-        test "$(cat $secondOutput/file)" = "first"
+        test "$(cat $firstOutput/file)" = "first"
+        test "$(cat $secondOutput/file)" = "second"
         echo "success" > $out/file
       '';
   };
diff --git a/tests/negative-caching.sh b/tests/negative-caching.sh
index 7cbab00e4f9b..4217bc38e121 100644
--- a/tests/negative-caching.sh
+++ b/tests/negative-caching.sh
@@ -7,16 +7,16 @@ set +e
 opts="--option build-cache-failure true --print-build-trace"
 
 # This build should fail, and the failure should be cached.
-log=$(nix-build $opts negative-caching.nix -A fail 2>&1) && fail "should fail"
+log=$(nix-build $opts negative-caching.nix -A fail --no-out-link 2>&1) && fail "should fail"
 echo "$log" | grep -q "@ build-failed" || fail "no build-failed trace"
 
 # Do it again.  The build shouldn't be tried again.
-log=$(nix-build $opts negative-caching.nix -A fail 2>&1) && fail "should fail"
+log=$(nix-build $opts negative-caching.nix -A fail --no-out-link 2>&1) && fail "should fail"
 echo "$log" | grep -q "FAIL" && fail "failed build not cached"
 echo "$log" | grep -q "@ build-failed .* cached" || fail "trace doesn't say cached"
 
 # Check that --keep-going works properly with cached failures.
-log=$(nix-build $opts --keep-going negative-caching.nix -A depOnFail 2>&1) && fail "should fail"
+log=$(nix-build $opts --keep-going negative-caching.nix -A depOnFail --no-out-link 2>&1) && fail "should fail"
 echo "$log" | grep -q "FAIL" && fail "failed build not cached (2)"
 echo "$log" | grep -q "@ build-failed .* cached" || fail "trace doesn't say cached (2)"
 echo "$log" | grep -q "@ build-succeeded .*-succeed" || fail "didn't keep going"
diff --git a/tests/nix-build.sh b/tests/nix-build.sh
index d575e9aae9f0..dc0e99c73621 100644
--- a/tests/nix-build.sh
+++ b/tests/nix-build.sh
@@ -2,7 +2,7 @@ source common.sh
 
 clearStore
 
-(cd $TEST_ROOT && nix-build ../dependencies.nix)
+nix-build dependencies.nix -o $TEST_ROOT/result
 test "$(cat $TEST_ROOT/result/foobar)" = FOOBAR
 
 # The result should be retained by a GC.
diff --git a/tests/parallel.sh b/tests/parallel.sh
index 13349e875f11..9b150263a59d 100644
--- a/tests/parallel.sh
+++ b/tests/parallel.sh
@@ -8,7 +8,7 @@ clearStore
 
 rm -f $SHARED.cur $SHARED.max
 
-outPath=$(nix-build -j10000 parallel.nix)
+outPath=$(nix-build -j10000 parallel.nix --no-out-link)
 
 echo "output path is $outPath"
 
diff --git a/tests/secure-drv-outputs.sh b/tests/secure-drv-outputs.sh
index 3cb889996763..4888123da910 100644
--- a/tests/secure-drv-outputs.sh
+++ b/tests/secure-drv-outputs.sh
@@ -28,7 +28,7 @@ if badDrv2=$(nix-store --add $TEST_ROOT/bad.drv); then
 fi
 
 # Now build the good derivation.
-goodOut2=$(nix-build ./secure-drv-outputs.nix -A good)
+goodOut2=$(nix-build ./secure-drv-outputs.nix -A good --no-out-link)
 test "$goodOut" = "$goodOut2"
 
 if ! test -e "$goodOut"/good; then