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/users_guide/module_initialization.html
2014-08-20 03:13:21 +02:00

117 lines
6.8 KiB
HTML

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>Test module initialization</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="../users_guide.html" title="Building a test module with the UTF">
<link rel="prev" href="../users_guide.html" title="Building a test module with the UTF">
<link rel="next" href="module_initialization/custom_module_initialisation.html" title="Custom module initialisation">
</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.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../users_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="module_initialization/custom_module_initialisation.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="boost_test.users_guide.module_initialization"></a><a class="link" href="module_initialization.html" title="Test module initialization">Test module
initialization</a>
</h3></div></div></div>
<div class="toc"><dl class="toc">
<dt><span class="section"><a href="module_initialization/custom_module_initialisation.html">Custom
module initialisation</a></span></dt>
<dt><span class="section"><a href="module_initialization/module_initialisation_automated.html">Automated
generation</a></span></dt>
</dl></div>
<p>
As explained in the introductory material, the <span class="emphasis"><em>module initialization</em></span>
part of the <span class="emphasis"><em>UTF</em></span> prepares the test module for execution,
including:
</p>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
the construction of the test tree
</li>
<li class="listitem">
some optional custom initialisations
</li>
</ul></div>
<div class="caution"><table border="0" summary="Caution">
<tr>
<td rowspan="2" align="center" valign="top" width="25"><img alt="[Caution]" src="../../../../../../../doc/src/images/caution.png"></td>
<th align="left">Caution</th>
</tr>
<tr><td align="left" valign="top">
<p>
The elementary question one should ask himself is the following:
</p>
<div class="blockquote"><blockquote class="blockquote"><p>
<span class="quote">&#8220;<span class="quote">Is there really a need for implementing the module initialisation
by yourself?</span>&#8221;</span>
</p></blockquote></div>
</td></tr>
</table></div>
<p>
The argument against the implementation of a custom <span class="emphasis"><em>module initialization</em></span>
are the following:
</p>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
The test tree can be easily and efficiently constructed automatically
(covered in details in <a class="link" href="../tests_organization.html" title="Registering, generating and organizing the unit tests">this</a>
section).
</li>
<li class="listitem">
<span class="emphasis"><em>UTF</em></span> also provides means to <a class="link" href="../tests_organization/test_organization_test_suite/master_test_suite.html#ref_BOOST_TEST_MODULE">rename</a>
the <span class="emphasis"><em>master test suite</em></span>.
</li>
<li class="listitem">
Most of the command line parameters, except the ones used by the <span class="emphasis"><em>UTF</em></span>,
may be accessed through the <span class="emphasis"><em>master test suite</em></span>
</li>
<li class="listitem">
<a class="link" href="../tests_organization/fixtures/global_fixture.html#ref_fixture_test_global">Global fixtures</a> may provide
<span class="emphasis"><em>states</em></span> that can be accessed during the lifetime
of the tests, with proper and controlled initialization and release.
This approach covers several use case that might need the tweaking of
the initialization functions, adding the robustness of the <span class="emphasis"><em>UTF</em></span>
in the initialization and release themselves.
</li>
<li class="listitem">
If the test module is old and the need for <span class="emphasis"><em>module initialization</em></span>
is just driven by legacy code, then considering updating this part might
be a good choice.
</li>
</ul></div>
<p>
From the points above, if the need for <span class="emphasis"><em>module initialization</em></span>
is not there anymore, then you may jump directly to the <a class="link" href="module_initialization/module_initialisation_automated.html" title="Automated generation">automated
section</a> directly.
</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-2014 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.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../users_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="module_initialization/custom_module_initialisation.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>