star-cmap

Mapping values onto color ramps
git clone git://git.meso-star.fr/star-cmap.git
Log | Files | Refs | README | LICENSE

commit 3bd466eeb7051117a600478bae280c87d7ebb9c5
parent 646a7a288863b976b2e5192f14868059a6b15092
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Fri, 27 Oct 2023 16:18:33 +0200

Update the make.sh script

Explicitly enable the -e option in the make.sh script. It was previously
defined in the shebang but was actually ignore.

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:
Mmake.sh | 10++++++----
1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/make.sh b/make.sh @@ -1,4 +1,4 @@ -#!/bin/sh -e +#!/bin/sh # Copyright (C) 2020, 2021, 2023 |Méso|Star> (contact@meso-star.com) # @@ -15,6 +15,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. +set -e + config_test() { for i in "$@"; do @@ -33,10 +35,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 } clean_test()