[Blocklist] Make sure blocklist config is read through VFS

Make sure block-list file is read through VFS so CASFS can be used to
read the configuration to ensure sound caching, and also the path of the
blocklist can be canonicalized via path remapping.
This commit is contained in:
Steven Wu
2024-09-26 16:04:17 -07:00
parent cf81f05172
commit 82c9fdf68b
5 changed files with 17 additions and 6 deletions

View File

@@ -14,6 +14,7 @@
#include "swift/AST/SearchPathOptions.h"
#include "swift/Basic/Defer.h"
#include "swift/Basic/BlockList.h"
#include "swift/Basic/SourceManager.h"
using namespace swift;
@@ -46,7 +47,8 @@ TEST(BlocklistTest, testYamlParsing) {
ASSERT_FALSE(llvm::sys::fs::createUniqueDirectory(
"BlocklistTest.testYamlParsing", temp));
SWIFT_DEFER { llvm::sys::fs::remove_directories(temp); };
BlockListStore store;
SourceManager sm;
BlockListStore store(sm);
std::string path1, path2;
ASSERT_FALSE(emitFileWithContents(temp, "block1.yaml",
"---\n"