[committed] libstdc++: Skip filesystem tests that depend on permissions [PR90787]
Jonathan Wakely
jwakely@redhat.com
Mon Aug 23 13:47:52 GMT 2021
On 20/08/21 15:16 +0100, Jonathan Wakely wrote:
>Tests that depend on filesystem permissions FAIL if run on Windows or as
>root. Add a helper function to detect those cases, so the tests can skip
>those checks gracefully.
>
>Signed-off-by: Jonathan Wakely <jwakely@redhat.com>
>
>libstdc++-v3/ChangeLog:
>
> PR libstdc++/90787
> * testsuite/27_io/filesystem/iterators/directory_iterator.cc:
> Use new __gnu_test::permissions_are_testable() function.
> * testsuite/27_io/filesystem/iterators/recursive_directory_iterator.cc:
> Likewise.
> * testsuite/27_io/filesystem/operations/exists.cc: Likewise.
> * testsuite/27_io/filesystem/operations/is_empty.cc: Likewise.
> * testsuite/27_io/filesystem/operations/remove.cc: Likewise.
> * testsuite/27_io/filesystem/operations/remove_all.cc: Likewise.
> * testsuite/27_io/filesystem/operations/status.cc: Likewise.
> * testsuite/27_io/filesystem/operations/symlink_status.cc:
> Likewise.
> * testsuite/27_io/filesystem/operations/temp_directory_path.cc:
> Likewise.
> * testsuite/experimental/filesystem/iterators/directory_iterator.cc:
> Likewise.
> * testsuite/experimental/filesystem/iterators/recursive_directory_iterator.cc:
> Likewise.
> * testsuite/experimental/filesystem/operations/exists.cc:
> Likewise.
> * testsuite/experimental/filesystem/operations/is_empty.cc:
> Likewise.
> * testsuite/experimental/filesystem/operations/remove.cc:
> Likewise.
> * testsuite/experimental/filesystem/operations/remove_all.cc:
> Likewise.
> * testsuite/experimental/filesystem/operations/temp_directory_path.cc:
> Likewise.
> * testsuite/util/testsuite_fs.h (__gnu_test::permissions_are_testable):
> New function to guess whether testing permissions will work.
This causes new failures for bare metal targets where the path tests
run, even though the rest of the filesystem lib isn't supported.
That's because I forgot to make the new function inline, so it gets
compiled in every filesystem test, and so requires a definition of
geteuid even if the function isn't used.
Making the new function inline should be sufficient to fix that.
Tested powerpc64le-linux. Committed to trunk.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.txt
Type: text/x-patch
Size: 928 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/libstdc++/attachments/20210823/267e3ac7/attachment.bin>
More information about the Libstdc++
mailing list