mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-14 02:06:16 +02:00
27a02bc7d1
the additional function calls obscured the actual logic Co-authored-by: Théophane Hufschmitt <7226587+thufschmitt@users.noreply.github.com>
19 lines
479 B
Bash
19 lines
479 B
Bash
# Remove overall test dir (at most one of the two should match) and
|
|
# remove file extension.
|
|
test_name=$(echo -n "$test" | sed \
|
|
-e "s|^tests/unit/[^/]*/data/||" \
|
|
-e "s|^tests/functional/||" \
|
|
-e "s|\.sh$||" \
|
|
)
|
|
|
|
TESTS_ENVIRONMENT=(
|
|
"TEST_NAME=$test_name"
|
|
'NIX_REMOTE='
|
|
'PS4=+(${BASH_SOURCE[0]-$0}:$LINENO) '
|
|
)
|
|
|
|
: ${BASH:=/usr/bin/env bash}
|
|
|
|
run () {
|
|
cd "$(dirname $1)" && env "${TESTS_ENVIRONMENT[@]}" $BASH -x -e -u -o pipefail $(basename $1)
|
|
}
|