X-Git-Url: https://jxself.org/git/?p=open-adventure.git;a=blobdiff_plain;f=tests%2Fcoverage_dungeon.py;h=0949dbefba786e946caf446e18c62bc417a2b2ba;hp=512d7e36e8138c12d56507b99610cd74b790dd90;hb=61570c700b609552eeb68bfc755ca5210ecbeadf;hpb=66fba512a7c3bb8db96e46911fabb53a1042f2a2 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(