10#include "clang-include-cleaner/Record.h"
12#include "gtest/gtest.h"
20 auto Index = std::make_unique<FileIndex>();
21 for (
const auto &Input : Inputs) {
22 if (!Input.second.IsMainFile)
24 TU.
Code = Input.second.Code;
27 std::shared_ptr<const include_cleaner::PragmaIncludes> PI) {
28 auto &Ctx = ASTCtx.getASTContext();
29 auto &PP = ASTCtx.getPreprocessor();
30 Index->updatePreamble(
testPath(Input.first()),
"null", Ctx, PP, *PI);
33 Index->updateMain(
testPath(Input.first()), MainAST);
40 if (It == Inputs.end()) {
41 ADD_FAILURE() <<
"Accessing non-existing file: " <<
Filename;
44 TU.
Code = It->second.Code;
49void TestWorkspace::addInput(llvm::StringRef
Filename,
50 const SourceFile &Input) {
51 Inputs.insert(std::make_pair(
Filename, Input));
std::string Filename
Filename as a string.
Stores and provides access to parsed AST.
std::optional< ParsedAST > openFile(llvm::StringRef Filename)
std::unique_ptr< SymbolIndex > index()
std::string testPath(PathRef File, llvm::sys::path::Style Style)
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//
The captured AST context.
std::shared_ptr< const PreambleData > preamble(PreambleParsedCallback PreambleCallback=nullptr) const
llvm::StringMap< std::string > AdditionalFiles