fix handling of QUIET in the "test" directory

This commit is contained in:
mrdudz
2025-06-26 19:48:16 +02:00
parent 73869a6f38
commit 7a85575158
14 changed files with 86 additions and 49 deletions

View File

@@ -17,6 +17,7 @@ ifdef CMD_EXE
RMDIR = -rmdir /q /s $(subst /,\,$1)
TRUE = exit 0
CAT = type $(subst /,\,$1)
NULLDEV = nul:
else
S = /
EXE =
@@ -24,10 +25,14 @@ else
RMDIR = $(RM) -r $1
TRUE = true
CAT = cat $1
NULLDEV = /dev/null
endif
ifdef QUIET
.SILENT:
NULLOUT = >$(NULLDEV)
NULLERR = 2>$(NULLDEV)
CATERR = 2> $(WORKDIR)/$$@.errlog || (cat $(WORKDIR)/$$@.errlog && false)
endif
CA65 := $(if $(wildcard ../../../bin/ca65*),..$S..$S..$Sbin$Sca65,ca65)
@@ -82,48 +87,52 @@ endif
endif
ifneq ($(wildcard ref/$1.err-ref),)
$(ISEQUAL) ref/$1.err-ref $$(@:.bin=.err)
$(ISEQUAL) ref/$1.err-ref $$(@:.bin=.err) $(NULLERR)
else
$(ISEQUAL) --empty $$(@:.bin=.err)
$(ISEQUAL) --empty $$(@:.bin=.err) $(NULLERR)
endif
ifneq ($(wildcard ref/$1.err2-ref),)
$(ISEQUAL) ref/$1.err2-ref $$(@:.bin=.err2)
$(ISEQUAL) ref/$1.err2-ref $$(@:.bin=.err2) $(NULLERR)
else
$(ISEQUAL) --empty $$(@:.bin=.err2)
$(ISEQUAL) --empty $$(@:.bin=.err2) $(NULLERR)
endif
ifneq ($(wildcard ref/$1.bin-ref),)
$(ISEQUAL) --binary ref/$1.bin-ref $$@
$(ISEQUAL) --binary ref/$1.bin-ref $$@ $(NULLERR)
endif
# rem $(indfo $(CAT) $(subst /,$$S,$$$(@:.bin=.ld65-err)))
ifneq ($(wildcard ref/$1.ld65err-ref),)
ifndef QUIET
@echo $(CAT) $$(@:.bin=.ld65-err)
# FIXME: somehow this refuses to work in cmd.exe
ifndef CMD_EXE
$(call CAT,$$(@:.bin=.ld65-err))
-diff -u ref/$1.ld65err-ref $$(@:.bin=.ld65-err)
endif
$(ISEQUAL) --wildcards ref/$1.ld65err-ref $$(@:.bin=.ld65-err)
endif
$(ISEQUAL) --wildcards ref/$1.ld65err-ref $$(@:.bin=.ld65-err) $(NULLERR)
else
ifneq ($(wildcard $(WORKDIR)/$1.ld65-err),)
$(ISEQUAL) --empty $$(@:.bin=.ld65-err)
$(ISEQUAL) --empty $$(@:.bin=.ld65-err) $(NULLERR)
endif
endif
ifneq ($(wildcard ref/$1.ld65err2-ref),)
ifndef QUIET
@echo $(CAT) $$(@:.bin=.ld65-err2)
# FIXME: somehow this refuses to work in cmd.exe
ifndef CMD_EXE
$(call CAT,$$(@:.bin=.ld65-err2))
-diff -u ref/$1.ld65err2-ref $$(@:.bin=.ld65-err2)
endif
$(ISEQUAL) --wildcards ref/$1.ld65err2-ref $$(@:.bin=.ld65-err2)
endif
$(ISEQUAL) --wildcards ref/$1.ld65err2-ref $$(@:.bin=.ld65-err2) $(NULLERR)
else
ifneq ($(wildcard $(WORKDIR)/$1.ld65-err2),)
$(ISEQUAL) --empty $$(@:.bin=.ld65-err2)
$(ISEQUAL) --empty $$(@:.bin=.ld65-err2) $(NULLERR)
endif
endif
@@ -149,37 +158,37 @@ endif
endif
ifneq ($(wildcard ref/$1.err-ref),)
$(ISEQUAL) ref/$1.err-ref $$(@:.bin=.list-err)
$(ISEQUAL) ref/$1.err-ref $$(@:.bin=.list-err) $(NULLERR)
else
$(ISEQUAL) --empty $$(@:.bin=.list-err)
$(ISEQUAL) --empty $$(@:.bin=.list-err) $(NULLERR)
endif
ifneq ($(wildcard ref/$1.ld65err-ref),)
$(ISEQUAL) --wildcards ref/$1.ld65err-ref $$(@:.bin=.list-ld65-err)
$(ISEQUAL) --wildcards ref/$1.ld65err-ref $$(@:.bin=.list-ld65-err) $(NULLERR)
else
ifneq ($(wildcard $(WORKDIR)/$1.list-ld65-err),)
$(ISEQUAL) --empty $$(@:.bin=.list-ld65-err)
$(ISEQUAL) --empty $$(@:.bin=.list-ld65-err) $(NULLERR)
endif
endif
ifneq ($(wildcard ref/$1.err2-ref),)
$(ISEQUAL) ref/$1.err2-ref $$(@:.bin=.list-err2)
$(ISEQUAL) ref/$1.err2-ref $$(@:.bin=.list-err2) $(NULLERR)
else
$(ISEQUAL) --empty $$(@:.bin=.list-err2)
$(ISEQUAL) --empty $$(@:.bin=.list-err2) $(NULLERR)
endif
ifneq ($(wildcard ref/$1.ld65err2-ref),)
$(ISEQUAL) --wildcards ref/$1.ld65err2-ref $$(@:.bin=.list-ld65-err2)
$(ISEQUAL) --wildcards ref/$1.ld65err2-ref $$(@:.bin=.list-ld65-err2) $(NULLERR)
else
ifneq ($(wildcard $(WORKDIR)/$1.list-ld65-err2),)
$(ISEQUAL) --empty $$(@:.bin=.list-ld65-err2)
$(ISEQUAL) --empty $$(@:.bin=.list-ld65-err2) $(NULLERR)
endif
endif
# check if the result bin is the same as without listing file
ifeq ($(wildcard control/$1.err),)
ifeq ($(wildcard control/$1.err2),)
$(ISEQUAL) $$@ $$(@:.bin=.list-bin)
$(ISEQUAL) $$@ $$(@:.bin=.list-bin) $(NULLERR)
endif
endif
@@ -187,7 +196,7 @@ ifneq ($(wildcard ref/$1.list-ref),)
# we have a reference file, compare that, too
# remove first line which contains a version number
$(ISEQUAL) --skip=1 ref/$1.list-ref $$(@:.bin=.list-lst)
$(ISEQUAL) --skip=1 ref/$1.list-ref $$(@:.bin=.list-lst) $(NULLERR)
endif
endef # LISTING_template