commit 94772e04641e1b1ae1c2ace65ddb496ee483285a
parent 7238d80ee87fcf12b2ab7ea95bee058c9811d24a
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Mon, 26 Feb 2024 15:21:17 +0100
Added a script to format "make test" output
The script silences test output. It writes the status of their output in
color to highlight those that have failed or passed. The aim is to give
a brief summary of what's going on.
Of course, the caller can run a test by hand if he wishes to obtain all
its output.
Diffstat:
2 files changed, 36 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
@@ -55,5 +55,5 @@ sadist_probe_boundary: src/sadist_probe_boundary.o libsadist-triprof.so
$(LDFLAGS_EXE) $(S3DUT_LIBS) $(RSYS_LIBS) -lm
test: $(TESTS)
- ./sadist_probe_boundary
- ./sadist_probe_boundary -p 4
+ @$(SHELL) make.sh check sadis_probe_boundary ./sadist_probe_boundary
+ @$(SHELL) make.sh check sadis_probe_boundary_list ./sadist_probe_boundary -p 4
diff --git a/make.sh b/make.sh
@@ -0,0 +1,34 @@
+#!/bin/sh
+
+# Copyright (C) 2024 |Méso|Star> (contact@meso-star.com)
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# 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
+
+check()
+{
+ name="$1"
+ prog="$2"
+ shift 2
+
+ printf "%s " "${name}"
+ if ./"${prog}" "$@" > /dev/null 2>&1; then
+ printf "\033[1;32mOK\033[m\n"
+ else
+ printf "\033[1;31mError\033[m\n"
+ fi
+}
+
+"$@"