Commit 8abd9145

8abd9145428eMerged

Yukihiro "Matz" Matsumoto <[email protected]> · 6 months ago · 25 files · +21 added · ~4 modified

Description

Merge remote-tracking branch 'origin/master' into rs-array-tally-sym

Conflicts:

spinel_codegen.rb

Details

Commit
8abd9145428e
Parent
183a80101d37
Merge parent
bee7e89d5b64

MakefilemodifiedView file

@@ -49,6 +49,20 @@
4949 TIMEOUT10 := $(if $(TIMEOUT_BIN),$(TIMEOUT_BIN) 10,)
5050 TIMEOUT60 := $(if $(TIMEOUT_BIN),$(TIMEOUT_BIN) 60,)
5151
52+# Reference Ruby for `make test` / `make bench` output comparison.
53+# Defaults to `ruby` (the system CRuby), matching the historical
54+# behaviour. Override on the command line when a newer or differently-
55+# built interpreter is needed, e.g.
56+#
57+# REF_RUBY=miniruby make test
58+#
59+# to use a freshly-built bootstrap interpreter (Ruby's `miniruby`)
60+# that supports newer features like the `it` block param. The
61+# harness falls back to `ruby` per-file if `REF_RUBY` exits non-zero
62+# — covers tests that `require` extension libraries (stringio, etc.)
63+# which the bootstrap miniruby can't load.
64+REF_RUBY ?= ruby
65+
5266 # Prism library: prefer vendor/prism (fetched via `make deps`), then
5367 # fall back to the Prism gem if one is installed. Override by setting
5468 # PRISM_DIR=/path/to/prism on the command line.
@@ -166,7 +180,10 @@
166180 ./spinel_codegen$(EXE) /tmp/_sp_t.ast /tmp/_sp_t.c 2>/dev/null && \
167181 $(CC) $(CFLAGS) -Werror $(SEC_FLAGS) -Ilib /tmp/_sp_t.c $(SP_RT_LIB) $(LDFLAGS) -lm $(GC_FLAGS) -o /tmp/_sp_t_bin$(EXE) 2>/dev/null; \
168182 if [ $$? -eq 0 ]; then \
169- expected=$$($(TIMEOUT10) ruby "$$f" 2>/dev/null); \
183+ expected=$$($(TIMEOUT10) $(REF_RUBY) "$$f" 2>/dev/null); \
184+ if [ $$? -ne 0 ] && [ "$(REF_RUBY)" != "ruby" ]; then \
185+ expected=$$($(TIMEOUT10) ruby "$$f" 2>/dev/null); \
186+ fi; \
170187 actual=$$($(TIMEOUT10) /tmp/_sp_t_bin$(EXE) 2>/dev/null); \
171188 if [ "$$expected" = "$$actual" ]; then \
172189 pass=$$((pass+1)); \
@@ -190,8 +207,12 @@
190207 $(TIMEOUT10) ./spinel_codegen$(EXE) /tmp/_sp_b.ast /tmp/_sp_b.c 2>/dev/null && \
191208 $(CC) $(CFLAGS) -Werror $(SEC_FLAGS) -Ilib /tmp/_sp_b.c $(SP_RT_LIB) $(LDFLAGS) -lm $(GC_FLAGS) -o /tmp/_sp_b_bin$(EXE) 2>/dev/null; \
192209 if [ $$? -eq 0 ]; then \
193- expected=$$($(TIMEOUT60) ruby "$$f" 2>/dev/null); \
210+ expected=$$($(TIMEOUT60) $(REF_RUBY) "$$f" 2>/dev/null); \
194211 ruby_rc=$$?; \
212+ if [ $$ruby_rc -ne 0 ] && [ "$(REF_RUBY)" != "ruby" ]; then \
213+ expected=$$($(TIMEOUT60) ruby "$$f" 2>/dev/null); \
214+ ruby_rc=$$?; \
215+ fi; \
195216 if [ $$ruby_rc -eq 124 ]; then \
196217 echo "SKIP: $$bn (ruby timeout)"; skip=$$((skip+1)); \
197218 else \