Use a special name for stdin/stdout in diagnostics

This commit is contained in:
ISSOtm
2022-11-12 12:29:28 +01:00
committed by Eldred Habert
parent 6902387991
commit 3e5cd8ce1a
5 changed files with 41 additions and 21 deletions

View File

@@ -16,7 +16,7 @@ RGBGFX=../../rgbgfx
rc=0
new_test() {
cmdline="${*@Q}"
cmdline="$*"
echo "$bold${green}Testing: $cmdline$rescolors$resbold" >&2
}
test() {
@@ -44,14 +44,22 @@ rm -f out*.png result.png
for f in *.png; do
flags="$([[ -e "${f%.png}.flags" ]] && echo "@${f%.png}.flags")"
new_test "$RGBGFX" $flags "$f"
new_test "$RGBGFX" $flags "$f"
if [[ -e "${f%.png}.err" ]]; then
test 2>"$errtmp"
diff -u --strip-trailing-cr "${f%.png}.err" "$errtmp" || fail
else
test || fail $?
fi
new_test "$RGBGFX" $flags - "<$f"
if [[ -e "${f%.png}.err" ]]; then
test 2>"$errtmp"
diff -u --strip-trailing-cr <(sed "s/$f/<stdin>/g" "${f%.png}.err") "$errtmp" || fail
else
test || fail $?
fi
done
exit $rc