blob: 3843810174aae264ed846cbf9e51551116de3a8b [file] [log] [blame]
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>The single-header variant of the UTF</title>
<link rel="stylesheet" href="../../../../style/style.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.74.0">
<link rel="home" href="../../../index.html" title="Boost Test Library">
<link rel="up" href="../usage-variants.html" title="The UTF usage variants or the Buridan's donkey parable">
<link rel="prev" href="dynamic-lib-variant.html" title="The dynamic library variant of the UTF">
<link rel="next" href="extern-test-runner-variant.html" title="The external test runner variant of the UTF">
<script language="JavaScript1.2" src="../../../../js/boost-test.js"></script>
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table width="100%"><tr>
<td width="10%"><a href="../../../index.html"><img alt="Home" width="229" height="61" border="0" src="../../../../../../../libs/test/docbook/img/boost.test.logo.png"></a></td>
<td valign="middle" align="left"> &gt; <a href="../../../utf.html">The Unit Test Framework</a> &gt; <a href="../../user-guide.html">User's guide</a><a href="../../testing-tools.html">
&gt;
</a><a href="../usage-variants.html">Usage variants</a><a href="../test-runners.html">
&gt;
</a><b>Single header</b>
</td>
<td><div class="spirit-nav">
<a href="dynamic-lib-variant.html"><img src="../../../../../../../doc/html/images/prev.png" alt="Prev"></a><a href="extern-test-runner-variant.html"><img src="../../../../../../../doc/html/images/next.png" alt="Next"></a>
</div></td>
</tr></table>
<hr>
<div class="section" lang="en">
<div class="titlepage"><div><div><h5 class="title">
<a name="utf.user-guide.single-header-variant"></a>The single-header variant of the <acronym class="acronym">UTF</acronym>
</h5></div></div></div>
<p class="first-line-indented">
If you prefer to avoid the <a class="link" href="../../compilation/standalone.html" title="Standalone library compilation">standalone library compilation</a>, you
should use the single-header variant of the <acronym class="acronym">UTF</acronym>. This variant is implemented, as it follows from its name, in
the single header <code class="filename">boost/test/included/unit_test.hpp</code>. An inclusion of
the header causes the complete implementation of the <acronym class="acronym">UTF</acronym> to be included as a part of a test module's
source file. The header <code class="filename">boost/test/unit_test.hpp</code> doesn't have to be
included anymore. You don't have to worry about disabling <a class="link" href="../../compilation/auto-linking.html" title="Support of the auto-linking feature">
auto-linking</a> feature either. It's done in the implementation header already. This variant
can't be used with the <a class="xref" href="../../user-guide.html#multi-file-test-module.def">multi-file test module</a>.
Otherwise it's almost identical from the usage prospective to the static library variant of the <acronym class="acronym">UTF</acronym>.
In fact the only difference is the name of the include file:
<code class="filename">boost/test/included/unit_test.hpp</code> instead of
<code class="filename">boost/test/unit_test.hpp</code>.
</p>
<p class="first-line-indented">
The test runner supplied with this variant requires you to implement the <a class="link" href="../../user-guide.html#test-module.def">test
module</a> initialization function that matches one of the two specifications depending on the compilation flag
<a class="xref" href="../../compilation.html#utf.flag.alt-init-api">BOOST_TEST_ALTERNATIVE_INIT_API</a>. If flag isn't defined you are required to
match the original specification. If you define the flag
<a class="xref" href="../../compilation.html#utf.flag.alt-init-api">BOOST_TEST_ALTERNATIVE_INIT_API</a> during a test module compilation you are
required to use the alternative initialization function specification. The <acronym class="acronym">UTF</acronym> provides an ability to
<a class="link" href="../initialization.html#utf.user-guide.initialization.auto-generation" title="Automated generation of the test module initialization function">automatically generate</a> an empty test module
initialization function with correct specification if no custom initialization is required by a test module.
</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-2007 Gennadiy Rozental</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="dynamic-lib-variant.html"><img src="../../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../usage-variants.html"><img src="../../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="extern-test-runner-variant.html"><img src="../../../../../../../doc/html/images/next.png" alt="Next"></a>
</div>
</body>
</html>