Implement NOCOMPARE magic.

This commit is contained in:
Eric S. Raymond 2023-03-23 05:38:26 -04:00
parent 2070db3a2a
commit dc8b19bcdc
9 changed files with 27 additions and 7 deletions

View file

@ -133,11 +133,23 @@ count:
# The diff file produced has corrected spellings in it. That's what oldfilter # The diff file produced has corrected spellings in it. That's what oldfilter
# is for, to massage out the orioginal dpellings and avoid noise diffs. # is for, to massage out the orioginal dpellings and avoid noise diffs.
# Diffs in amount of whitespace and trailing whitespace are ignored # Diffs in amount of whitespace and trailing whitespace are ignored
#
# A magic comment of NOCOMPARE in a log file excludes it from this comparison.
# First use of this is to avoid a spurious mismatch on the news text.
TAPFILTER=tapview
ancient: $(SGAMES) ancient: $(SGAMES)
@if [ -f ../advent430 ]; then cp ../advent430 ../adventure.data .; else echo "advent430 nonexistent"; exit 1; fi @if [ -f ../advent430 ]; then cp ../advent430 ../adventure.data .; else echo "advent430 nonexistent"; exit 1; fi
@-for x in *.log; do stem=$${x%.log}; echo $${stem}; ./advent430 <$${stem}.log | ./oldfilter >$${stem}.ochk; done @-(for x in *.log; do \
@-(for x in *.log; do stem=$${x%.log}; legend=$$(sed -n '/^## /s///p' <$$x 2>/dev/null || echo "(no description)"); ./newfilter <$${stem}.chk | tapdiffer -w "$${legend}" $${stem}.ochk; done; echo 1..$(words $(shell ls *.log))) | tapview stem=$${x%.log}; \
legend=$$(sed -n '/^## /s///p' <$$x 2>/dev/null || echo "(no description)"); \
if grep NOCOMPARE $$x >/dev/null; \
then echo "not ok - $${stem}.ochk: $${legend} # SKIP"; \
else \
./advent430 <$${stem}.log | oldfilter >$${stem}.ochk; \
./newfilter <$${stem}.chk | tapdiffer -w "$${stem}: $${legend}" $${stem}.ochk; \
fi; \
done; \
echo 1..$(words $(shell ls *.log))) | $(TAPFILTER)
@rm *.ochk advent430 adventure.data @rm *.ochk advent430 adventure.data
# end # end

View file

@ -1,5 +1,6 @@
## Verify that the bird is weightless in inventory ## Verify that the bird is weightless in inventory
# Checks fix for GitLab issue #40 # Checks fix for GitLab issue #40
#NOCOMPARE Bird was not weightless in cage in advent430 so this test is invalid.
n n
#seed 687800971 #seed 687800971
seed 976729036 seed 976729036

View file

@ -1,5 +1,6 @@
### Check that water is unavailable in endgame ### Check that water is unavailable in endgame
# Addresses GitLab issue #55: in endgame, some object starting states are incorrect # Addresses GitLab issue #55: in endgame, some object starting states are incorrect
#NOCOMPARE Bird was not weightless in cade in advent430, this test depends on that.
no no
seed 11247848 seed 11247848
no no

View file

@ -1,4 +1,5 @@
## Resume from invalid filename ## Resume from invalid filename
#NOCOMPARE advent430 crashes on resume fom invalid filename and we don't care.
n n
seed 1240742801 seed 1240742801
resume resume

View file

@ -1,4 +1,5 @@
## Resume from from generated save with version mismatch error ## Resume from from generated save with version mismatch error
#NOCOMPARE Reveals a bug in advent430 handling of saves with invalid versions.
n n
resume resume
y y

View file

@ -1,4 +1,5 @@
## Save right after starting to invalid filename ## Save right after starting to invalid filename
#NOCOMPARE advent430 crashes on save to invalid filename and we don't care.
n n
seed 1240742801 seed 1240742801
save save

View file

@ -1,5 +1,6 @@
## Almost win, then save ## Almost win, then save
# Based on walkthrough at http://www.ecsoftwareconsulting.com/node/56 # Based on walkthrough at http://www.ecsoftwareconsulting.com/node/56
#NOCOMPARE seems to reveal a bug in advent430
n n
seed 1838473132 seed 1838473132
in in

View file

@ -1,6 +1,7 @@
## Resume, then win ## Resume, then win
# Here to get class threshold of 426 # Here to get class threshold of 426
# Note, savefile name has trailing space # Note, savefile name has trailing space
#NOCOMPARE Reveals that advent430 does not resume in endgame gracefully.
n n
resume resume
y y

View file

@ -1,4 +1,5 @@
## Test special words ## Test special words
#NOCOMPARE The news text has changed
n n
thank thank
shazam shazam