Makefile: fix stopping on failed tests
A previous patch changed the way tests are run by piping the output into sed to indent the output. This broke checking the return code of the test because the return code is really that of sed. Fix this by taking a dependecy on bash and using PIPESTATUS to get the return code fo the test.
This commit is contained in:
3
Makefile
3
Makefile
@@ -7,6 +7,7 @@ CONFIGURE = $(SRC_DIR)/
|
|||||||
COV_DIR=$(OUT)/coverage/
|
COV_DIR=$(OUT)/coverage/
|
||||||
APP_DIR=$(SRC_DIR)/apps/
|
APP_DIR=$(SRC_DIR)/apps/
|
||||||
CC=gcc
|
CC=gcc
|
||||||
|
SHELL=/bin/bash
|
||||||
|
|
||||||
CCFLAGS = -Wall -Werror
|
CCFLAGS = -Wall -Werror
|
||||||
CCFLAGS += -std=c99 -D_POSIX_C_SOURCE=200809L
|
CCFLAGS += -std=c99 -D_POSIX_C_SOURCE=200809L
|
||||||
@@ -58,7 +59,7 @@ define run_tests =
|
|||||||
@for i in $(TESTS); do \
|
@for i in $(TESTS); do \
|
||||||
echo " TEST $$i"; \
|
echo " TEST $$i"; \
|
||||||
$$i | sed 's/^/ /'; \
|
$$i | sed 's/^/ /'; \
|
||||||
if [ $$? -ne 0 ]; then \
|
if [ $${PIPESTATUS[0]} -ne 0 ]; then \
|
||||||
exit 1; \
|
exit 1; \
|
||||||
fi; \
|
fi; \
|
||||||
done;
|
done;
|
||||||
|
|||||||
Reference in New Issue
Block a user