diff options
Diffstat (limited to 'clang-tools-extra/unittests/clangd/TestFS.h')
-rw-r--r-- | clang-tools-extra/unittests/clangd/TestFS.h | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/clang-tools-extra/unittests/clangd/TestFS.h b/clang-tools-extra/unittests/clangd/TestFS.h index 9c2a15e63d3..a0efb755d00 100644 --- a/clang-tools-extra/unittests/clangd/TestFS.h +++ b/clang-tools-extra/unittests/clangd/TestFS.h @@ -40,15 +40,22 @@ public: // A Compilation database that returns a fixed set of compile flags. class MockCompilationDatabase : public GlobalCompilationDatabase { public: - /// When \p UseRelPaths is true, uses relative paths in compile commands. - /// When \p UseRelPaths is false, uses absoulte paths. - MockCompilationDatabase(bool UseRelPaths = false); + /// If \p Directory is not empty, use that as the Directory field of the + /// CompileCommand. + /// + /// If \p RelPathPrefix is not empty, use that as a prefix in front of the + /// source file name, instead of using an absolute path. + MockCompilationDatabase(StringRef Directory = StringRef(), + StringRef RelPathPrefix = StringRef()); llvm::Optional<tooling::CompileCommand> getCompileCommand(PathRef File) const override; std::vector<std::string> ExtraClangFlags; - const bool UseRelPaths; + +private: + StringRef Directory; + StringRef RelPathPrefix; }; // Returns an absolute (fake) test directory for this OS. |