From: Eric S. Raymond Date: Fri, 14 Jul 2017 16:00:29 +0000 (-0400) Subject: More coverage improvements. X-Git-Tag: 1.3~103 X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=61570c700b609552eeb68bfc755ca5210ecbeadf;p=open-adventure.git More coverage improvements. --- diff --git a/tests/coverage_dungeon.py b/tests/coverage_dungeon.py index 512d7e3..0949dbe 100755 --- a/tests/coverage_dungeon.py +++ b/tests/coverage_dungeon.py @@ -3,8 +3,12 @@ # This is the open-adventure dungeon text coverage report generator. It # consumes a YAML description of the dungeon and determines whether the # various strings contained are present within the test check files. +# +# The default HTML output is appropriate for use with Gitlab CI. +# You can override it with a command-line argument. import os +import sys import yaml import re @@ -306,6 +310,9 @@ if __name__ == "__main__": print(" actions............: {}% covered ({} of {})".format(actions_percent, actions_covered, actions_total)) print(" specials...........: {}% covered ({} of {})".format(special_percent, special_covered, special_total)) + if len(sys.argv) > 1: + html_output_path = sys.argv[1] + # render HTML report with open(html_output_path, "w") as f: f.write(html_template.format( diff --git a/tests/defeat.chk b/tests/defeat.chk index dca937a..327aaa1 100644 --- a/tests/defeat.chk +++ b/tests/defeat.chk @@ -1342,6 +1342,11 @@ A glistening pearl falls out of the clam and rolls away. Goodness, this must really be an oyster. (I never was very good at identifying bivalves.) Whatever it is, it has now snapped shut again. +> open oyster + +The oyster creaks open, revealing nothing but oyster inside. It +promptly snaps shut again. + > s You're at complex junction. @@ -2096,6 +2101,9 @@ down a gully. > in +Tsk! A wizard wouldn't have to take 350 turns. This is going to cost +you a couple of points. + You're inside building. There is a golden chain lying in a heap on the floor! @@ -2130,9 +2138,6 @@ There are many coins here! > drop ruby -Tsk! A wizard wouldn't have to take 350 turns. This is going to cost -you a couple of points. - OK > drop sapphire @@ -2418,14 +2423,14 @@ You're in dusty rock room. > d -You're at complex junction. - -> e - Your lamp is getting dim. You'd best start wrapping this up, unless you can find some fresh batteries. I seem to recall there's a vending machine in the maze. Bring some coins with you. +You're at complex junction. + +> e + You are in an anteroom leading to a large passage to the east. Small passages go west and up. The remnants of recent digging are evident. A sign in midair here says "Cave under construction beyond this point. @@ -2642,14 +2647,14 @@ You're in Plover Room. > e +Your lamp has run out of power. + There is no way to go that direction. You're in Plover Room. > e -Your lamp has run out of power. - There is no way to go that direction. You're in Plover Room. @@ -2991,7 +2996,7 @@ There is a loud explosion, and a twenty-foot hole appears in the far wall, burying the snakes in the rubble. A river of molten lava pours in through the hole, destroying everything in its path, including you! -You scored 399 out of a possible 430, using 476 turns. +You scored 399 out of a possible 430, using 477 turns. Your score puts you in Master Adventurer Class B. diff --git a/tests/defeat.log b/tests/defeat.log index c1e1ab9..c371a9d 100644 --- a/tests/defeat.log +++ b/tests/defeat.log @@ -225,6 +225,7 @@ ne e n open clam +open oyster s u e