aboutsummaryrefslogtreecommitdiff
path: root/llvm/unittests/Support/VirtualFileSystemTest.cpp
diff options
context:
space:
mode:
authorRussell Gallop <russell.gallop@sony.com>2020-06-04 14:56:09 +0100
committerRussell Gallop <russell.gallop@sony.com>2020-06-04 14:59:45 +0100
commit3dad3907198b920f5531cedec154e79a72beeec4 (patch)
tree355ade86797d5c5f6f34e749e3f8406a479f3ece /llvm/unittests/Support/VirtualFileSystemTest.cpp
parent931a68f26b9a3de853807ffad7b2cd0a2dd30922 (diff)
downloadllvm-3dad3907198b920f5531cedec154e79a72beeec4.zip
llvm-3dad3907198b920f5531cedec154e79a72beeec4.tar.gz
llvm-3dad3907198b920f5531cedec154e79a72beeec4.tar.bz2
Revert "Relands "[YAMLVFSWriter][Test][NFC] Add couple tests" vol. 2"
This reverts commit 30949926f98576fbff8d5ad0390be5124ffacd7e. This was failing on bot here: http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/32749
Diffstat (limited to 'llvm/unittests/Support/VirtualFileSystemTest.cpp')
-rw-r--r--llvm/unittests/Support/VirtualFileSystemTest.cpp57
1 files changed, 0 insertions, 57 deletions
diff --git a/llvm/unittests/Support/VirtualFileSystemTest.cpp b/llvm/unittests/Support/VirtualFileSystemTest.cpp
index 96092de..85e7093 100644
--- a/llvm/unittests/Support/VirtualFileSystemTest.cpp
+++ b/llvm/unittests/Support/VirtualFileSystemTest.cpp
@@ -2338,60 +2338,3 @@ TEST_F(VFSFromYAMLTest, YAMLVFSWriterTestHandleDirs) {
EXPECT_FALSE(FS->exists(_b.Path + "/b"));
EXPECT_FALSE(FS->exists(_c.Path + "/c"));
}
-
-TEST_F(VFSFromYAMLTest, YAMLVFSWriterTestNestedDirs) {
- ScopedDir TestDirectory("virtual-file-system-test", /*Unique*/ true);
- ScopedDir a(TestDirectory + "/a");
- ScopedDir _a_aa(TestDirectory + "/a/aa");
- ScopedDir b(TestDirectory + "/b");
- ScopedDir _b_bb(TestDirectory + "/b/bb");
- ScopedDir c(TestDirectory + "/c");
- ScopedDir _c_cc(TestDirectory + "/c/cc");
-
- vfs::YAMLVFSWriter VFSWriter;
- VFSWriter.addDirectoryMapping(a.Path, "//root/a");
- VFSWriter.addDirectoryMapping(_a_aa.Path, "//root/a/aa");
- VFSWriter.addDirectoryMapping(b.Path, "//root/b");
- VFSWriter.addDirectoryMapping(_b_bb.Path, "//root/b/bb");
- VFSWriter.addDirectoryMapping(c.Path, "//root/c");
- VFSWriter.addDirectoryMapping(_c_cc.Path, "//root/c/cc");
-
- std::string Buffer;
- raw_string_ostream OS(Buffer);
- VFSWriter.write(OS);
- OS.flush();
-
- IntrusiveRefCntPtr<ErrorDummyFileSystem> Lower(new ErrorDummyFileSystem());
- Lower->addDirectory("//root/a");
- Lower->addDirectory("//root/a/aa");
- Lower->addDirectory("//root/b");
- Lower->addDirectory("//root/b/bb");
- Lower->addDirectory("//root/c");
- Lower->addDirectory("//root/c/cc");
-
- IntrusiveRefCntPtr<vfs::FileSystem> FS = getFromYAMLRawString(Buffer, Lower);
- ASSERT_TRUE(FS.get() != nullptr);
-
- EXPECT_TRUE(FS->exists(a.Path));
- EXPECT_TRUE(FS->exists(_a_aa.Path));
- EXPECT_TRUE(FS->exists(b.Path));
- EXPECT_TRUE(FS->exists(_b_bb.Path));
- EXPECT_TRUE(FS->exists(c.Path));
- EXPECT_TRUE(FS->exists(_c_cc.Path));
-}
-
-TEST(YAMLVFSWriterTest, HandleRootAsVPath) {
- llvm::SmallVector<char, 32> Tmp;
- llvm::sys::path::system_temp_directory(false, Tmp);
- std::string Root = llvm::sys::path::root_path(StringRef(Tmp.data(), Tmp.size())).str();
- llvm::SmallVector<char, 32> Subdir(Root.begin(), Root.end());
- llvm::sys::path::append(Subdir, "foo");
-
- llvm::vfs::YAMLVFSWriter W;
- W.addDirectoryMapping(Root, "/tmp");
- W.addDirectoryMapping(std::string{Subdir.begin(), Subdir.end()} + "/foo", "/tmp/bar");
- std::string Dump;
- llvm::raw_string_ostream ToBeIgnored(Dump);
-
- EXPECT_NO_FATAL_FAILURE(W.write(ToBeIgnored));
-}