From 95bc1237e2b5a7de0515d6ad440dc2ba5bae2915 Mon Sep 17 00:00:00 2001 From: Erik Arvstedt Date: Fri, 11 Dec 2020 13:26:08 +0100 Subject: [PATCH] run-tests: rename testDir -> scriptDir --- test/run-tests.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/run-tests.sh b/test/run-tests.sh index 6508d26..0d9eba5 100755 --- a/test/run-tests.sh +++ b/test/run-tests.sh @@ -40,6 +40,8 @@ set -eo pipefail +scriptDir=$(cd "${BASH_SOURCE[0]%/*}" && pwd) + scenario= outLinkPrefix= while :; do @@ -73,9 +75,7 @@ numCPUs=${numCPUs:-$(nproc)} # Min. 800 MiB needed to avoid 'out of memory' errors memoryMiB=${memoryMiB:-2048} -testDir=$(cd "${BASH_SOURCE[0]%/*}" && pwd) - -export NIX_PATH=nixpkgs=$(nix eval --raw -f "$testDir/../pkgs/nixpkgs-pinned.nix" nixpkgs) +export NIX_PATH=nixpkgs=$(nix eval --raw -f "$scriptDir/../pkgs/nixpkgs-pinned.nix" nixpkgs) # Run the test. No temporary files are left on the host system. run() { @@ -83,7 +83,7 @@ run() { export TMPDIR=$(mktemp -d /tmp/nix-bitcoin-test.XXX) trap "rm -rf $TMPDIR" EXIT - nix-build --out-link $TMPDIR/driver -E "(import \"$testDir/tests.nix\" { scenario = \"$scenario\"; }).vm" -A driver + nix-build --out-link $TMPDIR/driver -E "(import \"$scriptDir/tests.nix\" { scenario = \"$scenario\"; }).vm" -A driver # Variable 'tests' contains the Python code that is executed by the driver on startup if [[ $1 == --interactive ]]; then @@ -129,7 +129,7 @@ instantiate() { } container() { - . "$testDir/lib/make-container.sh" "$@" + . "$scriptDir/lib/make-container.sh" "$@" } # Run the test by building the test derivation @@ -163,7 +163,7 @@ exprForCI() { vmTestNixExpr() { extraQEMUOpts="$1" cat <