//===--- RewriterTestContext.h ----------------------------------*- C++ -*-===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // // This file defines a utility class for Rewriter related tests. // //===----------------------------------------------------------------------===// #ifndef LLVM_CLANG_UNITTESTS_TOOLING_REWRITERTESTCONTEXT_H #define LLVM_CLANG_UNITTESTS_TOOLING_REWRITERTESTCONTEXT_H #include "clang/Basic/Diagnostic.h" #include "clang/Basic/DiagnosticOptions.h" #include "clang/Basic/FileManager.h" #include "clang/Basic/LangOptions.h" #include "clang/Basic/SourceManager.h" #include "clang/Rewrite/Core/Rewriter.h" #include "llvm/Support/FileSystem.h" #include "llvm/Support/Path.h" #include "llvm/Support/raw_ostream.h" namespace clang { /// \brief A very simple diagnostic consumer that prints to stderr and keeps /// track of the number of diagnostics. /// /// This avoids a dependency on clangFrontend for FormatTests. struct RewriterDiagnosticConsumer : public DiagnosticConsumer { … }; /// \brief A class that sets up a ready to use Rewriter. /// /// Useful in unit tests that need a Rewriter. Creates all dependencies /// of a Rewriter with default values for testing and provides convenience /// methods, which help with writing tests that change files. class RewriterTestContext { … }; } // end namespace clang #endif