tests: Fix browser.sh path detection to be less STI specific

Only set `$SOURCE` to ./source/ if that actually exists, which is when
it is being called through Standard Test Interface.

Provide fallbacks for using FMF or when calling the script manually.
This commit is contained in:
Martin Pitt 2021-02-10 06:46:21 +01:00
parent 168e0397aa
commit a0f5493eef

View File

@ -1,10 +1,14 @@
#!/bin/sh
set -eux
# from standard-test-source
TESTS="$(realpath $(dirname "$0"))"
if [ -d source ]; then
# path for standard-test-source
SOURCE="$(pwd)/source"
else
SOURCE="$(realpath $TESTS/..)"
fi
LOGS="$(pwd)/logs"
TESTS="$(pwd)/tests"
mkdir -p "$LOGS"
chmod a+w "$LOGS"