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