about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2011-10-10T21·11+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2011-10-10T21·11+0000
commit6fcdbcac202e40e5de7147ff64b34d6aaad16249 (patch)
tree3a18b2cde295fd1551bedb279948660dccd22d60 /tests
parent659c427caa39e44e5861ff1345425e4c34c9ced3 (diff)
* Install NixManifest.pm, NixConfig.pm and GeneratePatches.pm under
  the Nix:: namespace.

Diffstat (limited to 'tests')
-rw-r--r--tests/binary-patching.sh12
-rw-r--r--tests/common.sh.in13
-rw-r--r--tests/init.sh18
-rw-r--r--tests/nix-pull.sh2
-rw-r--r--tests/nix-push.sh3
5 files changed, 18 insertions, 30 deletions
diff --git a/tests/binary-patching.sh b/tests/binary-patching.sh
index 60e57b4b00dc..9866f4f6f26b 100644
--- a/tests/binary-patching.sh
+++ b/tests/binary-patching.sh
@@ -7,22 +7,22 @@ mkdir -p $TEST_ROOT/cache2 $TEST_ROOT/patches
 RESULT=$TEST_ROOT/result
 
 # Build version 1 and 2 of the "foo" package.
-$NIX_BIN_DIR/nix-push --copy $TEST_ROOT/cache2 $TEST_ROOT/manifest1 \
+nix-push --copy $TEST_ROOT/cache2 $TEST_ROOT/manifest1 \
     $($nixbuild -o $RESULT binary-patching.nix --arg version 1)
 
 out2=$($nixbuild -o $RESULT binary-patching.nix --arg version 2)
-$NIX_BIN_DIR/nix-push --copy $TEST_ROOT/cache2 $TEST_ROOT/manifest2 $out2
+nix-push --copy $TEST_ROOT/cache2 $TEST_ROOT/manifest2 $out2
     
 out3=$($nixbuild -o $RESULT binary-patching.nix --arg version 3)
-$NIX_BIN_DIR/nix-push --copy $TEST_ROOT/cache2 $TEST_ROOT/manifest3 $out3
+nix-push --copy $TEST_ROOT/cache2 $TEST_ROOT/manifest3 $out3
 
 rm $RESULT
 
 # Generate binary patches.
-$NIX_BIN_DIR/nix-generate-patches $TEST_ROOT/cache2 $TEST_ROOT/patches \
+nix-generate-patches $TEST_ROOT/cache2 $TEST_ROOT/patches \
     file://$TEST_ROOT/patches $TEST_ROOT/manifest1 $TEST_ROOT/manifest2
 
-$NIX_BIN_DIR/nix-generate-patches $TEST_ROOT/cache2 $TEST_ROOT/patches \
+nix-generate-patches $TEST_ROOT/cache2 $TEST_ROOT/patches \
     file://$TEST_ROOT/patches $TEST_ROOT/manifest2 $TEST_ROOT/manifest3
 
 grep -q "patch {" $TEST_ROOT/manifest3
@@ -45,7 +45,7 @@ rm $RESULT
 [ "$(grep ' patch ' $TEST_ROOT/var/log/nix/downloads | wc -l)" -eq 2 ]
 
 # Add a patch from version 1 directly to version 3.
-$NIX_BIN_DIR/nix-generate-patches $TEST_ROOT/cache2 $TEST_ROOT/patches \
+nix-generate-patches $TEST_ROOT/cache2 $TEST_ROOT/patches \
     file://$TEST_ROOT/patches $TEST_ROOT/manifest1 $TEST_ROOT/manifest3
 
 # Rebuild version 3.  This should use the direct patch rather than the
diff --git a/tests/common.sh.in b/tests/common.sh.in
index b03cd49ec70d..4a2c96daf706 100644
--- a/tests/common.sh.in
+++ b/tests/common.sh.in
@@ -1,5 +1,7 @@
 set -e
 
+export TOP=$(pwd)/..
+
 export TEST_ROOT=$(pwd)/test-tmp
 export NIX_STORE_DIR
 if ! NIX_STORE_DIR=$(readlink -f $TEST_ROOT/store 2> /dev/null); then
@@ -15,9 +17,12 @@ export NIX_DB_DIR=$TEST_ROOT/db
 export NIX_CONF_DIR=$TEST_ROOT/etc
 export NIX_BIN_DIR=$TEST_ROOT/bin
 export NIX_LIBEXEC_DIR=$TEST_ROOT/bin
+export NIX_MANIFESTS_DIR=$TEST_ROOT/var/nix/manifests
 export NIX_ROOT_FINDER=
 export SHARED=$TEST_ROOT/shared
 
+export PATH=$NIX_BIN_DIR:$TOP/scripts:$PATH
+
 export NIX_REMOTE=
 
 export REAL_BIN_DIR=@bindir@
