commit 2827552d48ea66b2a8cb78163442f8e143c91dd9
parent e5263dae7cb230739f62eb0cffc12637d2a3d0d9
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Fri, 27 Oct 2023 15:09:53 +0200
Update the make.sh scrip
Update the escape sequence in messages displayed by "make test". Some
shells (e.g. dash) don't support the '\e' character in printf: the
escape sequence is simply ignored. So we've replaced '\e' with '\033' in
the printf used to display colored messages in "make test". This should
work as expected in all shells.
Redirect the error messages of the if directive in the check function to
print only the defined error message. This was partially the case since
the error messages of the test were already redirected. But if the test
was interrupted due to an assertion, segmentation error, user interrupt,
etc., the if directive printed its own error message. Now we redirect it
to /dev/null
Diffstat:
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/make.sh b/make.sh
@@ -81,10 +81,10 @@ check()
printf "%s " "${name}"
if ./"${prog}" "$@" > /dev/null 2>&1; then
- printf "\e[1;32mOK\e[m\n"
+ printf "\033[1;32mOK\033[m\n"
else
- printf "\e[1;31mError\e[m\n"
- fi
+ printf "\033[1;31mError\033[m\n"
+ fi 2> /dev/null
}
run_test()