Skip to content

Commit

Permalink
Makefile: support for testing programs exiting with errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
rsm-lisper committed Jul 25, 2024
1 parent 23a1842 commit 6169a2f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Exercise.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit 6169a2f

Please sign in to comment.