nuthatch/tests/run-host-tests.sh

21 lines
443 B
Shell
Executable file

#!/usr/bin/env bash
set -euo pipefail
output="$(mktemp)"
trap 'rm -f "$output"' EXIT
set +e
cabal test --offline nuthatch-unit --test-show-details=direct 2>&1 |
tee "$output"
status="${PIPESTATUS[0]}"
set -e
if [[ "$status" = 0 ]]; then
exit 0
fi
if grep -E 'All [0-9]+ tests passed' "$output" >/dev/null &&
grep -F '/.cabal/logs/build.log: withFile: permission denied' \
"$output" >/dev/null; then
exit 0
fi
exit "$status"