Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.

Commit f73bcf8

Browse files
test/exceptions: Only print expected output if test fails
To reduce the noise and save some time
1 parent 84e429a commit f73bcf8

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

test/exceptions/Makefile

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,18 @@ $(ROOT)/message_with_null.done: STDERR_EXP=" world"
8484
$(ROOT)/%.done: $(ROOT)/%
8585
@echo Testing $*
8686
$(QUIET)$(TIMELIMIT)$(ROOT)/$* $(RUN_ARGS) 2>$(ROOT)/$*.stderr || true
87-
cat $(ROOT)/$*.stderr
88-
$(NEGATE) grep -qF $(STDERR_EXP) < $(ROOT)/$*.stderr
89-
if [ ! -z $(STDERR_EXP2) ] ; then \
90-
$(NEGATE) grep -qF $(STDERR_EXP2) < $(ROOT)/$*.stderr; \
87+
88+
@if $(NEGATE) grep -qF $(STDERR_EXP) < $(ROOT)/$*.stderr ; then true ; else \
89+
echo 'Searched for pattern $(STDERR_EXP), NEGATE = $(NEGATE)' ;\
90+
tail --bytes=5000 $(ROOT)/$*.stderr ;\
91+
exit 1 ;\
92+
fi
93+
@if [ ! -z $(STDERR_EXP2) ] ; then \
94+
if $(NEGATE) grep -qF $(STDERR_EXP2) < $(ROOT)/$*.stderr ; then true ; else \
95+
echo 'Searched for '$(STDERR_EXP2)' NEGATE = $(NEGATE)' ;\
96+
tail --bytes=5000 $(ROOT)/$*.stderr ;\
97+
exit 1 ;\
98+
fi \
9199
fi
92100
@touch $@
93101

0 commit comments

Comments
 (0)