mirror of
https://github.com/boostorg/test.git
synced 2026-01-24 18:32:30 +00:00
134 lines
7.3 KiB
HTML
Executable File
134 lines
7.3 KiB
HTML
Executable File
<html>
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
|
|
<title>The UTF testing tools … 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="../utf.html" title="Boost Test Library: The Unit Test Framework">
|
|
<link rel="prev" href="user-guide/glossary.html" title="Introduction … or what's your name?">
|
|
<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/docbook/img/boost.test.logo.png"></a></td>
|
|
<td valign="middle" align="left"> > <a href="../utf.html">The Unit Test Framework</a><a href="../execution-monitor.html">
|
|
>
|
|
</a><b>Testing tools</b><a href="usage-recommendations.html">
|
|
>
|
|
</a>
|
|
</td>
|
|
<td><div class="spirit-nav">
|
|
<a href="user-guide/glossary.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><h3 class="title">
|
|
<a name="utf.testing-tools"></a>The <acronym class="acronym">UTF</acronym> testing tools … or tester's toolbox for all occasions</h3></div></div></div>
|
|
<div class="toc">
|
|
<p><b>Table of Contents</b></p>
|
|
<dl>
|
|
<dt><a href="testing-tools/output-test.html">Output testing tool</a></dt>
|
|
<dt><a href="testing-tools/custom-predicate.html">Custom predicate support</a></dt>
|
|
<dt><a href="testing-tools/floating_point_comparison.html">Floating-point comparison algorithms</a></dt>
|
|
<dt><a href="testing-tools/reference.html">Reference</a></dt>
|
|
</dl>
|
|
</div>
|
|
<div class="section">
|
|
<div class="titlepage"><div><div><h4 class="title">
|
|
<a name="utf.testing-tools.intro"></a>Introduction</h4></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><h4 class="title">
|
|
<a name="utf.testing-tools.flavors"></a>Testing tools flavors</h4></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="id592519" href="#ftn.id592519" class="footnote">4</a>]</sup>. If an assertion designated by the tool failed, depending on the level following
|
|
will happened<sup>[<a name="id592527" href="#ftn.id592527" class="footnote">5</a>]</sup>:
|
|
</p>
|
|
<div class="table">
|
|
<a name="utf.testing-tools.levels-diffs"></a><p class="title"><b>Table 3. 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><test case name></code></em>: condition
|
|
<em class="replaceable"><code><assertion description></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><test case name></code></em>: test
|
|
<em class="replaceable"><code><assertion description></code></em> failed
|
|
</td>
|
|
<td>increased</td>
|
|
<td>continues</td>
|
|
</tr>
|
|
<tr>
|
|
<td>REQUIRE</td>
|
|
<td>
|
|
fatal error in <em class="replaceable"><code><test case name></code></em>: critical test
|
|
<em class="replaceable"><code><assertion description></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.id592519" href="#id592519" class="simpara">4</a>] </sup>to manage what messages appear
|
|
in the test log stream set the proper <a class="link" href="user-guide/test-output/test-log.html" title="Test log output">log
|
|
level</a></p></div>
|
|
<div class="footnote"><p><sup>[<a id="ftn.id592527" href="#id592527" 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"><p><small>Last revised: , at </small></p></td>
|
|
<td align="right"><div class="copyright-footer">Copyright © 2001-2011 Gennadiy Rozental</div></td>
|
|
</tr></table>
|
|
<hr>
|
|
<div class="spirit-nav">
|
|
<a accesskey="p" href="user-guide/glossary.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../utf.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>
|