@@ -27,10 +32,10 @@ export REAL_DATA_DIR=@datadir@
 export REAL_STORE_DIR=@storedir@
 export NIX_BUILD_HOOK=
 export PERL=perl
-export TOP=$(pwd)/..
-export bzip2_bin_test="@bzip2_bin_test@"
-if test "${bzip2_bin_test:0:1}" != "/"; then
-    bzip2_bin_test=`pwd`/${bzip2_bin_test}
+export PERL5LIB=$TOP/perl/lib
+export NIX_BZIP2="@bzip2_bin_test@/bzip2"
+if test "${NIX_BZIP2:0:1}" != "/"; then
+    NIX_BZIP2=`pwd`/${NIX_BZIP2}
 fi
 export dot=@dot@
 export xmllint="@xmllint@"
diff --git a/tests/init.sh b/tests/init.sh
index 104da432eaef..0e17740f36d2 100644
--- a/tests/init.sh
+++ b/tests/init.sh
@@ -29,16 +29,11 @@ ln -s $TOP/scripts/nix-prefetch-url $NIX_BIN_DIR/
 ln -s $TOP/scripts/nix-collect-garbage $NIX_BIN_DIR/
 ln -s $TOP/scripts/nix-build $NIX_BIN_DIR/
 ln -s $TOP/scripts/nix-install-package $NIX_BIN_DIR/
-ln -s $TOP/scripts/nix-push $NIX_BIN_DIR/
 ln -s $TOP/scripts/nix-pull $NIX_BIN_DIR/
-ln -s $TOP/scripts/nix-generate-patches $NIX_BIN_DIR/
 mkdir $NIX_BIN_DIR/nix
-ln -s $bzip2_bin_test/bzip2 $NIX_BIN_DIR/nix/
-ln -s $bzip2_bin_test/bunzip2 $NIX_BIN_DIR/nix/
+ln -s $NIX_BZIP2 $NIX_BIN_DIR/nix/
 ln -s $TOP/scripts/copy-from-other-stores.pl $NIX_BIN_DIR/nix/
 ln -s $TOP/scripts/download-using-manifests.pl $NIX_BIN_DIR/nix/
-ln -s $TOP/scripts/GeneratePatches.pm $NIX_BIN_DIR/nix/
-ln -s $TOP/scripts/NixManifest.pm $NIX_BIN_DIR/nix/
 
 cat > "$NIX_CONF_DIR"/nix.conf <<EOF
 gc-keep-outputs = false
@@ -53,17 +48,6 @@ cp -pr $TOP/corepkgs $NIX_DATA_DIR/nix/
 # (and likely to fail).
 for i in \
     $NIX_DATA_DIR/nix/corepkgs/nar/nar.sh \
-    $NIX_BIN_DIR/nix/download-using-manifests.pl \
-    $NIX_BIN_DIR/nix/copy-from-other-stores.pl \
-    $NIX_BIN_DIR/nix-prefetch-url \
-    $NIX_BIN_DIR/nix-collect-garbage \
-    $NIX_BIN_DIR/nix-build \
-    $NIX_BIN_DIR/nix-install-package \
-    $NIX_BIN_DIR/nix-push \
-    $NIX_BIN_DIR/nix-pull \
-    $NIX_BIN_DIR/nix-generate-patches \
-    $NIX_BIN_DIR/nix/NixManifest.pm \
-    $NIX_BIN_DIR/nix/GeneratePatches.pm \
     ; do
     sed < $i > $i.tmp \
         -e "s^$REAL_BIN_DIR/nix-store^$NIX_BIN_DIR/nix-store^" \
diff --git a/tests/nix-pull.sh b/tests/nix-pull.sh
index d2309742d217..9fc3992f6257 100644
--- a/tests/nix-pull.sh
+++ b/tests/nix-pull.sh
@@ -2,7 +2,7 @@ source common.sh
 
 pullCache () {
     echo "pulling cache..."
-    $NIX_BIN_DIR/nix-pull file://$TEST_ROOT/manifest
+    nix-pull file://$TEST_ROOT/manifest
 }
 
 clearStore
diff --git a/tests/nix-push.sh b/tests/nix-push.sh
index 0a35e3b97ab7..0cef0c22a248 100644
--- a/tests/nix-push.sh
+++ b/tests/nix-push.sh
@@ -7,5 +7,4 @@ echo "pushing $drvPath"
 
 mkdir -p $TEST_ROOT/cache
 
-$NIX_BIN_DIR/nix-push \
-    --copy $TEST_ROOT/cache $TEST_ROOT/manifest $drvPath
+nix-push --copy $TEST_ROOT/cache $TEST_ROOT/manifest $drvPath