summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std/experimental/filesystem/class.path/path.member
Commit message (Collapse)AuthorAgeFilesLines
* Implement <filesystem>Eric Fiselier2018-07-2729-2791/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch implements the <filesystem> header and uses that to provide <experimental/filesystem>. Unlike other standard headers, the symbols needed for <filesystem> have not yet been placed in libc++.so. Instead they live in the new libc++fs.a library. Users of filesystem are required to link this library. (Also note that libc++experimental no longer contains the definition of <experimental/filesystem>, which now requires linking libc++fs). The reason for keeping <filesystem> out of the dylib for now is that it's still somewhat experimental, and the possibility of requiring an ABI breaking change is very real. In the future the symbols will likely be moved into the dylib, or the dylib will be made to link libc++fs automagically). Note that moving the symbols out of libc++experimental may break user builds until they update to -lc++fs. This should be OK, because the experimental library provides no stability guarantees. However, I plan on looking into ways we can force libc++experimental to automagically link libc++fs. In order to use a single implementation and set of tests for <filesystem>, it has been placed in a special `__fs` namespace. This namespace is inline in C++17 onward, but not before that. As such implementation is available in C++11 onward, but no filesystem namespace is present "directly", and as such name conflicts shouldn't occur in C++11 or C++14. llvm-svn: 338093
* Implement P0430R2 - File system library on non-POSIX systems.Eric Fiselier2018-04-021-8/+16
| | | | | | | | | | | This patch implements P0430R2, who's largest change is adding the path::format enumeration for supporting path format conversions in path constructors. However, since libc++'s filesystem only really supports POSIX like systems, there are no real changes needed. This patch simply adds the format enum and then ignores it when it's passed to constructors. llvm-svn: 329031
* Implement filesystem NB comments, relative paths, and related issues.Eric Fiselier2018-04-0210-111/+381
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a fairly large patch that implements all of the filesystem NB comments and the relative paths changes (ex. adding weakly_canonical). These issues and papers are all interrelated so their implementation couldn't be split up nicely. This patch upgrades <experimental/filesystem> to match the C++17 spec and not the published experimental TS spec. Some of the changes in this patch are both API and ABI breaking, however libc++ makes no guarantee about stability for experimental implementations. The major changes in this patch are: * Implement NB comments for filesystem (P0492R2), including: * Implement `perm_options` enum as part of NB comments, and update the `permissions` function to match. * Implement changes to `remove_filename` and `replace_filename` * Implement changes to `path::stem()` and `path::extension()` which support splitting examples like `.profile`. * Change path iteration to return an empty path instead of '.' for trailing separators. * Change `operator/=` to handle absolute paths on the RHS. * Change `absolute` to no longer accept a current path argument. * Implement relative paths according to NB comments (P0219r1) * Combine `path.cpp` and `operations.cpp` since some path functions require access to the operations internals, and some fs operations require access to the path parser. llvm-svn: 329028
* Make filesystem tests generic between experimental and std versions.Eric Fiselier2018-03-2626-53/+27
| | | | | | | | | | | | | | | As I move towards implementing std::filesystem, there is a need to make the existing tests run against both the std and experimental versions. Additionally, it's helpful to allow running the tests against other implementations of filesystem. This patch converts the test to easily target either. First, it adds a filesystem_include.hpp header which is soley responsible for selecting and including the correct implementation. Second, it converts existing tests to use this header instead of including filesystem directly. llvm-svn: 328475
* [libcxx] [test] Strip trailing whitespace. NFC.Stephan T. Lavavej2017-12-071-1/+1
| | | | llvm-svn: 319994
* More of P0600 - '[[nodiscard]] in the Library' mark empty() as nodiscard in ↵Marshall Clow2017-11-162-1/+30
| | | | | | filesystem::path llvm-svn: 318378
* Diagnose when reverse_iterator is used on path::iterator.Eric Fiselier2017-04-131-7/+5
| | | | | | | | | | | | | | | path::iterator isn't a strictly conforming iterator. Specifically it stashes the current element inside the iterator. This leads to UB when used with reverse_iterator since it requires the element to outlive the lifetime of the iterator. This patch adds a static_assert inside reverse_iterator to disallow "stashing iterator types", and it tags path::iterator as such a type. Additionally this patch removes all uses of reverse_iterator<path::iterator> within the tests. llvm-svn: 300164
* [libcxx] [test] Fix comment typos, strip trailing whitespace.Stephan T. Lavavej2017-01-183-5/+5
| | | | | | No functional change, no code review. llvm-svn: 292434
* Fix filesystem::path assignment from {}Eric Fiselier2017-01-182-0/+50
| | | | | | | | Adding `path::operator=(string_type&&)` made the expression `p = {}` ambiguous. This path fixes that ambiguity by making the `string&&` overload a template so it ranks lower during overload resolution. llvm-svn: 292345
* Enable warnings by default for C++ >= 11 and fix -Wshadow occurancesEric Fiselier2016-12-034-4/+4
| | | | llvm-svn: 288557
* Implement modified LWG 2665Eric Fiselier2016-10-151-0/+8
| | | | llvm-svn: 284313
* Implement LWG 2711. Constrain path members.Eric Fiselier2016-08-284-0/+194
| | | | llvm-svn: 279945
* libcxx: Fix path.compare.pass expected resultAdhemerval Zanella2016-08-151-6/+10
| | | | | | | | | | | | | | | | | | | The expected 'filesystem::path::compare' result states that for different path only result sign contains the information about passed arguments (not its integer value). This is due it uses the output of other compare functions (basic_string_view and char_traits) without further handling and char_traits uses memcmp for final buffer comparison. However for GLIBC on AArch64 the code: int ret = memcmp ("b/a/c", "a/b/c", 1); Results in '64' where for x86_64 it results in '1'. This patch fixes the expected 'filesystem::path::compare' by normalizing all the results before assert comparison. llvm-svn: 278745
* Implement P0392r0. Integrate filesystem::path and string_view.Eric Fiselier2016-07-235-3/+116
| | | | llvm-svn: 276511
* Fix 3 bugs in filesystem tests and implementation.Eric Fiselier2016-06-181-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | This patch fixes the following bugs, all of which were discovered while testing a 32 bit build on a 64 bit machine. * path.itr/iterator.pass.cpp has undefined behavior. 'path::iterator' stashes the value of the element inside the iterator. This violates the BiDirIterator requirements but is allowed for path::iterator. However this means that using reverse_iterator<path::iterator> has undefined behavior because it assumes that 'Iter tmp = it; return *tmp' will not create a dangling reference. However it does, and this caused this particular test to fail. * path.native.obs/string_alloc.pass.cpp tested the SSO with a long string. On 32 bit builds std::wstring only has the SSO for strings of size 2. The test was using a string of size 4. * fs.op.space/space.pass.cpp had overflows while calculating the expected values. The fix here is to convert the statvfs data members to std::uintmax_t before multiplying them. The internal implementation already does this but the tests needed to do it as well. llvm-svn: 273078
* Add additional tests in an attempt to diagnose ARM test failures.Eric Fiselier2016-06-181-9/+26
| | | | | | | | | | | | | | | | | | | | | | | | | Currently 4 tests are failing on the ARM buildbot. To try and diagnose each of the failures this patch does the following: 1) path.itr/iterator.pass.cpp * Temporarily print iteration sequence to see where its failing. 2) path.native.obs/string_alloc.pass.cpp * Remove test that ::new is not called when constructing a short string that requires a conversion. Since during the conversion global locale objects might be constructed. 3) fs.op.funcs/space.pass.cpp * Explicitly use uintmax_t in the implementation of space, hopefully preventing possible overflows. * Add additional tests that check for overflow is the calculation of the space_info values. * Add additional tests for the values returned from statfvs. 4) fs.op.funcs/last_write_time.pass.cpp * No changes made yet. llvm-svn: 273075
* Add checkpoints to string allocation test to help with debugging arm failures.Eric Fiselier2016-06-181-1/+6
| | | | llvm-svn: 273072
* Fix a couple of warnings present in the filesystem tests.Eric Fiselier2016-06-171-4/+4
| | | | llvm-svn: 273035
* Add Filesystem TS -- CompleteEric Fiselier2016-06-1725-0/+2118
Add the completed std::experimental::filesystem implementation and tests. The implementation supports C++11 or newer. The TS is built as part of 'libc++experimental.a'. Users of the TS need to manually link this library. Building and testing the TS can be disabled using the CMake option '-DLIBCXX_ENABLE_FILESYSTEM=OFF'. Currently 'libc++experimental.a' is not installed by default. To turn on the installation of the library use '-DLIBCXX_INSTALL_EXPERIMENTAL_LIBRARY=ON'. llvm-svn: 273034
OpenPOWER on IntegriCloud