[12] | 1 | <html> |
---|
| 2 | |
---|
| 3 | <head> |
---|
| 4 | <meta http-equiv="Content-Type" |
---|
| 5 | content="text/html; charset=iso-8859-1"> |
---|
| 6 | <meta name="GENERATOR" content="Microsoft FrontPage 5.0"> |
---|
| 7 | <title>Boost Regression Test User Documentation</title> |
---|
| 8 | </head> |
---|
| 9 | |
---|
| 10 | <body bgcolor="#FFFFFF" text="#000000"> |
---|
| 11 | |
---|
| 12 | <table border="1" cellpadding="2" bgcolor="#007F7F"> |
---|
| 13 | <tr> |
---|
| 14 | <td bgcolor="#FFFFFF"><img src="../boost.png" |
---|
| 15 | alt="boost.png (6897 bytes)" width="277" height="86"></td> |
---|
| 16 | <td><a href="../index.htm"><font color="#FFFFFF" size="4" |
---|
| 17 | face="Arial,Helvetica">Home</font></a></td> |
---|
| 18 | <td><a href="../libs/libraries.htm"><font color="#FFFFFF" |
---|
| 19 | size="4" face="Arial,Helvetica">Libraries</font></a></td> |
---|
| 20 | <td><a href="../people/people.htm"><font color="#FFFFFF" |
---|
| 21 | size="4" face="Arial,Helvetica">People</font></a></td> |
---|
| 22 | <td><a href="faq.htm"><font color="#FFFFFF" size="4" |
---|
| 23 | face="Arial,Helvetica">FAQ</font></a></td> |
---|
| 24 | <td><a href="index.htm"><font color="#FFFFFF" size="4" |
---|
| 25 | face="Arial,Helvetica">More</font></a></td> |
---|
| 26 | </tr> |
---|
| 27 | </table> |
---|
| 28 | |
---|
| 29 | <h1>Boost Regression Test User Documentation</h1> |
---|
| 30 | |
---|
| 31 | <p><a href="#Introduction">Introduction</a><br> |
---|
| 32 | <a href="#Preparation">Preparation</a><br> |
---|
| 33 | <a href="#Execution">Execution</a><br> |
---|
| 34 | <a href="#Adding_new_test">Adding a new test</a><br> |
---|
| 35 | <a href="#Requirements">Requirements</a><br> |
---|
| 36 | <a href="#History">History</a></p> |
---|
| 37 | |
---|
| 38 | <h2><a name="Introduction">Introduction</a></h2> |
---|
| 39 | |
---|
| 40 | <p>Boost's internal regression test suite produces the <a |
---|
| 41 | href="../status/compiler_status.html">compiler status tables</a>. |
---|
| 42 | </p> |
---|
| 43 | |
---|
| 44 | <p>Although not ordinarily run by Boost library users, it is |
---|
| 45 | documented here for the benefit of Boost developers, and for |
---|
| 46 | Boost users porting to a new platform.</p> |
---|
| 47 | |
---|
| 48 | <p>Version 3 of the Boost regression testing framework is based |
---|
| 49 | on <a href="../tools/build/index.html">Boost.Build</a>, and uses <i>bjam</i> |
---|
| 50 | to actually run the tests. Because Boost.Build does dependency |
---|
| 51 | analysis, only tests for which some dependency has change are |
---|
| 52 | rerun.</p> |
---|
| 53 | |
---|
| 54 | <p>The reporting of test results as HTML files is accomplished by |
---|
| 55 | separate <a href="../tools/regression/index.htm">regression |
---|
| 56 | reporting programs</a> which process the residue and log files |
---|
| 57 | from the <i>bjam</i> run.</p> |
---|
| 58 | |
---|
| 59 | <h2><a name="Preparation">Preparation</a></h2> |
---|
| 60 | |
---|
| 61 | <p>Install the following programs on your system, in some |
---|
| 62 | location suitable for program executables. Normally that location |
---|
| 63 | must be in a directory which is part of your search path for |
---|
| 64 | executables.</p> |
---|
| 65 | |
---|
| 66 | <ul> |
---|
| 67 | <li><i>bjam</i> - Executables and sources are available; see <a |
---|
| 68 | href="../tools/build/index.html">Boost.Build docs</a>. |
---|
| 69 | Before worrying about regression tests, you might want to |
---|
| 70 | verify your <i>bjam</i> installation works by |
---|
| 71 | building the |
---|
| 72 | boost-root/status/Jamfile libraries.<br> |
---|
| 73 | </li> |
---|
| 74 | <li><i>process_jam_log</i> and <i>compiler_status</i> - |
---|
| 75 | <a href="../tools/regression/index.htm">Sources and Jamfile</a> are available |
---|
| 76 | for these, too. </li> |
---|
| 77 | </ul> |
---|
| 78 | |
---|
| 79 | <h2><a name="Execution">Execution</a></h2> |
---|
| 80 | |
---|
| 81 | <p>A complete shell script, <a href="../tools/regression/run_tests.sh"> |
---|
| 82 | run_test.sh</a>, is available for POSIX systems. For Windows, please read the |
---|
| 83 | following.</p> |
---|
| 84 | |
---|
| 85 | <p>These examples assume several environment variables have been |
---|
| 86 | set:</p> |
---|
| 87 | |
---|
| 88 | <ul> |
---|
| 89 | <li>BOOST_ROOT is set to the directory where the unzipped |
---|
| 90 | Boost distribution or CVS working copy resides. For |
---|
| 91 | example:<br> |
---|
| 92 | <br> |
---|
| 93 | set BOOST_ROOT=/boost_1_29_0<br> |
---|
| 94 | </li> |
---|
| 95 | <li>TOOLS is set to the <a |
---|
| 96 | href="../tools/build/index.html">compiler toolsets</a> |
---|
| 97 | you wish to use. For example:<br> |
---|
| 98 | <br> |
---|
| 99 | set TOOLS=borland gcc intel-win32 metrowerks vc7<br> |
---|
| 100 | </li> |
---|
| 101 | <li>Any environment variables required for particular |
---|
| 102 | compilers. You might wish to test first with one |
---|
| 103 | compiler at a time to make sure each toolset is fully |
---|
| 104 | operational.</li> |
---|
| 105 | </ul> |
---|
| 106 | |
---|
| 107 | <p>Just running bjam for a specific library can be run like this on Windows, |
---|
| 108 | using the Filesystem Library as an example:</p> |
---|
| 109 | |
---|
| 110 | <blockquote> |
---|
| 111 | <pre>cd \boost-root\libs\filesystem\test |
---|
| 112 | bjam</pre> |
---|
| 113 | </blockquote> |
---|
| 114 | |
---|
| 115 | <p>A full set of tests and status tables can be run thusly |
---|
| 116 | on a Windows system:</p> |
---|
| 117 | |
---|
| 118 | <blockquote> |
---|
| 119 | <pre>cd %BOOST_ROOT%\status |
---|
| 120 | bjam --dump-tests test >bjam.log 2>&1 |
---|
| 121 | start notepad bjam.log |
---|
| 122 | process_jam_log <bjam.log |
---|
| 123 | compiler_status %BOOST_ROOT% cs-win32.html |
---|
| 124 | rem Specify links file, even though it will be overwritten, so report html includes links |
---|
| 125 | rem This works because the generated bookmark names are the same regardless of other settings |
---|
| 126 | compiler_status --ignore-pass --no-warn %BOOST_ROOT% cs-win32-fail.html cs-win32-links.html |
---|
| 127 | compiler_status --ignore-pass %BOOST_ROOT% cs-win32-warn-or-fail.html cs-win32-links.html |
---|
| 128 | compiler_status %BOOST_ROOT% cs-win32-full.html cs-win32-links.html</pre> |
---|
| 129 | </blockquote> |
---|
| 130 | |
---|
| 131 | <p>Modulo syntax adjustments, the same procedure should work on |
---|
| 132 | other operating systems (an example a <a href="../tools/regression/run_tests.sh"> |
---|
| 133 | UNIX shell script</a> for this is provided, see the |
---|
| 134 | script itself for comments and directions). Rename the cs-win-xxx |
---|
| 135 | output files as appropriate.</p> |
---|
| 136 | |
---|
| 137 | <p>If you execute <i>compiler_status</i> without arguments, you |
---|
| 138 | can see the available options and tailor your own favorite report.</p> |
---|
| 139 | |
---|
| 140 | <p>If you want to run just a single test, specify it as the <i>bjam</i> |
---|
| 141 | target rather than "test". For example, to debug |
---|
| 142 | configurations, it might be useful to just run the <i>config_info</i> |
---|
| 143 | test, with a switch to force even up-to-date programs be rebuilt:</p> |
---|
| 144 | |
---|
| 145 | <blockquote> |
---|
| 146 | <pre>bjam -a --dump-tests config_info >bjam.log 2>&1 |
---|
| 147 | process_jam_log <bjam.log |
---|
| 148 | compiler_status %BOOST_ROOT% cs-win32.html |
---|
| 149 | </pre> |
---|
| 150 | </blockquote> |
---|
| 151 | |
---|
| 152 | <h2><a name="Adding_new_test">Adding a new test</a></h2> |
---|
| 153 | |
---|
| 154 | <h3>The best way - the <a name="subinclude"> <i>subinclud</i>e</a> approach</h3> |
---|
| 155 | |
---|
| 156 | <p>The best way to add a test to the <a |
---|
| 157 | href="../status/Jamfile">boost-root/status/Jamfile</a> is usually to use the bjam |
---|
| 158 | <i>subinclude</i> feature, since it allows the same test specification to be run |
---|
| 159 | either as part of the overall Boost regression test or as a standalone test of |
---|
| 160 | only the library involved.</p> |
---|
| 161 | |
---|
| 162 | <p>The test is specified in a Jamfile, which is usually placed in the library's |
---|
| 163 | <i>test</i> subdirectory. See the <a href="../libs/filesystem/test/Jamfile"> |
---|
| 164 | Filesystem Library's test Jamfile</a> for an example, including the boilerplate |
---|
| 165 | wrapped around the actual tests. By <a href="#Execution">executing bjam</a> |
---|
| 166 | (with or without the status reporting programs) in the library's <i>test</i> |
---|
| 167 | subdirectory, the library can be tested without the need to run the full Boost |
---|
| 168 | regression tests.</p> |
---|
| 169 | |
---|
| 170 | <p>Then by adding a <i>subinclude</i> statement to <a |
---|
| 171 | href="../status/Jamfile">boost-root/status/Jamfile</a>, the library's test |
---|
| 172 | Jamfile will become part of the main Boost regression tests. For example, |
---|
| 173 | the Filesystem Library's tests are included by this line in the main |
---|
| 174 | boost-root/status Jamfile:</p> |
---|
| 175 | |
---|
| 176 | <blockquote> |
---|
| 177 | <pre>subinclude libs/filesystem/test ;</pre> |
---|
| 178 | </blockquote> |
---|
| 179 | |
---|
| 180 | <p>Don't forget that Jamfiles are white-space sensitive; delete the |
---|
| 181 | space before the semi-colon in the example above, and you will |
---|
| 182 | get an introduction to Jam error messages.</p> |
---|
| 183 | |
---|
| 184 | <h3>Another way - direct inclusion in Boost regression tests</h3> |
---|
| 185 | |
---|
| 186 | <p>Adding a test is as simple as adding a single line to the <a |
---|
| 187 | href="../status/Jamfile">boost-root/status/Jamfile</a>:</p> |
---|
| 188 | |
---|
| 189 | <blockquote> |
---|
| 190 | <pre>run libs/mylib/test/mytest.cpp ;</pre> |
---|
| 191 | </blockquote> |
---|
| 192 | |
---|
| 193 | <p>For creating more complex tests and test-suites, use the |
---|
| 194 | <a href="#subinclude">subinclude approach</a>. Look at |
---|
| 195 | examples in the <a |
---|
| 196 | href="../status/Jamfile">boost-root/status/Jamfile</a>. |
---|
| 197 | The <i>bind</i> and <i>config</i> test-suites are simple |
---|
| 198 | examples, while the <i>regex</i> and <i>threads</i> test suites |
---|
| 199 | show more of the power of Jam based testing.</p> |
---|
| 200 | |
---|
| 201 | <h2><a name="Requirements">Requirements</a></h2> |
---|
| 202 | |
---|
| 203 | <p>The test suite has been designed to meet to the following |
---|
| 204 | requirements. </p> |
---|
| 205 | |
---|
| 206 | <ul> |
---|
| 207 | <li>Doesn't depend on an external tool chain. This requirement |
---|
| 208 | is met by supplying all tools in the regular <a |
---|
| 209 | href="getting_started.html#Download">Boost distribution</a>, except for a |
---|
| 210 | C++ compiler.</li> |
---|
| 211 | <li>Tools are written in C++; it is the only language that |
---|
| 212 | all Boost developers and users are comfortable with.</li> |
---|
| 213 | <li>Supports tests which expect an error </li> |
---|
| 214 | <li>Configuration is independent of the target platform or |
---|
| 215 | compiler. </li> |
---|
| 216 | <li>HTML output </li> |
---|
| 217 | </ul> |
---|
| 218 | |
---|
| 219 | <p>These requirements rule out any script-based approach such as |
---|
| 220 | dejagnu (requires Tcl and expect) or even shell scripts. </p> |
---|
| 221 | |
---|
| 222 | <h2><a name="History">History</a></h2> |
---|
| 223 | |
---|
| 224 | <p>The version 3 Regression Test system is based on |
---|
| 225 | <a href="../tools/build/index.html">Boost.Build</a>. The testing.jam and status/Jamfile foundation was |
---|
| 226 | contributed by Dave Abrahams. Rene Rivera contributed several pieces. The post-bjam processing programs |
---|
| 227 | were contributed by Beman Dawes.</p> |
---|
| 228 | |
---|
| 229 | <p>The version 2 regression.cpp test program was contributed by |
---|
| 230 | Jens Maurer, generalizing and improving an earlier version 1 |
---|
| 231 | program by Beman Dawes.</p> |
---|
| 232 | |
---|
| 233 | <hr> |
---|
| 234 | |
---|
| 235 | <p>Revised <!--webbot bot="Timestamp" startspan s-type="EDITED" |
---|
| 236 | s-format="%d %B, %Y" -->08 January, 2004<!--webbot bot="Timestamp" |
---|
| 237 | i-checksum="38708" endspan --></p> |
---|
| 238 | |
---|
| 239 | <p>© Copyright <a href="../people/jens_maurer.htm">Jens |
---|
| 240 | Maurer</a> 2001<br> |
---|
| 241 | © Copyright <a href="../people/beman_dawes.html">Beman Dawes</a> 2001</p> |
---|
| 242 | <p> Use, modification, and distribution are subject to the Boost Software |
---|
| 243 | License, Version 1.0. (See accompanying file <a href="../LICENSE_1_0.txt"> |
---|
| 244 | LICENSE_1_0.txt</a> or copy at <a href="http://www.boost.org/LICENSE_1_0.txt"> |
---|
| 245 | www.boost.org/LICENSE_1_0.txt</a>)</p> |
---|
| 246 | </body> |
---|
| 247 | </html> |
---|