Moved dungeon.c and dungeon.h templates into external files.

Also refactored to use named vars in the templates, so it's easier to
refactor, as order when you call .format() isn't important.
This commit is contained in:
Aaron Traas 2017-07-23 12:07:10 -04:00
parent 8765f49fdc
commit 319c5830c8
5 changed files with 269 additions and 260 deletions

View file

@ -1,83 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Coverage - adventure.yaml</title>
<link rel="stylesheet" type="text/css" href="gcov.css">
<style>
.covered {{
text-align: center;
background-color: #A7FC9D;
}}
.covered::before {{
content: '\002714';
}}
.uncovered {{
text-align: center;
background-color: #FF0000;
}}
.uncovered::before {{
content: '\002715';
}}
</style>
</head>
<body>
<table width="100%" border=0 cellspacing=0 cellpadding=0>
<tr>
<td class="title" colspan="2">adventure.yaml Coverage report</td>
</tr>
<tr>
<td class="ruler" colspan="2"><img src="glass.png" width=3 height=3 alt=""></td>
</tr>
<tr valign="top">
<td>
<table cellpadding=1 border=0 width="100%">
<tr>
<td width="10%" class="headerItem">Test:</a></td>
<td width="35%" class="headerValue">adventure.yaml</td>
<td width="65%"></td>
</tr>
<tr>
<td class="headerItem">Date:</a></td>
<td class="headerValue">2017-07-07 21:47:56</td>
<td></td>
</tr>
</table>
</td>
<td>
<table cellpadding=1 border=0 width="100%">
<tr>
<td width="55%"></td>
<td width="15%" class="headerCovTableHead">Total</td>
<td width="15%" class="headerCovTableHead">Covered</td>
<td width="15%" class="headerCovTableHead">% Coverage</td>
</tr>
{summary}
</table>
</td>
</tr>
<tr>
<td><img src="glass.png" width=3 height=3 alt=""></td>
</tr>
<tr>
<td class="ruler" colspan="2"><img src="glass.png" width=3 height=3 alt=""></td>
</tr>
</table>
<br>
<center>
<table width="60%" border=0 cellpadding=1 cellspacing=1>
{categories}
</table>
</center>
<br>
<table width="100%" border=0 cellspacing=0 cellpadding=0>
<tr>
<td class="ruler"><img src="glass.png" width=3 height=3 alt=""></td>
</tr>
<tr>
<td class="versionInfo">Generated by: <a href="https://gitlab.com/esr/open-adventure/blob/master/tests/coverage_dungeon.py">Open Adventure Dungeon Coverage Generator</a></td>
</tr>
</table>
<br>
</body>
</html>

View file

@ -14,7 +14,7 @@ import re
TEST_DIR = "."
YAML_PATH = "../adventure.yaml"
HTML_TEMPLATE_PATH = "coverage_dungeon.html.tpl"
HTML_TEMPLATE_PATH = "../templates/coverage_dungeon.html.tpl"
DEFAULT_HTML_OUTPUT_PATH = "../coverage/adventure.yaml.html"
STDOUT_REPORT_CATEGORY = " {name:.<19}: {percent:5.1f}% covered ({covered} of {total})\n"