mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-26 07:46:21 +02:00
567265ae67
Like with the formatter, we are blacklisting most files by default. Do a few files to get us started, and get a sense of what this looks like.
24 lines
594 B
Bash
24 lines
594 B
Bash
# shellcheck shell=bash
|
|
|
|
# Remove overall test dir (at most one of the two should match) and
|
|
# remove file extension.
|
|
|
|
# shellcheck disable=SC2154
|
|
test_name=$(echo -n "$test" | sed \
|
|
-e "s|^tests/unit/[^/]*/data/||" \
|
|
-e "s|^tests/functional/||" \
|
|
-e "s|\.sh$||" \
|
|
)
|
|
|
|
# shellcheck disable=SC2016
|
|
TESTS_ENVIRONMENT=(
|
|
"TEST_NAME=$test_name"
|
|
'NIX_REMOTE='
|
|
'PS4=+(${BASH_SOURCE[0]-$0}:$LINENO) '
|
|
)
|
|
|
|
read -r -a bash <<< "${BASH:-/usr/bin/env bash}"
|
|
|
|
run () {
|
|
cd "$(dirname "$1")" && env "${TESTS_ENVIRONMENT[@]}" "${bash[@]}" -x -e -u -o pipefail "$(basename "$1")"
|
|
}
|