3 <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
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="../rt_param_reference.html" title="Runtime parameters reference">
9 <link rel="prev" href="output_format.html" title="output_format">
10 <link rel="next" href="report_format.html" title="report_format">
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="output_format.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../rt_param_reference.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="report_format.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
26 <div class="titlepage"><div><div><h4 class="title">
27 <a name="boost_test.utf_reference.rt_param_reference.random"></a><a class="link" href="random.html" title="random"><code class="computeroutput"><span class="identifier">random</span></code></a>
28 </h4></div></div></div>
30 Parameter <span class="emphasis"><em>random</em></span> instructs the <span class="emphasis"><em>Unit Test
31 Framework</em></span> to execute the test cases in random order. This parameter
32 accepts an optional <code class="computeroutput"><span class="keyword">unsigned</span> <span class="identifier">integer</span></code> argument for the seed of the
35 <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
37 By default (value <code class="computeroutput"><span class="number">0</span></code>), the
38 test cases are executed in some specific order defined by the order
39 of test units in the test files, and the dependencies between test
43 If the parameter is specified without the argument value, or with value
44 <code class="computeroutput"><span class="number">1</span></code>, the testing order is
45 randomized based on current time.
48 Alternatively, any positive value greater than <code class="computeroutput"><span class="number">1</span></code>
49 will be used as random seed for the run.
52 <div class="tip"><table border="0" summary="Tip">
54 <td rowspan="2" align="center" valign="top" width="25"><img alt="[Tip]" src="../../../../../../../doc/src/images/tip.png"></td>
55 <th align="left">Tip</th>
57 <tr><td align="left" valign="top"><p>
58 in case <code class="computeroutput"><span class="special">--</span><span class="identifier">random</span></code>
59 is specified, the value of the seed is logged using <a class="link" href="../testout_reference/test_output_macro_message.html" title="BOOST_TEST_MESSAGE"><code class="computeroutput"><span class="identifier">BOOST_TEST_MESSAGE</span></code></a>, so that
60 it is possible to replay exactly the same sequence of unit test in case
61 of failure. For the seed to be visible in the logs, make sure the proper
62 <a class="link" href="log_level.html" title="log_level"><code class="computeroutput"><span class="special">--</span><span class="identifier">log_level</span></code></a>
67 <a name="boost_test.utf_reference.rt_param_reference.random.h0"></a>
68 <span class="phrase"><a name="boost_test.utf_reference.rt_param_reference.random.acceptable_values"></a></span><a class="link" href="random.html#boost_test.utf_reference.rt_param_reference.random.acceptable_values">Acceptable
71 <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
73 <span class="bold"><strong>0</strong></span> (default): no randomization
76 <code class="computeroutput"><span class="number">1</span></code>: random seed based on
80 <a class="link" href="../rt_param_reference.html#regular_param_value">integer</a> <code class="computeroutput"><span class="identifier">value</span>
81 <span class="special">></span> <span class="number">1</span></code>
82 : seed for the random number generator
86 <a name="boost_test.utf_reference.rt_param_reference.random.h1"></a>
87 <span class="phrase"><a name="boost_test.utf_reference.rt_param_reference.random.command_line_syntax"></a></span><a class="link" href="random.html#boost_test.utf_reference.rt_param_reference.random.command_line_syntax">Command
90 <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
91 <code class="computeroutput"><span class="special">--</span><span class="identifier">random</span><span class="special">=<</span><span class="identifier">seed</span><span class="special">></span></code>
94 <a name="boost_test.utf_reference.rt_param_reference.random.h2"></a>
95 <span class="phrase"><a name="boost_test.utf_reference.rt_param_reference.random.environment_variable"></a></span><a class="link" href="random.html#boost_test.utf_reference.rt_param_reference.random.environment_variable">Environment
98 <pre class="programlisting"><span class="identifier">BOOST_TEST_RANDOM</span>
101 <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
102 <td align="left"></td>
103 <td align="right"><div class="copyright-footer">Copyright © 2001-2019 Boost.Test
105 Distributed under the Boost Software License, Version 1.0. (See accompanying
106 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>)
111 <div class="spirit-nav">
112 <a accesskey="p" href="output_format.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../rt_param_reference.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="report_format.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>