[Bug libstdc++/90787] New: filesystem tests fail if file permissions are not supported
redi at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Sat Jun 8 21:17:00 GMT 2019
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90787
Bug ID: 90787
Summary: filesystem tests fail if file permissions are not
supported
Product: gcc
Version: 10.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libstdc++
Assignee: unassigned at gcc dot gnu.org
Reporter: redi at gcc dot gnu.org
Target Milestone: ---
Running the test as root gives:
FAIL: 27_io/filesystem/iterators/directory_iterator.cc execution test
FAIL: 27_io/filesystem/iterators/recursive_directory_iterator.cc execution test
FAIL: 27_io/filesystem/operations/exists.cc execution test
FAIL: 27_io/filesystem/operations/is_empty.cc execution test
FAIL: 27_io/filesystem/operations/remove.cc execution test
FAIL: 27_io/filesystem/operations/status.cc execution test
FAIL: 27_io/filesystem/operations/symlink_status.cc execution test
FAIL: 27_io/filesystem/operations/temp_directory_path.cc execution test
FAIL: experimental/filesystem/operations/remove.cc execution test
FAIL: experimental/filesystem/operations/temp_directory_path.cc execution test
FAIL: experimental/filesystem/operations/exists.cc execution test
FAIL: experimental/filesystem/operations/is_empty.cc execution test
FAIL: experimental/filesystem/iterators/directory_iterator.cc execution test
FAIL: experimental/filesystem/iterators/recursive_directory_iterator.cc
execution test
This is because those tests assume that it's possible to make a file or
directory unreadable, so that a permission denied error will be given. On
Windows we can't set permissions, and that's probably true on other supported
targets too. The superuser (or any user with suitable privs) can access any
file even if it isn't readable. The testsuite should skip tests that rely on
permissions if they aren't going to work.
That will also entail splitting some test files into the parts that rely on
permissions and the parts that don't.
More information about the Gcc-bugs
mailing list