1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="generator" content="Docutils 0.5: http://docutils.sourceforge.net/">
<title>Bitten: Report Formats</title>
<link rel="stylesheet" href="common/style/edgewall.css" type="text/css">
</head>
<body>
<div class="document" id="report-formats">
<div id="navigation">
<span class="projinfo">Bitten 0.6</span>
<a href="index.html">Documentation Index</a>
</div>
<h1 class="title">Report Formats</h1>
<p>The base element of the report must be "report" and have an attribute
"category" that is one of "test", "coverage" or "lint":</p>
<div class="highlight"><pre><span class="nt"><report</span> <span class="na">category=</span><span class="s">"test|coverage|lint"</span><span class="nt">></span>
<span class="nt"></report></span>
</pre></div>
<p>Inside the report there must be elements for each report type. The way the
data is captured is pretty flexible because it can either be in attributes
or in child elements.</p>
<div class="section" id="test-reports">
<h1>Test Reports</h1>
<p>Test reports must have sub-elements of report of type <tt class="docutils literal"><span class="pre"><test</span> <span class="pre">/></span></tt>. These
elements can have any of these attributes (or subelements with contained
cdata):</p>
<table border="1" class="docutils">
<colgroup>
<col width="23%">
<col width="77%">
</colgroup>
<thead valign="bottom">
<tr><th class="head">Attribute</th>
<th class="head">Description</th>
</tr>
</thead>
<tbody valign="top">
<tr><td><tt class="docutils literal"><span class="pre">duration</span></tt></td>
<td>Duration of test (float)</td>
</tr>
<tr><td><tt class="docutils literal"><span class="pre">status</span></tt></td>
<td>"success", "failure", "error", or "ignore" (string)</td>
</tr>
<tr><td><tt class="docutils literal"><span class="pre">name</span></tt></td>
<td>Name of the test (string)</td>
</tr>
<tr><td><tt class="docutils literal"><span class="pre">fixture</span></tt></td>
<td>Name of the test fixture (string)</td>
</tr>
<tr><td><tt class="docutils literal"><span class="pre">file</span></tt></td>
<td>Path to test file relative to the base path for the
build configuration (string)</td>
</tr>
<tr><td><tt class="docutils literal"><span class="pre">stdout</span></tt></td>
<td>The output from the test (string)</td>
</tr>
<tr><td><tt class="docutils literal"><span class="pre">traceback</span></tt></td>
<td>The traceback from any error or failure (string)</td>
</tr>
</tbody>
</table>
<p>Example:</p>
<div class="highlight"><pre><span class="nt"><report</span> <span class="na">category=</span><span class="s">"test"</span><span class="nt">></span>
<span class="nt"><test</span> <span class="na">duration=</span><span class="s">"0.073"</span>
<span class="na">status=</span><span class="s">"success"</span>
<span class="na">fixture=</span><span class="s">"bitten.tests.model.BuildConfigTestCase"</span>
<span class="na">name=</span><span class="s">"test_config_update_name"</span>
<span class="na">file=</span><span class="s">"bitten/tests/model.py"</span>
<span class="na">stdout=</span><span class="s">"Renaming build configuration"</span>
<span class="na">traceback=</span><span class="s">"None"</span><span class="nt">></span>
<span class="nt"></test></span>
<span class="nt"><test></span>
<span class="nt"><duration></span>0.073<span class="nt"></duration></span>
<span class="nt"><status></span>success<span class="nt"></status></span>
<span class="nt"><fixture></span>bitten.tests.model.BuildConfigTestCase<span class="nt"></fixture></span>
<span class="nt"><name></span>test_config_update_name<span class="nt"></name></span>
<span class="nt"><file></span>bitten/tests/model.py<span class="nt"></file></span>
<span class="nt"><stdout></span>Renaming build configuration<span class="nt"></stdout></span>
<span class="nt"></test></span>
<span class="nt"></report></span>
</pre></div>
</div>
<div class="section" id="coverage-reports">
<h1>Coverage Reports</h1>
<p>Coverage reports must be inside <tt class="docutils literal"><span class="pre"><coverage</span> <span class="pre">/></span></tt> elements. The
allowable attributes are:</p>
<table border="1" class="docutils">
<colgroup>
<col width="23%">
<col width="77%">
</colgroup>
<thead valign="bottom">
<tr><th class="head">Attribute</th>
<th class="head">Description</th>
</tr>
</thead>
<tbody valign="top">
<tr><td><tt class="docutils literal"><span class="pre">name</span></tt></td>
<td>The name of the module being tested for coverage</td>
</tr>
<tr><td><tt class="docutils literal"><span class="pre">file</span></tt></td>
<td>The name of the file relative to the base path in the
build configuration</td>
</tr>
<tr><td><tt class="docutils literal"><span class="pre">percentage</span></tt></td>
<td>The percentage of lines in that file covered</td>
</tr>
<tr><td><tt class="docutils literal"><span class="pre">lines</span></tt></td>
<td>The number of lines covered</td>
</tr>
<tr><td><tt class="docutils literal"><span class="pre">line_hits</span></tt></td>
<td>Line-by-line coverage of the file, where code lines have
0 or more times covered and non-code lines are marked
as <cite>'-'</cite> (optional)</td>
</tr>
</tbody>
</table>
<p>Example:</p>
<div class="highlight"><pre><span class="nt"><report</span> <span class="na">category=</span><span class="s">"coverage"</span><span class="nt">></span>
<span class="nt"><coverage</span> <span class="na">name=</span><span class="s">"my_module"</span>
<span class="na">file=</span><span class="s">"my_module.py"</span>
<span class="na">percentage=</span><span class="s">"75"</span>
<span class="na">lines=</span><span class="s">"4"</span>
<span class="na">line_hits=</span><span class="s">"2 0 - 1 1"</span><span class="nt">></span>
<span class="nt"></coverage></span>
<span class="nt"></report></span>
</pre></div>
</div>
<div class="section" id="lint-reports">
<h1>Lint Reports</h1>
<p>Lint issues are placed inside <tt class="docutils literal"><span class="pre"><problem</span> <span class="pre">/></span></tt> elements, with allowed attributes of:</p>
<table border="1" class="docutils">
<colgroup>
<col width="23%">
<col width="77%">
</colgroup>
<thead valign="bottom">
<tr><th class="head">Attribute</th>
<th class="head">Description</th>
</tr>
</thead>
<tbody valign="top">
<tr><td><tt class="docutils literal"><span class="pre">file</span></tt></td>
<td>The name of the file relative to the base path in the
build configuration</td>
</tr>
<tr><td><tt class="docutils literal"><span class="pre">tag</span></tt></td>
<td>Class, method or other useful identifiable location
inside the file</td>
</tr>
<tr><td><tt class="docutils literal"><span class="pre">line</span></tt></td>
<td>Line number</td>
</tr>
<tr><td><tt class="docutils literal"><span class="pre">category</span></tt></td>
<td>Category for problem;
<tt class="docutils literal"><span class="pre">convention</span> <span class="pre">\|</span> <span class="pre">warning</span> <span class="pre">\|</span> <span class="pre">refactor</span> <span class="pre">\|</span> <span class="pre">error</span></tt></td>
</tr>
</tbody>
</table>
<p>Example:</p>
<div class="highlight"><pre><span class="nt"><report</span> <span class="na">category=</span><span class="s">"lint"</span><span class="nt">></span>
<span class="nt"><problem</span> <span class="na">category=</span><span class="s">"convention"</span>
<span class="na">line=</span><span class="s">"17"</span>
<span class="na">tag=</span><span class="s">"TestResultsChartGenerator"</span>
<span class="na">file=</span><span class="s">"bitten/report/testing.py"</span><span class="nt">></span>
Missing docstring
<span class="nt"></problem></span>
<span class="nt"></report></span>
</pre></div>
</div>
<div id="footer">
Visit the Bitten open source project at
<a href="http://bitten.edgewall.org/">http://bitten.edgewall.org/</a>
</div>
</div>
</body>
</html>
|