返回 CodeWhale
test-tui-hermetic.sh
根目录 / scripts / test-tui-hermetic.sh
1 #!/bin/sh
2 # Run the TUI library tests through the shared isolated test-home boundary.
3 set -eu
4
5 repo_root=$(CDPATH='' cd -- "$(dirname -- "$0")/.." && pwd)
6 runs=${TUI_HERMETIC_RUNS:-2}
7 filter=${TUI_HERMETIC_FILTER:-}
8
9 "$repo_root/scripts/check-tui-product-vocabulary.sh"
10
11 run=1
12 while [ "$run" -le "$runs" ]; do
13 printf '%s\n' "hermetic TUI run $run/$runs"
14 (
15 cd "$repo_root"
16 # The filter and cargo command are expanded by the isolated child shell.
17 # shellcheck disable=SC2016
18 "$repo_root/scripts/with-hermetic-test-home.sh" \
19 sh -c '
20 if [ -n "$1" ]; then
21 exec cargo test --quiet -p codewhale-tui --lib --locked "$1"
22 fi
23 exec cargo test --quiet -p codewhale-tui --lib --locked
24 ' sh "$filter"
25 )
26 run=$((run + 1))
27 done
28
28 lines BASH