![]() |
Boost.Filesystem issues such as bug reports or feature requests should be reported via a GitHub ticket.
GitHub pull requests are encouraged, too, although anything beyond really trivial fixes needs a ticket.
A timely response to your bug report is much more likely if the problem can be immediately reproduced without guesswork and regression tests can be easily created.
You need to provide the following:
See Rationale to find out why the above is needed.
For a mostly automatic framework to provide the above, read on!
The directory boost-root/libs/filesystem/bug
provides a bug test program (bug.cpp)
and a build file (Jamfile.v2). Here
is what you need to do:
bug.cpp using any text or program
editor.
That's it! When you complete those steps, you will be done!
The test output supplies all of the basic information about the compiler, std library, platform, Boost version, and command line, and the test cases you have added should make it easy for the library maintainer to reproduce the problem.
Here is bug.cpp as supplied. To report a real bug,
use BOOST_TEST and BOOST_TEST_EQ macros to build your own
test cases. You can delete the three tests already in bug.cpp:
#include <boost/detail/lightweight_test_report.hpp> #include <boost/filesystem.hpp> namespace fs = boost::filesystem; int test_main(int, char*[]) // note name { BOOST_TEST(2 + 2 == 5); // one convertible-to-bool argument BOOST_TEST_EQ(4 + 4, 9); // two EqualityComparible arguments BOOST_TEST(fs::exists(".")); // should pass, so nothing reported return ::boost::report_errors(); // required }
|
POSIX-like systems |
Microsoft Windows |
|---|---|
cd <boost-root>/libs/filesystem/bug ../../../b2 -a bin/bug |
cd <boost-root>\libs\filesystem\bug ..\..\..\b2 -a bin\bug |
Running the test on Windows produced this test output:
Microsoft Visual C++ version 14.0 Dinkumware standard library version 610 Win32 Boost version 1.58.0 Command line: bin\bug bug.cpp(10): test '2 + 2 == 5' failed in function 'int __cdecl test_main(int,char *[])' bug.cpp(11): test '4 + 4 == 9' failed in function 'int __cdecl test_main(int,char *[])': '8' != '9' 2 errors detected.
The test framework runs test_main() from a try
block with a catch block that
reports exceptions via std::exception::what(). So the output will differ if an exception
is thrown.
You should now have enough information to file an easy-to-reproduce bug report. So you can skip reading the rest of this page unless you need to do something a bit out of the ordinary.
b2 (formerly bjam) usage:
b2 [options] [properties] [target]
Boost.Build
b2 has many options,
properties, and targets, but you will not need most of them for bug reporting.
Here are a few you might find helpful:
Table 1.5. b2 Options
|
Option |
Effect |
|---|---|
-a |
Rebuild everything rather than just out-of-date targets. Used in the example build above to ensure libraries are built with the same setup as the test program. |
Table 1.6. b2 Properties
|
Property |
Effect |
|---|---|
address-model=n
where n is 32 or 64. |
Explicitly request either 32-bit or 64-bit code generation. This typically requires that your compiler is appropriately configured. |
variant=string
where string is |
Request debug or release build. |
toolset=string
where string is composed of the compiler name and optionally, a version. |
The C++ compiler to use. For example, |
include=string
|
Additional include paths for C and C++ compilers. |
cxxflags=string
|
Custom options to pass to the C++ compiler. |
define=string
|
Additional macro definitions for C and C++ compilers. string
should be either |
Here is the request list again, with rationale added:
b2 (formerly known as
bjam) is used as the
build engine, this is not a concern, but otherwise much more information
is needed.]