From db81614cd660372c836e8c5b1cf975d0df5dbbd0 Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Sun, 27 Jun 2021 11:48:41 +0200 Subject: canonical-benchmarks.bash: handle relative paths Passing a relative path was broken because we cd'ed away first. --- tests/canonical-benchmarks.bash | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tests/canonical-benchmarks.bash b/tests/canonical-benchmarks.bash index 71563ab..7b37601 100755 --- a/tests/canonical-benchmarks.bash +++ b/tests/canonical-benchmarks.bash @@ -6,20 +6,24 @@ # # This is called by the top-level script "benchmark.bash". -cd "$(dirname "$0")" + MYNAME=$(basename "$0") -MD5="$PWD/stress_tests/linux-3.0.md5sums" if [ $# -ne 1 ]; then echo "usage: $MYNAME TESTDIR" exit 1 fi +# Resolve possible relative TESTDIR path before cd'ing away +TESTDIR=$(realpath "$1") + # Download /tmp/linux-3.0.tar.gz +cd "$(dirname "$0")" +MD5="$PWD/stress_tests/linux-3.0.md5sums" ./dl-linux-tarball.bash # cd to TESTDIR -cd "$1" +cd "$TESTDIR" # Execute command, discard all stdout output, print elapsed time # (to stderr, unfortunately). -- cgit v1.2.3