2
0
mirror of https://github.com/boostorg/test.git synced 2026-02-18 02:22:09 +00:00
Files
test/doc/v2/html/boost_test/tests_organization.html
2014-02-06 12:04:00 +01:00

106 lines
6.2 KiB
HTML

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>Test organization... or the house that Jack built</title>
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
<link rel="home" href="../index.html" title="Boost.Test">
<link rel="up" href="../index.html" title="Boost.Test">
<link rel="prev" href="users_guide/usage_variants/extern_test_runner_variant.html" title="The external test runner variant of the UTF">
<link rel="next" href="tests_organization/test_cases.html" title="Test cases">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="users_guide/usage_variants/extern_test_runner_variant.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.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="tests_organization/test_cases.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="boost_test.tests_organization"></a><a class="link" href="tests_organization.html" title="Test organization... or the house that Jack built">Test organization... or
the house that Jack built</a>
</h2></div></div></div>
<div class="toc"><dl class="toc">
<dt><span class="section"><a href="tests_organization/test_cases.html">Test cases</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="tests_organization/test_cases/test_organization_nullary.html">Nullary
function based test case</a></span></dt>
<dt><span class="section"><a href="tests_organization/test_cases/unary_function_based_test_case.html">Unary
function based test case</a></span></dt>
<dt><span class="section"><a href="tests_organization/test_cases/test_organization_templates.html">Template
test cases</a></span></dt>
</dl></dd>
<dt><span class="section"><a href="tests_organization/test_organization_test_suite.html">Test
suite</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="tests_organization/test_organization_test_suite/master_test_suite.html">Master
Test Suite</a></span></dt>
<dt><span class="section"><a href="tests_organization/test_organization_test_suite/expected_failures_specification.html">Expected
failures specification</a></span></dt>
</dl></dd>
</dl></div>
<p>
If you look at many legacy test modules, big chance is that it's implemented
as one big test function that consists of a mixture of check and output statements.
Is there anything wrong with it? Yes. There are various disadvantages in single
test function approach:
</p>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
One big function tends to become really difficult to manage if the number
of checks exceeds a reasonable limit (true for any large function). What
is tested and where - who knows?
</li>
<li class="listitem">
Many checks require similar preparations. This results in code repetitions
within the test function.
</li>
<li class="listitem">
If a fatal error or an exception is caused by any checks within the test
function the rest of tests are skipped and there is no way to prevent this.
</li>
<li class="listitem">
No way to perform only checks for a particular subsystem of the tested
unit.
</li>
<li class="listitem">
No summary of how different subsystems of the tested unit performed under
in the test.
</li>
</ul></div>
<p>
The above points should make it clear that it's preferable to split <span class="bold"><strong>test module</strong></span> into smaller units. These units are <span class="bold"><strong>test cases</strong></span>.
</p>
<p>
To solve test tree creation problem the <span class="emphasis"><em>UTF</em></span> provides facilities
for <span class="bold"><strong>test suite creation</strong></span>.
</p>
<p>
In some cases it's desirable to allow some <span class="emphasis"><em>expected</em></span> failures
in test case without failing a test module. To support this request The <span class="emphasis"><em>UTF</em></span>
allows specifying the number of <span class="bold"><strong>expected failures</strong></span>
in a test case.
</p>
</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-2013 Gennadiy Rozental<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="users_guide/usage_variants/extern_test_runner_variant.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.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="tests_organization/test_cases.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>