projects
/
open-adventure.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
5ce427b
)
Another coverage tweak.
author
Eric S. Raymond
<esr@thyrsus.com>
Thu, 15 Nov 2018 18:23:16 +0000
(13:23 -0500)
committer
Eric S. Raymond
<esr@thyrsus.com>
Thu, 15 Nov 2018 18:23:16 +0000
(13:23 -0500)
tests/coverage_dungeon.py
patch
|
blob
|
history
diff --git
a/tests/coverage_dungeon.py
b/tests/coverage_dungeon.py
index 6484fa79b008f0ff15d95bd6e530c0cc5275e3a3..365995ce644598d9178f8cd976e8a19b50a052c9 100755
(executable)
--- a/
tests/coverage_dungeon.py
+++ b/
tests/coverage_dungeon.py
@@
-6,6
+6,10
@@
#
# The default HTML output is appropriate for use with Gitlab CI.
# You can override it with a command-line argument.
#
# The default HTML output is appropriate for use with Gitlab CI.
# You can override it with a command-line argument.
+#
+# The DANGLING list is for actions that should be considered always found
+# even if the checkfile search doesn't find them. Typically this will because
+# they emit a templated message that can't be regression-tested by equality.
import os
import sys
import os
import sys
@@
-16,6
+20,7
@@
TEST_DIR = "."
YAML_PATH = "../adventure.yaml"
HTML_TEMPLATE_PATH = "../templates/coverage_dungeon.html.tpl"
DEFAULT_HTML_OUTPUT_PATH = "../coverage/adventure.yaml.html"
YAML_PATH = "../adventure.yaml"
HTML_TEMPLATE_PATH = "../templates/coverage_dungeon.html.tpl"
DEFAULT_HTML_OUTPUT_PATH = "../coverage/adventure.yaml.html"
+DANGLING = ["ACT_VERSION"]
STDOUT_REPORT_CATEGORY = " {name:.<19}: {percent:5.1f}% covered ({covered} of {total})\n"
STDOUT_REPORT_CATEGORY = " {name:.<19}: {percent:5.1f}% covered ({covered} of {total})\n"
@@
-158,7
+163,7
@@
def actions_coverage(items, text, report):
if name not in report["messages"]:
report["messages"][name] = {"covered" : False}
report["total"] += 1
if name not in report["messages"]:
report["messages"][name] = {"covered" : False}
report["total"] += 1
- if report["messages"][name]["covered"] != True and
search(item["message"], text
):
+ if report["messages"][name]["covered"] != True and
(search(item["message"], text) or name in DANGLING
):
report["messages"][name]["covered"] = True
report["covered"] += 1
report["messages"][name]["covered"] = True
report["covered"] += 1
@@
-175,7
+180,7
@@
def coverage_report(db, check_file_contents):
"messages" : {}
}
"messages" : {}
}
- # search for each message in ever test check file
+ # search for each message in ever
y
test check file
for chk in check_file_contents:
arb_coverage(db["arbitrary_messages"], chk, report["arbitrary_messages"])
hint_coverage(db["hints"], chk, report["hints"])
for chk in check_file_contents:
arb_coverage(db["arbitrary_messages"], chk, report["arbitrary_messages"])
hint_coverage(db["hints"], chk, report["hints"])