Commit 2b56524e
2b56524e2e0dMerged
Yukihiro "Matz" Matsumoto <[email protected]> · 6 months ago · 1 file · ~1 modified
Description
build: make test/bench targets fail loud on test errors
Both make test and make bench previously printed a summary line
(Tests: N pass, M fail, K error) and exited 0 unconditionally — so
CI showed SUCCESS for jobs that actually had failing tests. Several
post-merge regressions slipped through master that way (e.g. the
windows-mingw runner reporting 216 pass, 3 fail, 2 error and
matz's local array_tally_sym cc error from gcc 13's
-Walloc-size-larger-than=).
Two coupled changes:
-
Add
-Wno-alloc-size-larger-thanto CFLAGS. Silences the gcc 13 paranoia warning fired on the inlinedh->cap *= 2in sp_*Hash_grow when the inliner can't bound h->cap. The pattern is bounded in practice (cap doubles from a small power of two until memory runs out, never approaches 2^60). Without this, sp_SymArray_tally — added in PR #150 — turns the warning into a -Werror failure insidemake test. -
Both targets now
exit 1if any test fails or errors.make benchgains an expliciterrcounter (the loop tracked pass/fail/skip only) and reports it alongside the existing summary. The exit-1 gate makes CI's "SUCCESS" mean the job actually green-lit, not that the loop ran to completion.
After: with REF_RUBY=miniruby make test → 221 pass / 0 fail / 0 error
on master locally. With default REF_RUBY=ruby on a system Ruby older
than 3.3, numbered_block_params (uses Ruby 3.4+ it block param)
fails loud — that's the intended strict behaviour. CI uses Ruby 3.3
which supports it; if CI's pre-existing failures (the Windows-only
fileio/system tests visible in past run logs) trip the new gate,
those become real bugs to fix instead of silent regressions.
Co-Authored-By: Claude Opus 4.7 (1M context) [email protected]
Details
- Commit
- 2b56524e2e0d
- Parent
- 12f1c5c42d26
MakefilemodifiedView file
# make clean Remove built binariesCC ?= ccCFLAGS = -O2 -Wno-all# `-Wno-alloc-size-larger-than` silences a gcc 13+ paranoia warning that# fires on the inlined `h->cap *= 2` in sp_*Hash_grow when the inliner# can't bound h->cap. The pattern is bounded in practice (cap doubles# from a small power of two until memory runs out, never approaches# 2^60), but gcc tracks signed-overflow UB conservatively. Other# compilers don't have the warning.CFLAGS = -O2 -Wno-all -Wno-alloc-size-larger-than# Bootstrap-only flags: spinel_codegen runs on the developer's machine# only, so we can use -O3 -flto for ~5-10% extra wall-clock without# constraining users (whose generated C is built with plain CFLAGS). fi; \ done; \ rm -f /tmp/_sp_t.ast /tmp/_sp_t.c /tmp/_sp_t_bin$(EXE); \ echo "Tests: $$pass pass, $$fail fail, $$err error" echo "Tests: $$pass pass, $$fail fail, $$err error"; \ if [ $$fail -gt 0 ] || [ $$err -gt 0 ]; then exit 1; fibench: spinel_parse$(EXE) $(SP_RT_LIB) @if [ ! -f spinel_codegen$(EXE) ]; then echo "Run 'make bootstrap' first"; exit 1; fi @if [ -z "$(TIMEOUT_BIN)" ]; then echo "Note: no 'timeout' command found; running without time limits."; fi @pass=0; fail=0; skip=0; \ @pass=0; fail=0; skip=0; err=0; \ for f in benchmark/*.rb; do \ bn=$$(basename "$$f" .rb); \ $(TIMEOUT10) ./spinel_parse$(EXE) "$$f" /tmp/_sp_b.ast 2>/dev/null && \ fi; \ fi; \ else \ echo "ERR: $$bn"; \ echo "ERR: $$bn"; err=$$((err+1)); \ fi; \ done; \ rm -f /tmp/_sp_b.ast /tmp/_sp_b.c /tmp/_sp_b_bin$(EXE); \ echo "Benchmarks: $$pass pass, $$fail fail, $$skip skip" echo "Benchmarks: $$pass pass, $$fail fail, $$skip skip, $$err error"; \ if [ $$fail -gt 0 ] || [ $$err -gt 0 ]; then exit 1; fi# ---- Install ----