regression.html 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  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 Express 2.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>A full set of tests and status tables can then be run thusly
  87. on a Window 2000 system:</p>
  88. <blockquote>
  89. <pre>cd %BOOST_ROOT%\status
  90. md bin 2&gt;nul
  91. bjam --dump-tests test &gt;bin\bjam.log 2&gt;&amp;1
  92. start notepad bin\bjam.log
  93. process_jam_log &lt;bin\bjam.log
  94. compiler_status %BOOST_ROOT% cs-win32.html
  95. rem Specify links file, even though it will be overwritten, so report html includes links
  96. rem This works because the generated bookmark names are the same regardless of other settings
  97. compiler_status --ignore-pass --no-warn %BOOST_ROOT% cs-win32-fail.html cs-win32-links.html
  98. compiler_status --ignore-pass %BOOST_ROOT% cs-win32-warn-or-fail.html cs-win32-links.html
  99. compiler_status %BOOST_ROOT% cs-win32-full.html cs-win32-links.html</pre>
  100. </blockquote>
  101. <p>Modulo syntax adjustments, the same procedure should work on
  102. other operating systems (an example shell script for this is <a
  103. href="../tools/regression/run_tests.sh">provided</a>, see the
  104. script itself for comments and directions).&nbsp; Rename the cs-win-xxx
  105. output files as appropriate.</p>
  106. <p>If you execute <i>compiler_status</i> without arguments, you
  107. can see the available options and tailor your own favorite report.</p>
  108. <p>If you want to run just a single test, specify it as the <i>bjam</i>
  109. target rather than &quot;test&quot;.&nbsp; For example, to debug
  110. configurations, it might be useful to just run the <i>config_info</i>
  111. test, with a switch to force even up-to-date programs be rebuilt:</p>
  112. <blockquote>
  113. <pre>bjam -a --dump-tests config_info &gt;bin\bjam.log 2&gt;&amp;1
  114. process_jam_log &lt;bin\bjam.log
  115. compiler_status %BOOST_ROOT% cs-win32.html
  116. </pre>
  117. </blockquote>
  118. <h2><a name="Adding_new_test">Adding a new test</a></h2>
  119. <h3>Overall Boost regression tests</h3>
  120. <p>Adding tests is as simple as adding a single line to the <a
  121. href="../status/Jamfile">boost-root/status/Jamfile</a>:</p>
  122. <blockquote>
  123. <pre>run libs/mylib/test/mytest.cpp ;</pre>
  124. </blockquote>
  125. <p>Don't forget that Jam is white-space sensitive; delete the
  126. space before the semi-colon in the example above, and you will
  127. get an introduction to Jam error messages.</p>
  128. <p>For creating more complex tests and test-suites, look at
  129. examples in the <a href="../status/Jamfile">Jamfile</a>.&nbsp;
  130. The <i>bind</i> and <i>config</i> test-suites are simple
  131. examples, while the <i>regex</i> and <i>threads</i> test suites
  132. show more of the power of Jam based testing.</p>
  133. <h3>Private tests for a specific library</h3>
  134. <p>A library can have its own private set of tests by creating a
  135. Jamfile in one of the library's own sub-directories.&nbsp; For an
  136. example of this, see <a href="../libs/test/test/Jamfile">boost-root/libs/test/test/Jamfile</a>.</p>
  137. <h2><a name="Requirements">Requirements</a></h2>
  138. <p>The test suite has been designed to meet to the following
  139. requirements. </p>
  140. <ul>
  141. <li>Doesn't depend on an external toolchain. This requirement
  142. is met by supplying all tools in the regular <a
  143. href="download.html">Boost distribution</a>, except for a
  144. C++ compiler.</li>
  145. <li>Tools are written in C++; it is the only language that
  146. all Boost developers and users are comfortable with.</li>
  147. <li>Supports tests which expect an error </li>
  148. <li>Configuration is independent of the target platform or
  149. compiler. </li>
  150. <li>HTML output </li>
  151. </ul>
  152. <p>These requirements rule out any script-based approach such as
  153. dejagnu (requires Tcl and expect) or even shell scripts. </p>
  154. <h2><a name="History">History</a></h2>
  155. <p>The version 3 testing.jam and status/Jamfile foundation was
  156. contributed by Dave Abrahams. The post-bjam processing programs
  157. were contributed by Beman Dawes.</p>
  158. <p>The version 2 regression.cpp test program was contributed by
  159. Jens Maurer, generalizing and improving an earlier version 1
  160. program by Beman Dawes.</p>
  161. <hr>
  162. <p>Revised <!--webbot bot="Timestamp" startspan s-type="EDITED"
  163. s-format="%d %B, %Y" -->09 January, 2003<!--webbot bot="Timestamp"
  164. i-checksum="38582" endspan --></p>
  165. <p>Original author: <a href="../people/jens_maurer.htm">Jens
  166. Maurer</a><br>
  167. Updates: <a href="../people/beman_dawes.html">Beman Dawes</a></p>
  168. </body>
  169. </html>
粤ICP备19079148号