[llvm] 562cd31 - [llvm][test] Skip physical filesystem test if unsupported

Ben Langmuir via llvm-commits llvm-commits at lists.llvm.org
Wed May 3 12:14:46 PDT 2023


Author: Ben Langmuir
Date: 2023-05-03T12:14:00-07:00
New Revision: 562cd31ebd30b604f235a9f48ab0ee8125520f2d

URL: https://github.com/llvm/llvm-project/commit/562cd31ebd30b604f235a9f48ab0ee8125520f2d
DIFF: https://github.com/llvm/llvm-project/commit/562cd31ebd30b604f235a9f48ab0ee8125520f2d.diff

LOG: [llvm][test] Skip physical filesystem test if unsupported

We are relying on deleting the working directory to trigger a later
error in getcwd, but some platforms (e.g. Solaris) disallow deleting the
working directory of the process. Skip the test in that case.

Differential Revision: https://reviews.llvm.org/D149760

Added: 
    

Modified: 
    llvm/unittests/Support/VirtualFileSystemTest.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/unittests/Support/VirtualFileSystemTest.cpp b/llvm/unittests/Support/VirtualFileSystemTest.cpp
index cfbb81e4cb283..e1b3ab693729c 100644
--- a/llvm/unittests/Support/VirtualFileSystemTest.cpp
+++ b/llvm/unittests/Support/VirtualFileSystemTest.cpp
@@ -537,7 +537,9 @@ TEST(VirtualFileSystemTest, PhysicalFileSystemWorkingDirFailure) {
       llvm::make_scope_exit([&] { sys::fs::set_current_path(PrevWD); });
 
   // Delete the working directory to create an error.
-  ASSERT_EQ(sys::fs::remove_directories(WD), std::error_code());
+  if (sys::fs::remove_directories(WD, /*IgnoreErrors=*/false))
+    // Some platforms (e.g. Solaris) disallow removal of the working directory.
+    GTEST_SKIP() << "test requires deletion of working directory";
 
   // Verify that we still get two separate working directories.
   auto FS1 = vfs::createPhysicalFileSystem();


        


More information about the llvm-commits mailing list