about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2006-07-21T13·21+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2006-07-21T13·21+0000
commit9c3099d3286b7bc8582b1685ba1917db409cac0c (patch)
tree40c3bc18f1408ef70e1e5dd446460bab762c831e
parent7adaa6d4466063893c9ac6b5b7d71c423be34b69 (diff)
* Purify `make check'.
-rw-r--r--substitute.mk1
-rw-r--r--tests/build-hook.nix.in3
-rw-r--r--tests/dependencies.builder0.sh2
-rw-r--r--tests/dependencies.builder1.sh2
-rw-r--r--tests/dependencies.builder2.sh2
-rw-r--r--tests/dependencies.nix.in3
-rw-r--r--tests/dummy1
-rw-r--r--tests/fallback.nix.in3
-rw-r--r--tests/fixed.builder1.sh2
-rw-r--r--tests/fixed.builder2.sh2
-rw-r--r--tests/fixed.nix.in1
-rw-r--r--tests/gc-concurrent.builder.sh2
-rw-r--r--tests/gc-concurrent.nix.in3
-rw-r--r--tests/gc-concurrent2.builder.sh2
-rw-r--r--tests/gc-concurrent2.nix.in3
-rw-r--r--tests/gc-runtime.nix.in2
-rw-r--r--tests/hash-check.nix6
-rw-r--r--tests/locking.builder.sh2
-rw-r--r--tests/locking.nix.in1
-rw-r--r--tests/parallel.builder.sh3
-rw-r--r--tests/parallel.nix.in1
-rw-r--r--tests/simple.builder.sh2
-rw-r--r--tests/simple.nix.in3
-rw-r--r--tests/simple.sh2
-rw-r--r--tests/user-envs.builder.sh2
-rw-r--r--tests/user-envs.nix.in1
26 files changed, 28 insertions, 29 deletions
diff --git a/substitute.mk b/substitute.mk
index 18e4585d7566..5038bd4bfd9f 100644
--- a/substitute.mk
+++ b/substitute.mk
@@ -23,5 +23,6 @@
 	 -e "s^@xsltproc\@^$(xsltproc)^g" \
 	 -e "s^@aterm_bin\@^$(aterm_bin)^g" \
 	 -e "s^@version\@^$(VERSION)^g" \
+	 -e "s^@testPath\@^$(coreutils):$$(dirname $$(type -P expr))^g" \
 	 < $< > $@ || rm $@
 	if test -x $<; then chmod +x $@; fi
diff --git a/tests/build-hook.nix.in b/tests/build-hook.nix.in
index b38077e7f70b..697cab81e104 100644
--- a/tests/build-hook.nix.in
+++ b/tests/build-hook.nix.in
@@ -5,6 +5,7 @@ let {
     system = "@system@";
     builder = "@shell@";
     args = ["-e" "-x" ./dependencies.builder1.sh];
+    PATH = "@testPath@";
   };
 
   input2 = derivation {
@@ -12,6 +13,7 @@ let {
     system = "@system@";
     builder = "@shell@";
     args = ["-e" "-x" ./dependencies.builder2.sh];
+    PATH = "@testPath@";
   };
 
   body = derivation {
@@ -19,6 +21,7 @@ let {
     system = "@system@";
     builder = "@shell@";
     args = ["-e" "-x" ./dependencies.builder0.sh];
+    PATH = "@testPath@";
     inherit input1 input2;
   };
 
diff --git a/tests/dependencies.builder0.sh b/tests/dependencies.builder0.sh
index 69269916c605..dc0bd9a9bb00 100644
--- a/tests/dependencies.builder0.sh
+++ b/tests/dependencies.builder0.sh
@@ -1,5 +1,3 @@
-export PATH=/bin:/usr/bin:$PATH
-
 mkdir $out
 echo $(cat $input1/foo)$(cat $input2/bar) > $out/foobar
 
diff --git a/tests/dependencies.builder1.sh b/tests/dependencies.builder1.sh
index 53cd73916c36..4b006a17d70f 100644
--- a/tests/dependencies.builder1.sh
+++ b/tests/dependencies.builder1.sh
@@ -1,4 +1,2 @@
-export PATH=/bin:/usr/bin:$PATH
-
 mkdir $out
 echo FOO > $out/foo
diff --git a/tests/dependencies.builder2.sh b/tests/dependencies.builder2.sh
index baceae756ddb..4f886fdb3a1a 100644
--- a/tests/dependencies.builder2.sh
+++ b/tests/dependencies.builder2.sh
@@ -1,4 +1,2 @@
-export PATH=/bin:/usr/bin:$PATH
-
 mkdir $out
 echo BAR > $out/bar
diff --git a/tests/dependencies.nix.in b/tests/dependencies.nix.in
index aec9ec5b5f15..3e9f66ad6125 100644
--- a/tests/dependencies.nix.in
+++ b/tests/dependencies.nix.in
@@ -5,6 +5,7 @@ let {
     system = "@system@";
     builder = "@shell@";
     args = ["-e" "-x" ./dependencies.builder1.sh];
+    PATH = "@testPath@";
   };
 
   input2 = derivation {
@@ -12,6 +13,7 @@ let {
     system = "@system@";
     builder = "@shell@";
     args = ["-e" "-x" ./dependencies.builder2.sh];
+    PATH = "@testPath@";
   };
 
   body = derivation {
@@ -19,6 +21,7 @@ let {
     system = "@system@";
     builder = "@shell@";
     args = ["-e" "-x" (./dependencies.builder0.sh  + "/FOOBAR/../.")];
+    PATH = "@testPath@";
     input1 = input1 + "/.";
     inherit input2;
   };
diff --git a/tests/dummy b/tests/dummy
new file mode 100644
index 000000000000..557db03de997
--- /dev/null
+++ b/tests/dummy
@@ -0,0 +1 @@
+Hello World
diff --git a/tests/fallback.nix.in b/tests/fallback.nix.in
index 0575d6940d11..e47b59823bd0 100644
--- a/tests/fallback.nix.in
+++ b/tests/fallback.nix.in
@@ -3,4 +3,5 @@ derivation {
   system = "@system@";
   builder = "@shell@";
   args = ["-e" "-x" ./simple.builder.sh];
-}
\ No newline at end of file
+  goodPath = "@testPath@";
+}
diff --git a/tests/fixed.builder1.sh b/tests/fixed.builder1.sh
index 2213841a2d66..c792f52a5608 100644
--- a/tests/fixed.builder1.sh
+++ b/tests/fixed.builder1.sh
@@ -1,3 +1 @@
-export PATH=/bin:/usr/bin:$PATH
-
 echo "Hello World!" > $out
diff --git a/tests/fixed.builder2.sh b/tests/fixed.builder2.sh
index af94c22ac92f..bc1a18d6e1d7 100644
--- a/tests/fixed.builder2.sh
+++ b/tests/fixed.builder2.sh
@@ -1,5 +1,3 @@
-export PATH=/bin:/usr/bin:$PATH
-
 mkdir $out
 mkdir $out/bla
 echo "Hello World!" > $out/foo
diff --git a/tests/fixed.nix.in b/tests/fixed.nix.in
index 0ce9dd401931..ab2448871dbe 100644
--- a/tests/fixed.nix.in
+++ b/tests/fixed.nix.in
@@ -8,6 +8,7 @@ rec {
     outputHashMode = mode;
     outputHashAlgo = algo;
     outputHash = hash;
+    PATH = "@testPath@";
   };
 
   good = [
diff --git a/tests/gc-concurrent.builder.sh b/tests/gc-concurrent.builder.sh
index 2d327f902182..6b2177ddff2e 100644
--- a/tests/gc-concurrent.builder.sh
+++ b/tests/gc-concurrent.builder.sh
@@ -1,5 +1,3 @@
-export PATH=/bin:/usr/bin:$PATH
-
 mkdir $out
 echo $(cat $input1/foo)$(cat $input2/bar) > $out/foobar
 
diff --git a/tests/gc-concurrent.nix.in b/tests/gc-concurrent.nix.in
index 0d62849bc52f..cf9f673137da 100644
--- a/tests/gc-concurrent.nix.in
+++ b/tests/gc-concurrent.nix.in
@@ -5,6 +5,7 @@ let {
     system = "@system@";
     builder = "@shell@";
     args = ["-e" "-x" ./dependencies.builder1.sh];
+    PATH = "@testPath@";
   };
 
   input2 = derivation {
@@ -12,6 +13,7 @@ let {
     system = "@system@";
     builder = "@shell@";
     args = ["-e" "-x" ./dependencies.builder2.sh];
+    PATH = "@testPath@";
   };
 
   body = derivation {
@@ -19,6 +21,7 @@ let {
     system = "@system@";
     builder = "@shell@";
     args = ["-e" "-x" ./gc-concurrent.builder.sh];
+    PATH = "@testPath@";
     inherit input1 input2;
   };
 
diff --git a/tests/gc-concurrent2.builder.sh b/tests/gc-concurrent2.builder.sh
index d94e4697182f..f7b6094e8b44 100644
--- a/tests/gc-concurrent2.builder.sh
+++ b/tests/gc-concurrent2.builder.sh
@@ -1,5 +1,3 @@
-export PATH=/bin:/usr/bin:$PATH
-
 mkdir $out
 echo $(cat $input1/foo)$(cat $input2/bar)xyzzy > $out/foobar
 
diff --git a/tests/gc-concurrent2.nix.in b/tests/gc-concurrent2.nix.in
index e6050f1bbddb..d331e9c82d9f 100644
--- a/tests/gc-concurrent2.nix.in
+++ b/tests/gc-concurrent2.nix.in
@@ -5,6 +5,7 @@ let {
     system = "@system@";
     builder = "@shell@";
     args = ["-e" "-x" ./dependencies.builder1.sh];
+    PATH = "@testPath@";
   };
 
   input2 = derivation {
@@ -12,6 +13,7 @@ let {
     system = "@system@";
     builder = "@shell@";
     args = ["-e" "-x" ./dependencies.builder2.sh];
+    PATH = "@testPath@";
   };
 
   body = derivation {
@@ -19,6 +21,7 @@ let {
     system = "@system@";
     builder = "@shell@";
     args = ["-e" "-x" ./gc-concurrent2.builder.sh];
+    PATH = "@testPath@";
     inherit input1 input2;
   };
 
diff --git a/tests/gc-runtime.nix.in b/tests/gc-runtime.nix.in
index e54fcf2d15ad..aefffa276623 100644
--- a/tests/gc-runtime.nix.in
+++ b/tests/gc-runtime.nix.in
@@ -3,5 +3,5 @@ derivation {
   system = "@system@";
   builder = "@shell@";
   args = ["-e" "-x" ./gc-runtime.builder.sh];
-  PATH = "@coreutils@";
+  PATH = "@testPath@";
 }
diff --git a/tests/hash-check.nix b/tests/hash-check.nix
index bbe4fe24791f..4a8e9b8a8df9 100644
--- a/tests/hash-check.nix
+++ b/tests/hash-check.nix
@@ -4,14 +4,14 @@ let {
     name = "dependencies-input-1";
     system = "i086-msdos";
     builder = "/bar/sh";
-    args = ["-e" "-x" ./dependencies.builder1.sh];
+    args = ["-e" "-x" ./dummy];
   };
 
   input2 = derivation {
     name = "dependencies-input-2";
     system = "i086-msdos";
     builder = "/bar/sh";
-    args = ["-e" "-x" ./dependencies.builder2.sh];
+    args = ["-e" "-x" ./dummy];
     outputHashMode = "recursive";
     outputHashAlgo = "md5";
     outputHash = "ffffffffffffffffffffffffffffffff";
@@ -21,7 +21,7 @@ let {
     name = "dependencies";
     system = "i086-msdos";
     builder = "/bar/sh";
-    args = ["-e" "-x" (./dependencies.builder0.sh  + "/FOOBAR/../.")];
+    args = ["-e" "-x" (./dummy  + "/FOOBAR/../.")];
     input1 = input1 + "/.";
     inherit input2;
   };
diff --git a/tests/locking.builder.sh b/tests/locking.builder.sh
index 5c3dfdafbc59..7598653b1d5d 100644
--- a/tests/locking.builder.sh
+++ b/tests/locking.builder.sh
@@ -1,5 +1,3 @@
-export PATH=/bin:/usr/bin:$PATH
-
 sleep 3
 
 touch $out
diff --git a/tests/locking.nix.in b/tests/locking.nix.in
index 72070678f07a..a6b6b9101de8 100644
--- a/tests/locking.nix.in
+++ b/tests/locking.nix.in
@@ -5,6 +5,7 @@ let {
     system = "@system@";
     builder = "@shell@";
     args = ["-e" "-x" ./locking.builder.sh];
+    PATH = "@testPath@";
     inherit text inputs;
   };
 
diff --git a/tests/parallel.builder.sh b/tests/parallel.builder.sh
index 23926110fae9..d9118eff124a 100644
--- a/tests/parallel.builder.sh
+++ b/tests/parallel.builder.sh
@@ -1,9 +1,6 @@
 echo "DOING $text"
 
 
-export PATH=/bin:/usr/bin:$PATH
-
-
 # increase counter
 while ! ln -s x $shared.lock; do
     sleep 1
diff --git a/tests/parallel.nix.in b/tests/parallel.nix.in
index 29eac17523f6..3b462c4b246f 100644
--- a/tests/parallel.nix.in
+++ b/tests/parallel.nix.in
@@ -5,6 +5,7 @@ let {
     system = "@system@";
     builder = "@shell@";
     args = ["-e" "-x" ./parallel.builder.sh];
+    PATH = "@testPath@";
     shared = "@extra1@";
     inherit text inputs;
   };
diff --git a/tests/simple.builder.sh b/tests/simple.builder.sh
index dcd9bdb64ad0..536faec14915 100644
--- a/tests/simple.builder.sh
+++ b/tests/simple.builder.sh
@@ -4,7 +4,7 @@ echo "PATH=$PATH"
 if mkdir foo; then exit 1; fi
 
 # Set a PATH (!!! impure).
-export PATH=/bin:/usr/bin:$PATH
+export PATH=$goodPath
 
 mkdir $out
 
diff --git a/tests/simple.nix.in b/tests/simple.nix.in
index c2e944c7bb85..b49a8ca58e98 100644
--- a/tests/simple.nix.in
+++ b/tests/simple.nix.in
@@ -3,4 +3,5 @@ derivation {
   system = "@system@";
   builder = "@shell@";
   args = ["-e" "-x" ./simple.builder.sh];
-}
\ No newline at end of file
+  goodPath = "@testPath@";
+}
diff --git a/tests/simple.sh b/tests/simple.sh
index 4d3377b29f39..25dd57e030ae 100644
--- a/tests/simple.sh
+++ b/tests/simple.sh
@@ -18,6 +18,6 @@ if test "$text" != "Hello World!"; then exit 1; fi
 $nixstore --delete $outPath
 if test -e $outPath/hello; then false; fi
 
-if test "$(NIX_STORE_DIR=/foo $nixinstantiate --readonly-mode hash-check.nix)" != "/foo/4hgkkq63lp8x5kmh9cmsyqimq5v42zzl-dependencies.drv"; then
+if test "$(NIX_STORE_DIR=/foo $nixinstantiate --readonly-mode hash-check.nix)" != "/foo/bbfambd3ksry4ylik1772pn2qyw1k296-dependencies.drv"; then
     echo "hashDerivationModulo appears broken"
 fi
diff --git a/tests/user-envs.builder.sh b/tests/user-envs.builder.sh
index c84c045e4308..c5af9ed8dd92 100644
--- a/tests/user-envs.builder.sh
+++ b/tests/user-envs.builder.sh
@@ -1,5 +1,3 @@
-export PATH=/bin:/usr/bin:$PATH
-
 mkdir $out
 mkdir $out/bin
 echo "#! $shell" > $out/bin/$progName
diff --git a/tests/user-envs.nix.in b/tests/user-envs.nix.in
index 6b9bbe86db41..7972dfea1c36 100644
--- a/tests/user-envs.nix.in
+++ b/tests/user-envs.nix.in
@@ -12,6 +12,7 @@ let {
     builder = "@shell@";
     shell = "@shell@";
     args = ["-e" "-x" ./user-envs.builder.sh];
+    PATH = "@testPath@";
   } // {
     meta = {
       description = "A silly test package";