Commit c64c82b3
c64c82b343edMerged
Yukihiro "Matz" Matsumoto <[email protected]> · 6 months ago · 1 file · ~1 modified
Description
Merge pull request #157 from ledsun/codex/fail-test-target-on-errors
[codex] Fail make targets when tests report errors
Details
- Commit
- c64c82b343ed
- Parent
- 47337b9245af
- Merge parent
- 6af6f6f1f7ac
MakefilemodifiedView file
@@ -203,12 +203,13 @@
203203
fi; \204204
done; \205205
rm -f /tmp/_sp_t.ast /tmp/_sp_t.c /tmp/_sp_t_bin$(EXE); \206-
echo "Tests: $$pass pass, $$fail fail, $$err error"206+
echo "Tests: $$pass pass, $$fail fail, $$err error"; \207+
if [ $$fail -ne 0 ] || [ $$err -ne 0 ]; then exit 1; fi207208
208209
bench: spinel_parse$(EXE) $(SP_RT_LIB)209210
@if [ ! -f spinel_codegen$(EXE) ]; then echo "Run 'make bootstrap' first"; exit 1; fi210211
@if [ -z "$(TIMEOUT_BIN)" ]; then echo "Note: no 'timeout' command found; running without time limits."; fi211-
@pass=0; fail=0; skip=0; \212+
@pass=0; fail=0; err=0; skip=0; \212213
for f in benchmark/*.rb; do \213214
bn=$$(basename "$$f" .rb); \214215
$(TIMEOUT10) ./spinel_parse$(EXE) "$$f" /tmp/_sp_b.ast 2>/dev/null && \@@ -232,11 +233,12 @@
232233
fi; \233234
fi; \234235
else \235-
echo "ERR: $$bn"; \236+
echo "ERR: $$bn"; err=$$((err+1)); \236237
fi; \237238
done; \238239
rm -f /tmp/_sp_b.ast /tmp/_sp_b.c /tmp/_sp_b_bin$(EXE); \239-
echo "Benchmarks: $$pass pass, $$fail fail, $$skip skip"240+
echo "Benchmarks: $$pass pass, $$fail fail, $$err error, $$skip skip"; \241+
if [ $$fail -ne 0 ] || [ $$err -ne 0 ]; then exit 1; fi240242
241243
# ---- Install ----242244