regression.html 7.3 KB

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