58 Commits

Author SHA1 Message Date
Andrey Semashev
4541024186 Added explicit dependencies to tests.
Also use a more specific include from Boost.SmartPtr.
2026-01-24 23:02:48 +03:00
Andrey Semashev
ae458c7884 Switch to POSIX API on Cygwin.
This follows other Boost libraries (in particular, Boost.System) in
treating Cygwin as a POSIX platform rather than Windows. This is
a breaking change, but apparently downstream Boost.Filesystem packages
on Cygwin are patched to the same effect.

As part of this change, AT_NO_AUTOMOUNT is made an optional requirement
to enable POSIX *at APIs. This flag is not POSIX-standard and is not
supported on Cygwin, while *at APIs are.
2025-12-25 04:09:00 +03:00
René Ferdinand Rivera Morell
5746b3f0d6 Add support for modular build structure. (#318)
* Make the library modular usable.

* Use searched-lib targets for external/OS/Windows libraries to avoid trying to refer to mangled names for them. And hence failing to find them.

* Use the OS temp dir for creating test dir to avoid putting dirs in random location based on where one runs tests from.

* Switch to library requirements instead of source. As source puts extra source in install targets.

* Updated dependencies.

* Add missing NO_LIB usage requirements.

* Add missing import-search for cconfig/predef checks.

* Add requires-b2 check to top-level build file.

* Bump B2 require to 5.2

* Change all <source> references to <library>.

* Update copyright dates.

* Move inter-lib dependencies to a project variable and into the build targets.

* Split b2 dependencies into public and private.

* Undo temp dir for test change.

* Make winapi dep target-os specific. And remove direct atomic dep as it is already handled by conditional rule.

* Remove bug targets from all build as that's not a regular project.
2024-09-22 19:57:37 +03:00
Andrey Semashev
1426ca53b4 v4: Make equivalent() fail if only one of the paths exists.
In v3, equivaluent would successfully return false if one of the paths
existed and the other one didn't. v4 now fails in this case, similar
to std::filesystem.
2024-01-08 02:35:29 +03:00
Andrey Semashev
7bb038fcb8 Added a new cstdio.hpp header with fopen overload.
This overload takes filesystem::path as its first argument to support
wide character paths on Windows. Other than this, the overload is
equivalent to std::fopen.
2023-06-12 15:02:30 +03:00
Andrey Semashev
39b0f3a1fe Check that the type is an iterator in is_path_source_iterator.
This fixes hard compilation error when the passed type is not an iterator
at all. As a result, path constructors from iterators are no longer
selected by the compiler in overload resolution in users' code, when
the caller is passing an initializer list with a pair of non-iterator
elements. Added a test for this fix.

Also, use integral_constant to implement boolean type traits.

Fixes https://github.com/boostorg/filesystem/issues/287.
2023-05-21 17:27:12 +03:00
Andrey Semashev
396eef1398 Restrict generic path comparison operators to avoid ambiguities with std lib.
Path comparison operators that accept arbitrary path source types now require
the other argument to be exactly path. This prevents the compiler from picking
those operators when the other argument is convertible to path. This can happen
even when neither of the arguments are actually paths, e.g. when the
comparison operators are brought into the current scope by a using directive.

Fixes https://github.com/boostorg/filesystem/issues/285.
2023-05-08 00:11:37 +03:00
Andrey Semashev
f05ac885d1 Disabled construction and assignment of path from nullptr.
It is always an error and UB. Explicitly deleting the functions produces
better compiler errors.

Closes https://github.com/boostorg/filesystem/issues/278.
2023-02-04 20:24:18 +03:00
Andrey Semashev
7cd11c770b Moved header that is used in tests to tests. 2022-07-07 23:34:35 +03:00
Andrey Semashev
18a8a3430d Added support for removing read-only files on Windows.
Reworked remove() operation to separate POSIX and Windows implementations.
On Windows, if the file to be removed is read-only, try to reset the read-only
attribute before deleting the file. If deleting fails (other than because the
file is already deleted), try to restore the read-only attribute.

As a side effect, we were able to remove an implementation detail value from
the file_type enum that was used by the old remove() implementation.

Added a test for remove() on a read-only file on Windows. Also added tests
for remove_all(), including for cases with symlinks, hardlinks and read-only
files.

Also, corrected mklink /J argument in tests. The command accepts /j (lowercase)
to the same effect, but the formal help lists /J (uppercase) to create junctions.

Reported in https://github.com/boostorg/filesystem/issues/216.
2021-11-18 14:54:17 +03:00
Andrey Semashev
667f785e93 Disable deprecated CRT warnings on Windows also in tests. 2021-10-26 20:06:48 +03:00
Andrey Semashev
7339882ccf Added BOOST_FILESYSTEM_VERSION 4 and moved breaking path changes to v4.
Boost.Filesystem v4 will contain breaking changes from v3 that are required
for better compatibility with C++17 std::filesystem. It will also remove
the deprecated features of v3.

Updated docs to reflect the differences between v3 and v4. Updated tests
to verify both v3 and v4 where the differences are present.
2021-06-13 03:20:30 +03:00
Andrey Semashev
45606c2f23 Disable building examples in tests by default. 2021-05-20 23:39:06 +03:00
Andrey Semashev
4849b6c506 Added building examples in CI. 2021-05-19 03:19:08 +03:00
Andrey Semashev
c653976208 Fixed mklink availability check in operations_test.
Instead of enabling/disabling the test compilation, define a macro when
mklink shell command is detected to be available. Test this macro
in all tests that use this command to create junctions and symlinks
on Windows.

Also, renamed reparce_tag_file_placeholder.cpp test to fix a spelling
error.
2020-05-18 16:03:26 +03:00
Andrey Semashev
559b0c291a In copy, support symlink creation when target directory is not current.
When the source path is not absolute and copy_options::create_symlinks is
specified, deduce the relative path from the target location to the source
file to create a symlink. This allows to copy to a path that is not the current
path.

Also, added absolute overloads taking error_code argyment.

Also, when current_path() is used as a default argument to other operations,
and the operation also accepts error_code, use current_path(ec) to report
errors through the error code rather than throwing an exception.

Also, added a test for copy operation.
2020-05-11 15:10:23 +03:00
Roman Savchenko
ed9e019b01 Add test for reparse point that is not symlink 2020-05-06 13:37:28 +03:00
Andrey Semashev
89b5152e86 Fixed check for mklink on Windows.
For some unknown reason, Windows 8.1 system shell returns error code 1 when
invoking mklink to test if it exists. To work around this we now analyze
output of the command in the Jamfile. As an added bonus, the test is not
compiled when mklink is not supported.
2020-05-04 20:00:40 +03:00
Flamefire
ccb22fc517 Add test to trigger bug #99
Resolving junction points in read_symlink and canonical is wrong
2020-05-01 17:02:48 +02:00
Andrey Semashev
2c1fa1a4a0 Removed linking with Boost.System.
Since Boost.System is now header-only, no need to depend on its library.

Fixes https://github.com/boostorg/filesystem/issues/98.
2019-01-14 20:08:41 +03:00
Peter Dimov
3ae9ac8e27 Add global visibility to libboost_filesystem as well 2018-09-26 08:29:28 +03:00
Peter Dimov
7ba4bfb949 Simplify test/Jamfile 2018-09-26 06:05:17 +03:00
Peter Dimov
68909064bd Disable hidden visibility under UBSan for the codecvt-using tests 2018-09-26 05:58:36 +03:00
Peter Dimov
a183553454 Add a test for the fs::copy issue in PR #70/#71 2018-09-05 22:24:09 +03:00
Peter Dimov
f13aa18a93 Fix BOOST_FOREACH support; add test 2018-09-05 07:59:20 +03:00
Peter Dimov
589bfb0436 Add quick test target (for CI) 2017-12-02 17:59:21 +02:00
Peter Dimov
1dc51988bb Make operations_unit_test take a current directory argument; pass one in test/Jamfile 2017-11-22 05:05:43 +02:00
Beman
170f483655 Add test/config_info.cpp to increase macro state reporting in hopes of easing debugging on remote machines. 2017-01-08 15:23:42 -05:00
Beman
a7ac4c088f Add relative_test to Jamfile, fix Cygwin/GCC C++03 enum constant usage error. 2015-08-10 08:09:48 -04:00
Beman
bf1339e282 Remove use of <boost/test/prg_exec_monitor.hpp>. It has caused trouble for years, and I'm tired of fighting with it. The last straw was adding a Cygwin gcc toolset, only to have <boost/test/prg_exec_monitor.hpp> fail to link. Change to always use <boost/detail/lightweight_main.hpp>, which is trouble-free. 2014-08-06 12:16:06 -04:00
Beman
750a82e20d Revert "Merge branch 'develop' of github.com:boostorg/filesystem into develop"
This reverts commit 4610afc49e, reversing
changes made to 6623bde4fe.
2014-08-05 09:16:57 -04:00
Beman
cc99cc6ceb Merge branch 'develop' into ts-develop 2014-07-31 17:24:34 -04:00
Beman
e8c90f7f15 Add test for ODR violations such as forgetting to inline a function in a header. Thanks to STL for pointing out this testing technique. 2014-07-25 17:58:15 -04:00
Beman
e59aecbcbe Update the tests. Unstable. 2014-07-09 08:57:45 -04:00
Beman Dawes
842f91ada2 Revert mutex locking attempt. VC++ static builds failed in the C runtime because Microsoft staticly initializes some stuff that should be dynamically initialized.
[SVN r83027]
2013-02-19 21:06:16 +00:00
Beman Dawes
78646135eb Current state of development.
[SVN r83026]
2013-02-19 21:05:47 +00:00
Beman Dawes
bb0fe7585c Add BOOST_FOREACH support. Correct C++11 range-based for statement enabler signatures. Improve test coverage. Clears feature requests #5896 and #6521.
[SVN r79451]
2012-07-12 13:53:17 +00:00
Beman Dawes
d1a72fd781 Revert to BOOST_FILESYSTEM_STATIC_LINK as the default if no linkage macros supplied. See http://www.boost.org/doc/libs/1_49_0/libs/config/doc/html/boost_config/boost_macro_reference.html#boost_config.boost_macro_reference.macros_for_libraries_with_separate_source_code
Add test to verify correct default.

[SVN r78273]
2012-04-30 15:00:21 +00:00
Beman Dawes
21ec949654 filesystem testing change: use <boost/test/prg_exec_monitor.hpp> by default, define BOOST_LIGHTWEIGHT_MAIN to use <boost/detail/lightweight_main.hpp>. This gives us the better exception reporting of <boost/test/prg_exec_monitor.hpp> but provides easy fallback to <boost/detail/lightweight_main.hpp> if desired.
[SVN r78057]
2012-04-18 01:31:53 +00:00
Beman Dawes
073cb27538 Add statically linked tests in addition to the shared tests since filesystem has a history of tests that fail only in one of the linking modes
[SVN r77603]
2012-03-28 12:36:52 +00:00
Beman Dawes
7941871477 Filesystem - Delete v3 directories no longer needed. Cleanup links, namespaces, and other residue from dual v2/v3 support.
[SVN r77555]
2012-03-26 12:44:24 +00:00
Beman Dawes
16099b4c7d Filesystem - Move V3 files and directories into place
[SVN r77554]
2012-03-26 12:31:06 +00:00
Beman Dawes
883ba9b788 Filesystem - delete v2 directories, forwarding files.
[SVN r77553]
2012-03-26 12:27:17 +00:00
Beman Dawes
0d6af9221d Initial commit
[SVN r72920]
2011-07-05 14:26:37 +00:00
Beman Dawes
7faca8cd27 <test-info>always_show_run_output for V3 operations_test
[SVN r68622]
2011-02-03 13:04:35 +00:00
Beman Dawes
7922c919d8 V2 tests added. All tests passing on at least one compiler, none passing on all compilers
[SVN r62759]
2010-06-10 20:02:39 +00:00
Beman Dawes
98d00b2e88 Add Build and Test support. Build is working, a few tests are working.
[SVN r62662]
2010-06-09 15:07:03 +00:00
Beman Dawes
fa515c07f5 Move files into new v2 + v3 directory structure
[SVN r62653]
2010-06-09 13:00:15 +00:00
Vladimir Prus
121ad129f0 Fix Boost.Filesystem->Boost.System dependency for windows/shared.
[SVN r58028]
2009-11-29 10:03:34 +00:00
Beman Dawes
f46a5d59c0 Remove redundant Jamfile <define>s
[SVN r49080]
2008-10-01 14:14:58 +00:00