libstdc++: Properly remove temporary directories in filesystem tests
authorJonathan Wakely <jwakely@redhat.com>
Thu, 23 Jun 2022 13:25:49 +0000 (14:25 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Thu, 23 Jun 2022 16:19:38 +0000 (17:19 +0100)
commit7c1c7e120cca183671b11ba68a6350c8800823c0
treea5eb751fe564102b1df36fca8895edc2b73ae61e
parent124a9e08b7a83795bd4d09001955f0eef68ecd00
libstdc++: Properly remove temporary directories in filesystem tests

Although these tests use filesystem::remove_all to clean up, that fails
because it uses recursive_directory_iterator which is intentionally
bodged by the custom readdir defined in the test.

Just use POSIX rmdir to clean up. We don't need to use _rmdir or _wrmdir
for Windows, because we'll never reach test02() on targets where the
custom readdir doesn't interpose the one from libc.

libstdc++-v3/ChangeLog:

* testsuite/27_io/filesystem/iterators/error_reporting.cc: Use
rmdir to remove directories.
* testsuite/experimental/filesystem/iterators/error_reporting.cc:
Likewise.
libstdc++-v3/testsuite/27_io/filesystem/iterators/error_reporting.cc
libstdc++-v3/testsuite/experimental/filesystem/iterators/error_reporting.cc