From 6169a2fe3568a614112227765e05447cd4927b39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20-rsm-=20Marek?= Date: Thu, 25 Jul 2024 20:05:43 +0200 Subject: [PATCH] Makefile: support for testing programs exiting with errors. --- Exercise.mk | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Exercise.mk b/Exercise.mk index b1a0209..9535d1b 100644 --- a/Exercise.mk +++ b/Exercise.mk @@ -40,12 +40,15 @@ check: $(TEST_RESULTS) echo -n " - testing "$(ANSIBOLD)$(BINARY)$(ANSIRST)":" \ $(ANSIYELLOW)$(patsubst $(TESTDIR)%.tin,%,$?)$(ANSIRST) TEST_ARGS=$$(cat $(patsubst %.tin,%.targs,$?) 2>/dev/null) ; \ - ./$(BINARY) $$TEST_ARGS <$? >$@ult + ./$(BINARY) $$TEST_ARGS <$? >$@ult 2>$@ult_err || ERR=1 diff --color=always --text $@ult $(patsubst %.tin,%.tout,$?) + if [ -f $(patsubst %.tin,%.terr,$?) ]; then \ + diff --color=always --text $@ult_err $(patsubst %.tin,%.terr,$?); fi echo $(ANSIGOK) clean: echo -n " - Cleaning "$(ANSIYBIN)":" rm -f $(BINARY) rm -f $(TESTDIR)*.result + rm -f $(TESTDIR)*.result_err echo $(ANSIGOK)