From 75b703236355de1ac2837828fdae9b6fdd198c28 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Tue, 3 Sep 2024 15:14:08 -0400 Subject: [PATCH] Show error output on test failure --- Makefile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index b636c8b..e9b901c 100644 --- a/Makefile +++ b/Makefile @@ -47,7 +47,12 @@ tags: $(CC) $(CFLAGS) -c $< -o $@ %.tm.testresult: %.tm tomo - VERBOSE=0 COLOR=1 CC=gcc O=1 ./tomo $< 2>$@ >$@ && cat $@ + @printf '\x1b[33;1;4m%s\x1b[m\n' $< + @set -o pipefail; \ + if ! VERBOSE=0 COLOR=1 CC=gcc O=1 ./tomo $< 2>&1 | tee $@; then \ + rm -f $@; \ + false; \ + fi test: $(TESTS) @echo -e '\x1b[32;7m ALL TESTS PASSED! \x1b[m'