2021-05-03 12:43:04 +00:00
|
|
|
emulate_bats_env() {
|
|
|
|
export BATS_CWD="$PWD"
|
|
|
|
export BATS_TEST_FILTER=
|
|
|
|
export BATS_ROOT_PID=$$
|
2022-01-17 13:58:05 +00:00
|
|
|
export BATS_RUN_TMPDIR
|
|
|
|
BATS_RUN_TMPDIR=$(mktemp -d "${BATS_RUN_TMPDIR}/emulated-tmpdir-${BATS_ROOT_PID}-XXXXXX")
|
2021-05-03 12:43:04 +00:00
|
|
|
}
|
|
|
|
|
2019-03-04 23:52:53 +00:00
|
|
|
fixtures() {
|
|
|
|
FIXTURE_ROOT="$BATS_TEST_DIRNAME/fixtures/$1"
|
2022-01-17 13:58:05 +00:00
|
|
|
# shellcheck disable=SC2034
|
2021-05-03 12:43:04 +00:00
|
|
|
RELATIVE_FIXTURE_ROOT="${FIXTURE_ROOT#$BATS_CWD/}"
|
2019-03-04 23:52:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
filter_control_sequences() {
|
|
|
|
"$@" | sed $'s,\x1b\\[[0-9;]*[a-zA-Z],,g'
|
|
|
|
}
|
|
|
|
|
|
|
|
if ! command -v tput >/dev/null; then
|
|
|
|
tput() {
|
|
|
|
printf '1000\n'
|
|
|
|
}
|
|
|
|
export -f tput
|
|
|
|
fi
|
|
|
|
|
|
|
|
emit_debug_output() {
|
2022-01-17 13:58:05 +00:00
|
|
|
# shellcheck disable=SC2154
|
2019-03-04 23:52:53 +00:00
|
|
|
printf '%s\n' 'output:' "$output" >&2
|
|
|
|
}
|