From dc8b19bcdc00586af906af4147855662efb5287e Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Thu, 23 Mar 2023 05:38:26 -0400 Subject: [PATCH] Implement NOCOMPARE magic. --- tests/Makefile | 18 +++++++++++++++--- tests/birdweight.log | 1 + tests/endobjects.log | 1 + tests/resumefail.log | 3 ++- tests/resumefail2.log | 3 ++- tests/savefail.log | 3 ++- tests/saveresume.3.log | 3 ++- tests/saveresume.4.log | 1 + tests/specials.log | 1 + 9 files changed, 27 insertions(+), 7 deletions(-) diff --git a/tests/Makefile b/tests/Makefile index f2addb9..8d61d27 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -133,11 +133,23 @@ count: # 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. # 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) @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 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 + @-(for x in *.log; do \ + 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 # end diff --git a/tests/birdweight.log b/tests/birdweight.log index bc07eb6..80cc3a6 100644 --- a/tests/birdweight.log +++ b/tests/birdweight.log @@ -1,5 +1,6 @@ ## Verify that the bird is weightless in inventory # Checks fix for GitLab issue #40 +#NOCOMPARE Bird was not weightless in cage in advent430 so this test is invalid. n #seed 687800971 seed 976729036 diff --git a/tests/endobjects.log b/tests/endobjects.log index e532df0..6bec970 100644 --- a/tests/endobjects.log +++ b/tests/endobjects.log @@ -1,5 +1,6 @@ ### Check that water is unavailable in endgame # 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 seed 11247848 no diff --git a/tests/resumefail.log b/tests/resumefail.log index 053b05f..1e1fdb5 100644 --- a/tests/resumefail.log +++ b/tests/resumefail.log @@ -1,6 +1,7 @@ ## Resume from invalid filename +#NOCOMPARE advent430 crashes on resume fom invalid filename and we don't care. n seed 1240742801 resume y -/badfilename \ No newline at end of file +/badfilename diff --git a/tests/resumefail2.log b/tests/resumefail2.log index 2754454..7aaac36 100644 --- a/tests/resumefail2.log +++ b/tests/resumefail2.log @@ -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 resume y diff --git a/tests/savefail.log b/tests/savefail.log index f907d99..c598d19 100644 --- a/tests/savefail.log +++ b/tests/savefail.log @@ -1,6 +1,7 @@ ## Save right after starting to invalid filename +#NOCOMPARE advent430 crashes on save to invalid filename and we don't care. n seed 1240742801 save y -/ \ No newline at end of file +/ diff --git a/tests/saveresume.3.log b/tests/saveresume.3.log index 13ed0be..f199c64 100644 --- a/tests/saveresume.3.log +++ b/tests/saveresume.3.log @@ -1,5 +1,6 @@ ## Almost win, then save # Based on walkthrough at http://www.ecsoftwareconsulting.com/node/56 +#NOCOMPARE seems to reveal a bug in advent430 n seed 1838473132 in @@ -473,4 +474,4 @@ sw save y saveresume_win.adv -y \ No newline at end of file +y diff --git a/tests/saveresume.4.log b/tests/saveresume.4.log index caa8098..883d098 100644 --- a/tests/saveresume.4.log +++ b/tests/saveresume.4.log @@ -1,6 +1,7 @@ ## Resume, then win # Here to get class threshold of 426 # Note, savefile name has trailing space +#NOCOMPARE Reveals that advent430 does not resume in endgame gracefully. n resume y diff --git a/tests/specials.log b/tests/specials.log index 2891691..4784faf 100644 --- a/tests/specials.log +++ b/tests/specials.log @@ -1,4 +1,5 @@ ## Test special words +#NOCOMPARE The news text has changed n thank shazam -- 2.31.1