2
0
mirror of https://github.com/boostorg/test.git synced 2026-01-25 06:42:22 +00:00
Files
test/old_doc/html/utf/user-guide/testing-tools.html
Raffi Enficiaud bc2cd6cfaa Moving the new documentation to doc/
Moving the old documentation to old_doc/
2014-12-30 23:50:30 +01:00

127 lines
7.1 KiB
HTML

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>The UTF testing tools &#8230; or tester's toolbox for all occasions</title>
<link rel="stylesheet" href="../../../style/style.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
<link rel="home" href="../../index.html" title="Boost Test Library">
<link rel="up" href="../user-guide.html" title="Unit Test Framework: User's guide">
<link rel="prev" href="test-organization/expected-failures.html" title="Expected failures specification">
<link rel="next" href="testing-tools/output-test.html" title="Output testing tool">
<script language="JavaScript1.2" src="../../../js/boost-test.js"></script>
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table width="100%"><tr>
<td width="10%"><a href="../../index.html"><img alt="Home" width="229" height="61" border="0" src="../../../../../../libs/test/doc/img/boost.test.logo.png"></a></td>
<td valign="middle" align="left"> &gt; <a href="../../utf.html">The Unit Test Framework</a><a href="../../execution-monitor.html">
&gt;
</a><a href="../user-guide.html">User's guide</a><a href="../usage-recommendations.html">
&gt;
</a><b>Testing tools</b><a href="test-output.html">
&gt;
</a>
</td>
<td><div class="spirit-nav">
<a href="test-organization/expected-failures.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a href="testing-tools/output-test.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div></td>
</tr></table>
<hr>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="utf.user-guide.testing-tools"></a>The <acronym class="acronym">UTF</acronym> testing tools &#8230; or tester's toolbox for all occasions</h4></div></div></div>
<div class="section">
<div class="titlepage"><div><div><h5 class="title">
<a name="utf.user-guide.testing-tools.intro"></a>Introduction</h5></div></div></div>
<p class="first-line-indented">
The <acronym class="acronym">UTF</acronym>'s supplies a toolbox of testing tools to ease creation and maintenance of test programs and
provide a uniform error reporting mechanism. The toolbox supplied in most part in a form of macro and function
declarations. While the functions can be called directly, the usual way to use testing tools is via convenience
macros. All macros arguments are calculated once, so it's safe to pass complex expressions in their place.
All tools automatically supply an error location: a file name and a line number. The testing tools are intended
for unit test code rather than library or production code, where throwing exceptions, using assert(),
<code class="computeroutput">boost::concept_check</code> or <code class="computeroutput">BOOST_STATIC_ASSERT</code>() may be more suitable
ways to detect and report errors. For list of all supplied testing tools and usage examples see the reference.
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h5 class="title">
<a name="utf.user-guide.testing-tools.flavors"></a>Testing tools flavors</h5></div></div></div>
<p class="first-line-indented">
All the tools are supplied in three flavors(levels): <em class="firstterm">WARN</em>, <em class="firstterm">CHECK</em> and
<em class="firstterm">REQUIRE</em>. For example: <code class="computeroutput"><a class="link" href="testing-tools/reference.html" title="The UTF testing tools reference">BOOST_WARN_EQUAL</a></code>,
<code class="computeroutput"><a class="link" href="testing-tools/reference.html" title="The UTF testing tools reference">BOOST_CHECK_EQUAL</a></code>, <code class="computeroutput"><a class="link" href="testing-tools/reference.html" title="The UTF testing tools reference">BOOST_REQUIRE_EQUAL</a></code>. If an assertion designated by
the tool passes, confirmation message can be printed in log output<sup>[<a name="id536058" href="#ftn.id536058" class="footnote">4</a>]</sup>. If an assertion designated by the tool failed, depending on the level following
will happened<sup>[<a name="id536066" href="#ftn.id536066" class="footnote">5</a>]</sup>:
</p>
<div class="table">
<a name="utf.user-guide.testing-tools.levels-diffs"></a><p class="title"><b>Table&#160;2.&#160;Testing tools levels differences</b></p>
<div class="table-contents"><table class="table" summary="Testing tools levels differences">
<colgroup>
<col class="col1">
<col class="col2">
<col class="col3">
<col class="col4">
</colgroup>
<thead><tr>
<th>Level</th>
<th>Test log content</th>
<th>Errors counter</th>
<th>Test execution</th>
</tr></thead>
<tbody>
<tr>
<td>WARN</td>
<td>
warning in <em class="replaceable"><code>&lt;test case name&gt;</code></em>: condition
<em class="replaceable"><code>&lt;assertion description&gt;</code></em> is not satisfied
</td>
<td>not affected</td>
<td>continues</td>
</tr>
<tr>
<td>CHECK</td>
<td>
error in <em class="replaceable"><code>&lt;test case name&gt;</code></em>: test
<em class="replaceable"><code>&lt;assertion description&gt;</code></em> failed
</td>
<td>increased</td>
<td>continues</td>
</tr>
<tr>
<td>REQUIRE</td>
<td>
fatal error in <em class="replaceable"><code>&lt;test case name&gt;</code></em>: critical test
<em class="replaceable"><code>&lt;assertion description&gt;</code></em> failed
</td>
<td>increased</td>
<td>aborts</td>
</tr>
</tbody>
</table></div>
</div>
<br class="table-break"><p class="first-line-indented">
Regularly you should use CHECK level tools to implement your assertions. You can use WARN level tools to validate
aspects less important then correctness: performance, portability, usability etc. You should use REQUIRE level
tools only if continuation of the test case doesn't make sense if this assertions fails.
</p>
</div>
<div class="footnotes">
<br><hr width="100" align="left">
<div class="footnote"><p><sup>[<a id="ftn.id536058" href="#id536058" class="simpara">4</a>] </sup>to manage what messages appear
in the test log stream set the proper <a class="link" href="test-output/test-log.html" title="Test log output">log
level</a></p></div>
<div class="footnote"><p><sup>[<a id="ftn.id536066" href="#id536066" class="simpara">5</a>] </sup>in some cases log message can be slightly different to reflect failed tool
specifics</p></div>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2001-2012 Gennadiy Rozental</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="test-organization/expected-failures.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../user-guide.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="testing-tools/output-test.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>