issue_reporting.html 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  1. <html>
  2. <head>
  3. <meta name="GENERATOR" content="Microsoft FrontPage 5.0">
  4. <meta name="ProgId" content="FrontPage.Editor.Document">
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  6. <title>Filesystem issue reporting</title>
  7. <link href="styles.css" rel="stylesheet">
  8. </head>
  9. <body>
  10. <table border="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111">
  11. <tr>
  12. <td width="277">
  13. <a href="../../../index.htm">
  14. <img src="../../../boost.png" alt="boost.png (6897 bytes)" align="middle" width="300" height="86" border="0"></a></td>
  15. <td align="middle">
  16. <font size="7">Filesystem Bug Reporting</font>
  17. </td>
  18. </tr>
  19. </table>
  20. <table border="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse"
  21. bordercolor="#111111" bgcolor="#D7EEFF" width="100%">
  22. <tr>
  23. <td><a href="index.htm">Home</a> &nbsp;&nbsp;
  24. <a href="tutorial.html">Tutorial</a> &nbsp;&nbsp;
  25. <a href="reference.html">Reference</a> &nbsp;&nbsp;
  26. <a href="faq.htm">FAQ</a> &nbsp;&nbsp;
  27. <a href="release_history.html">Releases</a> &nbsp;&nbsp;
  28. <a href="portability_guide.htm">Portability</a> &nbsp;&nbsp;
  29. <a href="v3.html">V3 Intro</a> &nbsp;&nbsp;
  30. <a href="v3_design.html">V3 Design</a> &nbsp;&nbsp;
  31. <a href="deprecated.html">Deprecated</a> &nbsp;&nbsp;
  32. <a href="issue_reporting.html">Bug Reports </a>&nbsp;&nbsp;
  33. </td>
  34. </table>
  35. <p>Boost.Filesystem issues such as bug reports or feature requests should be
  36. reported via a <a href="https://github.com/boostorg/filesystem/issues/new">GitHub ticket</a>.</p>
  37. <p><a href="https://github.com/boostorg/filesystem/pulls">GitHub pull requests</a>
  38. are encouraged, too, although anything beyond really trivial fixes needs a
  39. ticket.</p>
  40. <h3>Bug reports</h3>
  41. <p>A timely response to your bug report is much more likely if <b>the problem can
  42. be immediately reproduced without guesswork and regression tests can be easily
  43. created</b>. </p>
  44. <p>You need to provide the following:</p>
  45. <ol>
  46. <li>A simple test program
  47. that:<ul>
  48. <li>Illustrates the problem, and</li>
  49. <li>Automatically yields an unambiguous pass or fail result - returning zero
  50. for pass and non-zero for fail is preferred, and </li>
  51. <li>Can be used as the basis for adding tests to Boost.Filesystem&#39;s
  52. regression test suite.</li>
  53. </ul>
  54. </li>
  55. <li>The compiler, standard library, platform, and Boost version you
  56. used to build and run your test program.</li>
  57. <li>A description of how to build and run the test program.
  58. </li>
  59. <li>A copy of the output from the test
  60. program, if any.</li>
  61. <li>An email address for follow-up questions.</li>
  62. </ol>
  63. <p>See <a href="#Rationale">Rationale</a> to find out why the above is needed.</p>
  64. <p>For a mostly automatic framework to provide the above, read on!</p>
  65. <h3>Bug reporting framework</h3>
  66. <p>The directory <code>&lt;boost-root&gt;/libs/filesystem/bug&gt;</code> provides a bug test program (<code><a href="#bug-cpp">bug.cpp</a></code>)
  67. and a build file (<code>Jamfile.v2</code>). Here is what you need to do:</p>
  68. <ol>
  69. <li>Add one or more test cases to <code><a href="#bug-cpp">bug.cpp</a></code>
  70. using any text or program editor.</li>
  71. <li><a href="#Build-and-test">Build and test</a>.</li>
  72. <li>Attach copies of the <a href="#Test-output">Test output</a> and test
  73. program to the <a href="https://svn.boost.org/trac/boost/newticket">Trac
  74. ticket</a>.</li>
  75. </ol>
  76. <p>That&#39;s it! When you complete those steps, you will be done!</p>
  77. <p>The test output supplies all of the basic information about the compiler, std
  78. library, platform, Boost version, and command line, and the test cases you have
  79. added should make it easy for the library maintainer to reproduce the problem. </p>
  80. <h3>Using the framework</h3>
  81. <h4><a name="bug-cpp"><code>bug.cpp</code></a></h4>
  82. <p>Here is <code>bug.cpp</code> as supplied. To report a real bug, use
  83. <code>BOOST_TEST</code> and <code>BOOST_TEST_EQ</code> macros to build your own
  84. test cases. You can delete the three tests already in <code>bug.cpp</code>:</p>
  85. <blockquote>
  86. <pre>#include &lt;boost/detail/lightweight_test_report.hpp&gt;
  87. #include &lt;boost/filesystem.hpp&gt;
  88. namespace fs = boost::filesystem;
  89. int test_main(int, char*[]) // note name
  90. {
  91. BOOST_TEST(2 + 2 == 5); // one convertible-to-bool argument; this one fails!
  92. BOOST_TEST_EQ(4 + 4, 9); // two EqualityComparible arguments; this one fails!
  93. BOOST_TEST(fs::exists(".")); // should pass, so nothing should be reported
  94. return ::boost::report_errors(); // required
  95. }
  96. </pre>
  97. </blockquote>
  98. <h4><a name="Build-and-test">Build and test</a></h4>
  99. <p>POSIX-like systems:</p>
  100. <blockquote>
  101. <pre>cd &lt;boost-root&gt;/libs/filesystem/bug
  102. ../../../b2 -a
  103. bin/bug</pre>
  104. </blockquote>
  105. <p>Windows:</p>
  106. <blockquote>
  107. <pre>cd &lt;boost-root&gt;\libs\filesystem\bug
  108. ..\..\..\b2 -a
  109. bin\bug</pre>
  110. </blockquote>
  111. <h4><a name="Test-output">Test output</a></h4>
  112. <p>Running the test on Windows produced this test output:</p>
  113. <blockquote>
  114. <pre>Microsoft Visual C++ version 14.0
  115. Dinkumware standard library version 610
  116. Win32
  117. Boost version 1.58.0
  118. Command line: bin\bug
  119. bug.cpp(10): test '2 + 2 == 5' failed in function
  120. 'int __cdecl test_main(int,char *[])'
  121. bug.cpp(11): test '4 + 4 == 9' failed in function
  122. 'int __cdecl test_main(int,char *[])': '8' != '9'
  123. 2 errors detected.</pre>
  124. </blockquote>
  125. <p>The test framework runs <code>test_main()</code> from a <code>try</code>
  126. block with a <code>catch</code> block that reports exceptions via <code>
  127. std::exception what()</code>. So the output will differ if an exception is
  128. thrown.</p>
  129. <h2>Background information</h2>
  130. <p>You should now have enough information to file an easy-to-reproduce bug
  131. report. So you can skip reading the rest of this page unless you need to do
  132. something a bit out of the ordinary.</p>
  133. <h3><a name="b2-command-line-options"><code>b2</code> command line</a></h3>
  134. <p><code>b2</code> (formerly <code>bjam</code>) usage:&nbsp; <code>b2
  135. [options] [properties] [target]</code></p>
  136. <p>Boost.Build b2 has many options, properties, and targets, but you will not
  137. need most of them for bug reporting. Here are a few you might find helpful:</p>
  138. <p><b>Options</b></p>
  139. <blockquote>
  140. <p><code>-a</code>&nbsp;&nbsp;&nbsp; Rebuild everything rather than
  141. just out-of-date targets. Used in the example build above to ensure libraries
  142. are built with the same setup as the test program.</p>
  143. </blockquote>
  144. <p><b>Properties</b></p>
  145. <blockquote>
  146. <p><code>address-model=<i>n&nbsp; n</i></code> is 32 or 64.
  147. Explicitly request either 32-bit or 64-bit code generation. This typically
  148. requires that your compiler is appropriately configured.</p>
  149. <p><code>variant=</code><i>string&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; string </i>is
  150. <code>debug</code> or <code>release</code>.</p>
  151. <p><code>toolset=</code><i>string</i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; The C++
  152. compiler to use. For example, <code>gcc-4.9</code>, <code>clang-3.3</code>,
  153. <code>or msvc-14.0</code>.</p>
  154. <p><code>include=</code><i>string&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </i>
  155. Additional include paths for C and C++ compilers.</p>
  156. <p><code>cxxflags=</code><i>string&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </i>
  157. Custom options to pass to the C++ compiler.</p>
  158. <p><code>define=</code><i>string</i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  159. Additional macro definitions for C and C++ compilers. <i>string</i> should be
  160. either <code class="computeroutput">SYMBOL</code> or
  161. <code class="computeroutput">SYMBOL=VALUE</code></p>
  162. </blockquote>
  163. <h3><a name="Rationale">Rationale</a></h3>
  164. <p>Here is the request list again, with rationale added:</p>
  165. <ol>
  166. <li>A simple test program
  167. that:<ul>
  168. <li dir="ltr">
  169. <p dir="ltr">Illustrates the problem <b>[Code communicates more clearly than
  170. prose. If it looks like it will it will take some time to figure out exactly what the
  171. problem is, or worse yet, might result in a wild-goose chase, the bug report
  172. gets set aside to be worked on later and then is often forgotten.] </b>and</li>
  173. <li>Automatically yields an unambiguous pass or fail result - returning zero
  174. for pass and non-zero for fail is preferred <b>[Prevents
  175. miscommunications and allows use in automatic regression tests.]</b>, and </li>
  176. <li>Can be used as the basis for adding tests to Boost.Filesystem&#39;s
  177. regression test suite <b>[With good test cases fixes come easier and
  178. regressions become less likely]</b>.</li>
  179. </ul>
  180. </li>
  181. <li>The compiler, standard library, platform, and Boost version you
  182. used to build and run your test program. <b>[The implementation includes much
  183. platform dependent code, and also depends on the other factors mentioned. Know
  184. these things upfront brings the bug report into focus without having to ask
  185. for more information. ]</b></li>
  186. <li>A description of how to build and run the test program. <b>[If b2
  187. (formerly known as bjam) is used as the build engine, this is not a concern,
  188. but otherwise much more information is needed.]</b></li>
  189. <li>A copy of the output from the test
  190. program, if any. <b>[Avoids misinterpreting results.]</b></li>
  191. <li>An email address for follow-up questions.<b> [Trac comments are the
  192. primary means of response, but it is disheartening when a trac question is not
  193. answered and there is no email address attached for followup.]</b></li>
  194. </ol>
  195. <hr>
  196. <p>Revised
  197. <!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B, %Y" startspan -->28 January, 2015<!--webbot bot="Timestamp" endspan i-checksum="38902" --></p>
  198. <p>&copy; Copyright Beman Dawes, 2014</p>
  199. <p> Distributed under the Boost Software
  200. License, Version 1.0. See <a href="http://www.boost.org/LICENSE_1_0.txt">
  201. www.boost.org/LICENSE_1_0.txt</a></p>
  202. </body>
  203. </html>