3 <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
4 <title>Test module runner</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="../adv_scenarios.html" title="Advanced Usage Scenarios">
9 <link rel="prev" href="test_module_init_overview.html" title="Test module's initialization">
10 <link rel="next" href="single_header_customizations.html" title="Header-only variant customizations">
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>
22 <div class="spirit-nav">
23 <a accesskey="p" href="test_module_init_overview.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../adv_scenarios.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="single_header_customizations.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
26 <div class="titlepage"><div><div><h3 class="title">
27 <a name="boost_test.adv_scenarios.test_module_runner_overview"></a><a class="link" href="test_module_runner_overview.html" title="Test module runner">Test
29 </h3></div></div></div>
31 A <span class="emphasis"><em>test module runner</em></span> is an <span class="emphasis"><em>orchestrator</em></span>
32 or a <span class="emphasis"><em>driver</em></span> that, given the test tree, ensures the test
33 tree is initialized, tests are executed and necessary reports generated.
34 It performs the following operations:
36 <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
38 initialize the test module using the supplied <a class="link" href="test_module_init_overview.html" title="Test module's initialization"><span class="emphasis"><em>initialization
39 function</em></span></a>;
42 select output media for the test log and the test results report;
45 execute test cases as specified by run-time parameters;
48 produce the test results report;
51 generate the appropriate return code.
55 The <span class="emphasis"><em>Unit Test Framework</em></span> comes with the default test
56 runner. There is no need to call it explicitly. The default generated test
57 module's <a class="link" href="entry_point_overview.html" title="Test module's entry point">entry
58 point</a> invokes the default test runner. The default test runner is
59 declared with the following signature:
61 <pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span> <span class="keyword">namespace</span> <span class="identifier">unit_test</span> <span class="special">{</span>
63 <span class="keyword">typedef</span> <span class="keyword">bool</span> <span class="special">(*</span><span class="identifier">init_unit_test_func</span><span class="special">)();</span>
65 <span class="keyword">int</span> <span class="identifier">unit_test_main</span><span class="special">(</span> <span class="identifier">init_unit_test_func</span> <span class="identifier">init_func</span><span class="special">,</span> <span class="keyword">int</span> <span class="identifier">argc</span><span class="special">,</span> <span class="keyword">char</span><span class="special">*</span> <span class="identifier">argv</span><span class="special">[]</span> <span class="special">);</span>
67 <span class="special">}</span> <span class="special">}</span>
70 The test runner may return one of the following values:
72 <div class="informaltable"><table class="table">
93 <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">exit_success</span></code>
97 <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
99 No errors occurred during testing, or
101 <li class="listitem">
102 the success result was forced with command-line argument <code class="computeroutput"><span class="special">--[</span><span class="identifier">link</span>
103 <span class="identifier">boost_test</span><span class="special">.</span><span class="identifier">utf_reference</span><span class="special">.</span><span class="identifier">rt_param_reference</span><span class="special">.</span><span class="identifier">result_code</span> </code>result_code<code class="computeroutput"><span class="special">]=</span><span class="identifier">no</span></code>.
111 <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">exit_test_failure</span></code>
115 <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
116 <li class="listitem">
117 Non-fatal errors detected and no uncaught exceptions were thrown
120 <li class="listitem">
121 the initialization of the <span class="emphasis"><em>Unit Test Framework</em></span>
130 <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">exit_exception_failure</span></code>
134 <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
135 <li class="listitem">
136 Fatal errors were detected, or
138 <li class="listitem">
139 uncaught exceptions thrown during testing.
147 An advanced test runner may provide additional features, including interactive
148 GUI interfaces, test coverage and profiling support.
151 <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
152 <td align="left"></td>
153 <td align="right"><div class="copyright-footer">Copyright © 2001-2019 Boost.Test
155 Distributed under the Boost Software License, Version 1.0. (See accompanying
156 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>)
161 <div class="spirit-nav">
162 <a accesskey="p" href="test_module_init_overview.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../adv_scenarios.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="single_header_customizations.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>