regression.html 9.2 KB

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