tests: Set error code - scc - simple c99 compiler
(HTM) git clone git://git.simple-cc.org/scc
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) Submodules
(DIR) README
(DIR) LICENSE
---
(DIR) commit 1ed0ff0000999561feee336c289252faf2502a7e
(DIR) parent 00bae5c394c9b1d31586ffa1ee2f77a3edcc6f0a
(HTM) Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Wed, 29 Oct 2025 10:57:06 +0100
tests: Set error code
Having a correct error code when make tests is executed helps to detect
when a test failed.
Diffstat:
M tests/Makefile | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
---
(DIR) diff --git a/tests/Makefile b/tests/Makefile
@@ -15,11 +15,15 @@ PROJECTDIR = ..
include $(PROJECTDIR)/scripts/rules.mk
all:
- @for i in $(DIRS);\
+ @trap 'rm -f $$$$.tmp' EXIT INT HUP TERM;\
+ for i in $(DIRS);\
do \
cd $$i;\
$(MAKE) tests;\
cd -;\
- done | grep -e PASS -e FAIL -e SKIP;\
+ done | \
+ grep -e PASS -e FAIL -e SKIP |\
+ tee $$$$.tmp &&\
+ grep FAIL $$$$.tmp > /dev/null && exit 1 || exit 0
dep: