[libcxx-commits] [PATCH] D98139: [libcxx] [test] Fix temp_directory_path for windows

Martin Storsjö via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Mar 15 10:25:50 PDT 2021


This revision was automatically updated to reflect the committed changes.
Closed by commit rGb5e228fc00b1: [libcxx] [test] Fix the temp_directory_path test for windows (authored by mstorsjo).

Changed prior to commit:
  https://reviews.llvm.org/D98139?vs=329095&id=330715#toc

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D98139/new/

https://reviews.llvm.org/D98139

Files:
  libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.temp_dir_path/temp_directory_path.pass.cpp


Index: libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.temp_dir_path/temp_directory_path.pass.cpp
===================================================================
--- libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.temp_dir_path/temp_directory_path.pass.cpp
+++ libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.temp_dir_path/temp_directory_path.pass.cpp
@@ -55,10 +55,16 @@
       std::string name;
       path p;
     } cases[] = {
+#ifdef _WIN32
+        {"TMP", env.create_dir("dir1")},
+        {"TEMP", env.create_dir("dir2")},
+        {"USERPROFILE", env.create_dir("dir3")}
+#else
         {"TMPDIR", env.create_dir("dir1")},
         {"TMP", env.create_dir("dir2")},
         {"TEMP", env.create_dir("dir3")},
         {"TEMPDIR", env.create_dir("dir4")}
+#endif
     };
     for (auto& TC : cases) {
         PutEnv(TC.name, TC.p);
@@ -112,7 +118,10 @@
         std::error_code ec = GetTestEC();
         path ret = temp_directory_path(ec);
         TEST_CHECK(!ec);
+#ifndef _WIN32
+        // On Windows, the function falls back to the Windows folder.
         TEST_CHECK(ret == "/tmp");
+#endif
         TEST_CHECK(is_directory(ret));
     }
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D98139.330715.patch
Type: text/x-patch
Size: 1193 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20210315/1a466a96/attachment-0001.bin>


More information about the libcxx-commits mailing list