canonical-benchmarks.bash: handle relative paths

Passing a relative path was broken because we cd'ed
away first.
This commit is contained in:
Jakob Unterwurzacher 2021-06-27 11:48:41 +02:00
parent 2a9d70d48f
commit db81614cd6
1 changed files with 7 additions and 3 deletions

View File

@ -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).