1<html> 2<head> 3<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 4<title>Advanced Usage Scenarios</title> 5<link rel="stylesheet" href="../boostbook.css" type="text/css"> 6<meta name="generator" content="DocBook XSL Stylesheets V1.79.1"> 7<link rel="home" href="../index.html" title="Boost.Test"> 8<link rel="up" href="../index.html" title="Boost.Test"> 9<link rel="prev" href="runtime_config/summary.html" title="Summary of run-time parameters"> 10<link rel="next" href="adv_scenarios/build_utf.html" title="Building the Unit Test Framework"> 11</head> 12<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> 13<table cellpadding="2" width="100%"><tr> 14<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../boost.png"></td> 15<td align="center"><a href="../../../../../index.html">Home</a></td> 16<td align="center"><a href="../../../../../libs/libraries.htm">Libraries</a></td> 17<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td> 18<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td> 19<td align="center"><a href="../../../../../more/index.htm">More</a></td> 20</tr></table> 21<hr> 22<div class="spirit-nav"> 23<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> 24</div> 25<div class="section"> 26<div class="titlepage"><div><div><h2 class="title" style="clear: both"> 27<a name="boost_test.adv_scenarios"></a><a class="link" href="adv_scenarios.html" title="Advanced Usage Scenarios">Advanced Usage Scenarios</a> 28</h2></div></div></div> 29<div class="toc"><dl class="toc"> 30<dt><span class="section"><a href="adv_scenarios/build_utf.html">Building the <span class="emphasis"><em>Unit 31 Test Framework</em></span></a></span></dt> 32<dt><span class="section"><a href="adv_scenarios/entry_point_overview.html">Test module's 33 entry point</a></span></dt> 34<dt><span class="section"><a href="adv_scenarios/test_module_init_overview.html">Test 35 module's initialization</a></span></dt> 36<dt><span class="section"><a href="adv_scenarios/test_module_runner_overview.html">Test 37 module runner</a></span></dt> 38<dt><span class="section"><a href="adv_scenarios/single_header_customizations.html">Header-only 39 variant customizations</a></span></dt> 40<dd><dl> 41<dt><span class="section"><a href="adv_scenarios/single_header_customizations/multiple_translation_units.html">Header-only 42 with multiple translation units</a></span></dt> 43<dt><span class="section"><a href="adv_scenarios/single_header_customizations/entry_point.html">Customizing 44 the module's entry point</a></span></dt> 45<dt><span class="section"><a href="adv_scenarios/single_header_customizations/init_func.html">Customizing 46 the module's initialization function</a></span></dt> 47</dl></dd> 48<dt><span class="section"><a href="adv_scenarios/static_lib_customizations.html">Static-library 49 variant customizations</a></span></dt> 50<dd><dl> 51<dt><span class="section"><a href="adv_scenarios/static_lib_customizations/entry_point.html">Customizing 52 the module's entry point</a></span></dt> 53<dt><span class="section"><a href="adv_scenarios/static_lib_customizations/init_func.html">Customizing 54 the module's initialization function</a></span></dt> 55</dl></dd> 56<dt><span class="section"><a href="adv_scenarios/shared_lib_customizations.html">Shared-library 57 variant customizations</a></span></dt> 58<dd><dl> 59<dt><span class="section"><a href="adv_scenarios/shared_lib_customizations/entry_point.html">Customizing 60 the module's entry point</a></span></dt> 61<dt><span class="section"><a href="adv_scenarios/shared_lib_customizations/init_func.html">Customizing 62 the module's initialization function</a></span></dt> 63</dl></dd> 64<dt><span class="section"><a href="adv_scenarios/external_test_runner.html">The external 65 test runner usage variant</a></span></dt> 66<dt><span class="section"><a href="adv_scenarios/obsolete_init_func.html">The obsolete 67 initialization function</a></span></dt> 68</dl></div> 69<p> 70 If you are reading this chapter, this means that the wide range of tools and 71 interfaces covered in the previous sections are not sufficient for the testing 72 scenario you have in mind. You are here to bend the <span class="emphasis"><em>Unit Test Framework</em></span> 73 to your will and ... we are not going to stop you. Instead we'll try to guide 74 you so that some dark corners do not look scary. 75 </p> 76<p> 77 In most cases the <span class="emphasis"><em>Unit Test Framework</em></span> is going to be supplied 78 for you either as part of your system libraries or set of libraries used by 79 your companies. Yet if you are facing the necessity to build your own static 80 or dynamic library of the <span class="emphasis"><em>Unit Test Framework</em></span> or need 81 to customize the build for any reason, section <a class="link" href="adv_scenarios/build_utf.html" title="Building the Unit Test Framework">Building 82 the <span class="emphasis"><em>Unit Test Framework</em></span></a> covers all the necessary 83 steps. 84 </p> 85<p> 86 To streamline the experience of setting up your test module, the <span class="emphasis"><em>Unit 87 Test Framework</em></span> provides some default initialization logic for them. 88 Usually the default test module initialization will work just fine, but if 89 you want to implement some custom initialization or change how default initialization 90 behaves you need to first look in <span class="bold"><strong>Test module initialization</strong></span> 91 section. Here you'll learn about various options the <span class="emphasis"><em>Unit Test Framework</em></span> 92 provides for you to customize this behavior. 93 </p> 94<p> 95 The part of the framework which loads, initializes and executed your test module 96 is called the <span class="bold"><strong>Test Runner</strong></span>. Each usage variant 97 comes with default test runner. If, instead, you prefer to implement your own 98 entry point into the test module (for example if you need to implement the 99 <code class="computeroutput"><span class="identifier">main</span></code> function yourself and 100 not use the one provided by the <span class="emphasis"><em>Unit Test Framework</em></span>, you 101 need to learn about <span class="emphasis"><em>Unit Test Framework</em></span> interfaces involved 102 in test runners operations. These are covered in the <span class="bold"><strong>Test 103 runners</strong></span> section. Let me reiterate that you only need to this section 104 if regular regular options for customization of initialization logic like 105 <a class="link" href="tests_organization/fixtures.html" title="Fixtures">fixtures</a> or 106 <a class="link" href="tests_organization/decorators.html" title="Decorators">decorators</a> 107 are not sufficient for your purposes. 108 </p> 109</div> 110<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> 111<td align="left"></td> 112<td align="right"><div class="copyright-footer">Copyright © 2001-2020 Boost.Test contributors<p> 113 Distributed under the Boost Software License, Version 1.0. (See accompanying 114 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>) 115 </p> 116</div></td> 117</tr></table> 118<hr> 119<div class="spirit-nav"> 120<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> 121</div> 122</body> 123</html> 124