From df22d782f5fa706fa4c217349e5734d09aa1da70 Mon Sep 17 00:00:00 2001 From: Max Regan Date: Wed, 31 May 2017 21:30:41 -0700 Subject: [PATCH] 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. --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 6af8e51..502f3cc 100644 --- a/Makefile +++ b/Makefile @@ -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;