aboutsummaryrefslogtreecommitdiff
path: root/llvm/unittests/Support/VirtualFileSystemTest.cpp
diff options
context:
space:
mode:
authorBen Langmuir <blangmuir@apple.com>2023-05-03 09:17:04 -0700
committerBen Langmuir <blangmuir@apple.com>2023-05-03 12:14:00 -0700
commit562cd31ebd30b604f235a9f48ab0ee8125520f2d (patch)
tree2ffb43516a7dbac9ed9078f1f4e99e49fa131d42 /llvm/unittests/Support/VirtualFileSystemTest.cpp
parent8fe8d69ddf881db70cb8df31e614a06e633e2c5f (diff)
downloadllvm-562cd31ebd30b604f235a9f48ab0ee8125520f2d.zip
llvm-562cd31ebd30b604f235a9f48ab0ee8125520f2d.tar.gz
llvm-562cd31ebd30b604f235a9f48ab0ee8125520f2d.tar.bz2
[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
Diffstat (limited to 'llvm/unittests/Support/VirtualFileSystemTest.cpp')
-rw-r--r--llvm/unittests/Support/VirtualFileSystemTest.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/unittests/Support/VirtualFileSystemTest.cpp b/llvm/unittests/Support/VirtualFileSystemTest.cpp
index cfbb81e..e1b3ab6 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();