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:
2017-05-31 21:30:41 -07:00
parent 8dbcf353ab
commit df22d782f5

View File

@@ -7,6 +7,7 @@ CONFIGURE = $(SRC_DIR)/
COV_DIR=$(OUT)/coverage/
APP_DIR=$(SRC_DIR)/apps/
CC=gcc
SHELL=/bin/bash
CCFLAGS = -Wall -Werror
CCFLAGS += -std=c99 -D_POSIX_C_SOURCE=200809L
@@ -58,7 +59,7 @@ define run_tests =
@for i in $(TESTS); do \
echo " TEST $$i"; \
$$i | sed 's/^/ /'; \
if [ $$? -ne 0 ]; then \
if [ $${PIPESTATUS[0]} -ne 0 ]; then \
exit 1; \
fi; \
done;