#!/bin/sh
set -eu
repo_root=$(CDPATH='' cd -- "$(dirname -- "$0")/.." && pwd)
runs=${TUI_HERMETIC_RUNS:-2}
filter=${TUI_HERMETIC_FILTER:-}
"$repo_root/scripts/check-tui-product-vocabulary.sh"
run=1
while [ "$run" -le "$runs" ]; do
printf '%s\n' "hermetic TUI run $run/$runs"
(
cd "$repo_root"
"$repo_root/scripts/with-hermetic-test-home.sh" \
sh -c '
if [ -n "$1" ]; then
exec cargo test --quiet -p codewhale-tui --lib --locked "$1"
fi
exec cargo test --quiet -p codewhale-tui --lib --locked
' sh "$filter"
)
run=$((run + 1))
done