boost/libs/test/doc/html/boost_test/adv_scenarios.html
2021-10-05 21:37:46 +02:00

124 lines
8.1 KiB
HTML

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Advanced Usage Scenarios</title>
<link rel="stylesheet" href="../boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../index.html" title="Boost.Test">
<link rel="up" href="../index.html" title="Boost.Test">
<link rel="prev" href="runtime_config/summary.html" title="Summary of run-time parameters">
<link rel="next" href="adv_scenarios/build_utf.html" title="Building the Unit Test Framework">
</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="runtime_config/summary.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="adv_scenarios/build_utf.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.adv_scenarios"></a><a class="link" href="adv_scenarios.html" title="Advanced Usage Scenarios">Advanced Usage Scenarios</a>
</h2></div></div></div>
<div class="toc"><dl class="toc">
<dt><span class="section"><a href="adv_scenarios/build_utf.html">Building the <span class="emphasis"><em>Unit
Test Framework</em></span></a></span></dt>
<dt><span class="section"><a href="adv_scenarios/entry_point_overview.html">Test module's
entry point</a></span></dt>
<dt><span class="section"><a href="adv_scenarios/test_module_init_overview.html">Test
module's initialization</a></span></dt>
<dt><span class="section"><a href="adv_scenarios/test_module_runner_overview.html">Test
module runner</a></span></dt>
<dt><span class="section"><a href="adv_scenarios/single_header_customizations.html">Header-only
variant customizations</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="adv_scenarios/single_header_customizations/multiple_translation_units.html">Header-only
with multiple translation units</a></span></dt>
<dt><span class="section"><a href="adv_scenarios/single_header_customizations/entry_point.html">Customizing
the module's entry point</a></span></dt>
<dt><span class="section"><a href="adv_scenarios/single_header_customizations/init_func.html">Customizing
the module's initialization function</a></span></dt>
</dl></dd>
<dt><span class="section"><a href="adv_scenarios/static_lib_customizations.html">Static-library
variant customizations</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="adv_scenarios/static_lib_customizations/entry_point.html">Customizing
the module's entry point</a></span></dt>
<dt><span class="section"><a href="adv_scenarios/static_lib_customizations/init_func.html">Customizing
the module's initialization function</a></span></dt>
</dl></dd>
<dt><span class="section"><a href="adv_scenarios/shared_lib_customizations.html">Shared-library
variant customizations</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="adv_scenarios/shared_lib_customizations/entry_point.html">Customizing
the module's entry point</a></span></dt>
<dt><span class="section"><a href="adv_scenarios/shared_lib_customizations/init_func.html">Customizing
the module's initialization function</a></span></dt>
</dl></dd>
<dt><span class="section"><a href="adv_scenarios/external_test_runner.html">The external
test runner usage variant</a></span></dt>
<dt><span class="section"><a href="adv_scenarios/obsolete_init_func.html">The obsolete
initialization function</a></span></dt>
</dl></div>
<p>
If you are reading this chapter, this means that the wide range of tools and
interfaces covered in the previous sections are not sufficient for the testing
scenario you have in mind. You are here to bend the <span class="emphasis"><em>Unit Test Framework</em></span>
to your will and ... we are not going to stop you. Instead we'll try to guide
you so that some dark corners do not look scary.
</p>
<p>
In most cases the <span class="emphasis"><em>Unit Test Framework</em></span> is going to be supplied
for you either as part of your system libraries or set of libraries used by
your companies. Yet if you are facing the necessity to build your own static
or dynamic library of the <span class="emphasis"><em>Unit Test Framework</em></span> or need
to customize the build for any reason, section <a class="link" href="adv_scenarios/build_utf.html" title="Building the Unit Test Framework">Building
the <span class="emphasis"><em>Unit Test Framework</em></span></a> covers all the necessary
steps.
</p>
<p>
To streamline the experience of setting up your test module, the <span class="emphasis"><em>Unit
Test Framework</em></span> provides some default initialization logic for them.
Usually the default test module initialization will work just fine, but if
you want to implement some custom initialization or change how default initialization
behaves you need to first look in <span class="bold"><strong>Test module initialization</strong></span>
section. Here you'll learn about various options the <span class="emphasis"><em>Unit Test Framework</em></span>
provides for you to customize this behavior.
</p>
<p>
The part of the framework which loads, initializes and executed your test module
is called the <span class="bold"><strong>Test Runner</strong></span>. Each usage variant
comes with default test runner. If, instead, you prefer to implement your own
entry point into the test module (for example if you need to implement the
<code class="computeroutput"><span class="identifier">main</span></code> function yourself and
not use the one provided by the <span class="emphasis"><em>Unit Test Framework</em></span>, you
need to learn about <span class="emphasis"><em>Unit Test Framework</em></span> interfaces involved
in test runners operations. These are covered in the <span class="bold"><strong>Test
runners</strong></span> section. Let me reiterate that you only need to this section
if regular regular options for customization of initialization logic like
<a class="link" href="tests_organization/fixtures.html" title="Fixtures">fixtures</a> or
<a class="link" href="tests_organization/decorators.html" title="Decorators">decorators</a>
are not sufficient for your purposes.
</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 © 2001-2020 Boost.Test contributors<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="runtime_config/summary.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="adv_scenarios/build_utf.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>