2023-11-08 07:30:55 +02:00
|
|
|
# Remove overall test dir (at most one of the two should match) and
|
|
|
|
# remove file extension.
|
|
|
|
test_name=$(echo -n "$test" | sed \
|
2023-08-25 17:20:28 +03:00
|
|
|
-e "s|^tests/unit/[^/]*/data/||" \
|
2023-11-08 07:30:55 +02:00
|
|
|
-e "s|^tests/functional/||" \
|
|
|
|
-e "s|\.sh$||" \
|
|
|
|
)
|
2023-10-05 19:12:18 +03:00
|
|
|
|
2023-11-08 07:30:55 +02:00
|
|
|
TESTS_ENVIRONMENT=(
|
|
|
|
"TEST_NAME=$test_name"
|
|
|
|
'NIX_REMOTE='
|
|
|
|
'PS4=+(${BASH_SOURCE[0]-$0}:$LINENO) '
|
|
|
|
)
|
2022-12-16 03:17:08 +02:00
|
|
|
|
|
|
|
: ${BASH:=/usr/bin/env bash}
|
|
|
|
|
2023-11-08 07:30:55 +02:00
|
|
|
run () {
|
|
|
|
cd "$(dirname $1)" && env "${TESTS_ENVIRONMENT[@]}" $BASH -x -e -u -o pipefail $(basename $1)
|
|
|
|
}
|