summaryrefslogtreecommitdiff
path: root/libstdc++-v3/testsuite
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2022-06-28 15:56:30 +0100
committerJonathan Wakely <jwakely@redhat.com>2022-06-30 14:16:06 +0100
commit6c96b14a19a9e6c365eacc59868a866b99f9786d (patch)
tree7d80b214df5310faec35fc1ca6d14c0c2504e2f3 /libstdc++-v3/testsuite
parentfa22c9c7a979655efaff888138107324afc510c5 (diff)
libstdc++: Fix experimental::filesystem::status on Windows [PR88881]
Although the Filesystem TS isn't properly supported on Windows (unlike the C++17 Filesystem lib), most tests do pass. Two of the failures are due to PR 88881 which was only fixed for std::filesystem not the TS. This applies the fix to the TS implementation too. libstdc++-v3/ChangeLog: PR libstdc++/88881 * src/filesystem/ops.cc (has_trailing_slash): New helper function. (fs::status): Strip trailing slashes. (fs::symlink_status): Likewise. * testsuite/experimental/filesystem/operations/temp_directory_path.cc: Clean the environment before each test and use TMP instead of TMPDIR so the test passes on Windows.
Diffstat (limited to 'libstdc++-v3/testsuite')
-rw-r--r--libstdc++-v3/testsuite/experimental/filesystem/operations/temp_directory_path.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/libstdc++-v3/testsuite/experimental/filesystem/operations/temp_directory_path.cc b/libstdc++-v3/testsuite/experimental/filesystem/operations/temp_directory_path.cc
index 9e9cd44d460..c2945c90866 100644
--- a/libstdc++-v3/testsuite/experimental/filesystem/operations/temp_directory_path.cc
+++ b/libstdc++-v3/testsuite/experimental/filesystem/operations/temp_directory_path.cc
@@ -105,6 +105,8 @@ test03()
if (!__gnu_test::permissions_are_testable())
return;
+ clean_env();
+
auto p = __gnu_test::nonexistent_path();
create_directories(p/"tmp");
permissions(p, fs::perms::none);
@@ -129,8 +131,10 @@ test03()
void
test04()
{
+ clean_env();
+
__gnu_test::scoped_file f;
- set_env("TMPDIR", f.path.string());
+ set_env("TMP", f.path.string());
std::error_code ec;
auto r = fs::temp_directory_path(ec);
VERIFY( ec == std::make_error_code(std::errc::not_a_directory) );