Fix tests.sh verbose output redirection

This commit is contained in:
Brian Picciano 2024-06-11 15:36:48 +02:00
parent 68f417b5ba
commit dee4af012e

View File

@ -68,14 +68,15 @@ for file in $test_files; do
if [ -z "$VERBOSE" ]; then if [ -z "$VERBOSE" ]; then
output="$TMPDIR/$file.log" output="$TMPDIR/$file.log"
mkdir -p "$(dirname "$output")" mkdir -p "$(dirname "$output")"
exec 3>"$output"
else else
output=/dev/stdout exec 3>&1
fi fi
( (
export TEST_CASE_FILE="$file" export TEST_CASE_FILE="$file"
if ! $SHELL -e -x "$root/cases/$file" >"$output" 2>&1; then if ! $SHELL -e -x "$root/cases/$file" >&3 2>&1; then
echo "$file FAILED" echo "$file FAILED"
if [ -z "$VERBOSE" ]; then if [ -z "$VERBOSE" ]; then
echo "output of test is as follows" echo "output of test is as follows"