Commit 6af6f6f1
6af6f6f1f7acMerged
shigeru.nakajima <[email protected]> · 6 months ago · 1 file · ~1 modified
Description
test: fail make targets on errors
Details
- Commit
- 6af6f6f1f7ac
- Parent
- 12f1c5c42d26
MakefilemodifiedView file
@@ -195,12 +195,13 @@
195195
fi; \196196
done; \197197
rm -f /tmp/_sp_t.ast /tmp/_sp_t.c /tmp/_sp_t_bin$(EXE); \198-
echo "Tests: $$pass pass, $$fail fail, $$err error"198+
echo "Tests: $$pass pass, $$fail fail, $$err error"; \199+
if [ $$fail -ne 0 ] || [ $$err -ne 0 ]; then exit 1; fi199200
200201
bench: spinel_parse$(EXE) $(SP_RT_LIB)201202
@if [ ! -f spinel_codegen$(EXE) ]; then echo "Run 'make bootstrap' first"; exit 1; fi202203
@if [ -z "$(TIMEOUT_BIN)" ]; then echo "Note: no 'timeout' command found; running without time limits."; fi203-
@pass=0; fail=0; skip=0; \204+
@pass=0; fail=0; err=0; skip=0; \204205
for f in benchmark/*.rb; do \205206
bn=$$(basename "$$f" .rb); \206207
$(TIMEOUT10) ./spinel_parse$(EXE) "$$f" /tmp/_sp_b.ast 2>/dev/null && \@@ -224,11 +225,12 @@
224225
fi; \225226
fi; \226227
else \227-
echo "ERR: $$bn"; \228+
echo "ERR: $$bn"; err=$$((err+1)); \228229
fi; \229230
done; \230231
rm -f /tmp/_sp_b.ast /tmp/_sp_b.c /tmp/_sp_b_bin$(EXE); \231-
echo "Benchmarks: $$pass pass, $$fail fail, $$skip skip"232+
echo "Benchmarks: $$pass pass, $$fail fail, $$err error, $$skip skip"; \233+
if [ $$fail -ne 0 ] || [ $$err -ne 0 ]; then exit 1; fi232234
233235
# ---- Install ----234236