[libcxx-commits] [PATCH] D98954: [libcxx] [test] Don't leave test dirs behind in fs.op.current_path on Windows

Martin Storsjö via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Mar 22 10:36:43 PDT 2021


mstorsjo updated this revision to Diff 332357.
mstorsjo added a comment.

Fixed nesting of static_env and CWDGuard, restore the cwd (with CWDGuard) before cleaning up the static_env.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D98954

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


Index: libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.current_path/current_path.pass.cpp
===================================================================
--- libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.current_path/current_path.pass.cpp
+++ libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.current_path/current_path.pass.cpp
@@ -51,8 +51,8 @@
 
 TEST_CASE(current_path_after_change_test)
 {
-    CWDGuard guard;
     static_test_env static_env;
+    CWDGuard guard;
     const path new_path = static_env.Dir;
     current_path(new_path);
     TEST_CHECK(current_path() == new_path);
@@ -60,8 +60,8 @@
 
 TEST_CASE(current_path_is_file_test)
 {
-    CWDGuard guard;
     static_test_env static_env;
+    CWDGuard guard;
     const path p = static_env.File;
     std::error_code ec;
     const path old_p = current_path();
@@ -72,8 +72,8 @@
 
 TEST_CASE(set_to_non_absolute_path)
 {
-    CWDGuard guard;
     static_test_env static_env;
+    CWDGuard guard;
     const path base = static_env.Dir;
     current_path(base);
     const path p = static_env.Dir2.filename();


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D98954.332357.patch
Type: text/x-patch
Size: 1108 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20210322/c70151e0/attachment.bin>


More information about the libcxx-commits mailing list