Skip to content

Commit bae897a

Browse files
make linter happy
1 parent fd212fc commit bae897a

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

tests/run_test.sh

+10-6
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,13 @@ remove_fail_test() {
2525
rm -f "${PATHRT}/fail_test_${TEST_ID}"
2626
}
2727

28+
redirect_out_err() {
29+
( "$@" 2>&1 1>&3 3>&- | tee err ) 3>&1 1>&2 | tee out
30+
# The above shell redirection copies stdout to "out" and stderr to "err"
31+
# while still sending them to stdout and stderr. It does this without
32+
# relying on bash-specific extensions or non-standard OS features.
33+
}
34+
2835
if [[ $# != 5 ]]; then
2936
echo "Usage: $0 PATHRT RUNDIR_ROOT TEST_NAME TEST_ID COMPILE_ID"
3037
exit 1
@@ -380,9 +387,9 @@ if [[ ${SCHEDULER} = 'none' ]]; then
380387

381388
ulimit -s unlimited
382389
if [[ ${CI_TEST} = 'true' ]]; then
383-
eval "${OMP_ENV}" mpiexec -n "${TASKS}" ./fv3.exe >out 2> >(tee err >&3)
390+
redirect_out_err $( eval "${OMP_ENV}" mpiexec -n "${TASKS}" ./fv3.exe )
384391
else
385-
mpiexec -n "${TASKS}" ./fv3.exe >out 2> >(tee err >&3)
392+
redirect_out_err mpiexec -n "${TASKS}" ./fv3.exe
386393
fi
387394

388395
else
@@ -399,10 +406,7 @@ else
399406
fi
400407

401408
chmod u+x job_card
402-
( ./job_card 2>&1 1>&3 3>&- | tee err ) 3>&1 1>&2 | tee out
403-
# The above shell redirection copies stdout to "out" and stderr to "err"
404-
# while still sending them to stdout and stderr. It does this without
405-
# relying on bash-specific extensions or non-standard OS features.
409+
redirect_out_err ./job_card
406410
fi
407411

408412
fi

0 commit comments

Comments
 (0)