#include "clang/Tooling/Tooling.h"
#include "clang/AST/ASTConsumer.h"
#include "clang/AST/DeclCXX.h"
#include "clang/AST/DeclGroup.h"
#include "clang/Driver/Compilation.h"
#include "clang/Driver/Driver.h"
#include "clang/Frontend/ASTUnit.h"
#include "clang/Frontend/CompilerInstance.h"
#include "clang/Frontend/FrontendAction.h"
#include "clang/Frontend/FrontendActions.h"
#include "clang/Frontend/TextDiagnosticBuffer.h"
#include "clang/Testing/CommandLineArgs.h"
#include "clang/Tooling/ArgumentsAdjusters.h"
#include "clang/Tooling/CompilationDatabase.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/TargetSelect.h"
#include "llvm/TargetParser/Host.h"
#include "gtest/gtest.h"
#include <algorithm>
#include <string>
#include <vector>
namespace clang {
namespace tooling {
namespace {
class TestAction : public clang::ASTFrontendAction { … };
class FindTopLevelDeclConsumer : public clang::ASTConsumer { … };
}
TEST(runToolOnCode, FindsNoTopLevelDeclOnEmptyCode) { … }
namespace {
class FindClassDeclXConsumer : public clang::ASTConsumer { … };
bool FindClassDeclX(ASTUnit *AST) { … }
struct TestDiagnosticConsumer : public DiagnosticConsumer { … };
}
TEST(runToolOnCode, FindsClassDecl) { … }
TEST(buildASTFromCode, FindsClassDecl) { … }
TEST(buildASTFromCode, ReportsErrors) { … }
TEST(newFrontendActionFactory, CreatesFrontendActionFactoryFromType) { … }
struct IndependentFrontendActionCreator { … };
TEST(newFrontendActionFactory, CreatesFrontendActionFactoryFromFactoryType) { … }
TEST(ToolInvocation, TestMapVirtualFile) { … }
TEST(ToolInvocation, TestVirtualModulesCompilation) { … }
TEST(ToolInvocation, DiagnosticsEngineProperlyInitializedForCC1Construction) { … }
TEST(ToolInvocation, CustomDiagnosticOptionsOverwriteParsedOnes) { … }
struct DiagnosticConsumerExpectingSourceManager : public DiagnosticConsumer { … };
TEST(ToolInvocation, DiagConsumerExpectingSourceManager) { … }
TEST(ToolInvocation, CC1Args) { … }
TEST(ToolInvocation, CC1ArgsInvalid) { … }
namespace {
llvm::IntrusiveRefCntPtr<llvm::vfs::OverlayFileSystem>
overlayRealFS(llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem> VFS) { … }
struct CommandLineExtractorTest : public ::testing::Test { … };
}
TEST_F(CommandLineExtractorTest, AcceptOffloading) { … }
TEST_F(CommandLineExtractorTest, AcceptOffloadingCompile) { … }
TEST_F(CommandLineExtractorTest, AcceptOffloadingSyntaxOnly) { … }
TEST_F(CommandLineExtractorTest, AcceptExternalAssembler) { … }
TEST_F(CommandLineExtractorTest, AcceptEmbedBitcode) { … }
TEST_F(CommandLineExtractorTest, AcceptSaveTemps) { … }
TEST_F(CommandLineExtractorTest, AcceptPreprocessedInputFile) { … }
TEST_F(CommandLineExtractorTest, RejectMultipleArchitectures) { … }
TEST_F(CommandLineExtractorTest, RejectMultipleInputFiles) { … }
struct VerifyEndCallback : public SourceFileCallbacks { … };
#if !defined(_WIN32)
TEST(newFrontendActionFactory, InjectsSourceFileCallbacks) { … }
#endif
struct SkipBodyConsumer : public clang::ASTConsumer { … };
struct SkipBodyAction : public clang::ASTFrontendAction { … };
TEST(runToolOnCode, TestSkipFunctionBody) { … }
TEST(runToolOnCodeWithArgs, TestNoDepFile) { … }
struct CheckColoredDiagnosticsAction : public clang::ASTFrontendAction { … };
TEST(runToolOnCodeWithArgs, DiagnosticsColor) { … }
TEST(ClangToolTest, ArgumentAdjusters) { … }
TEST(ClangToolTest, NoDoubleSyntaxOnly) { … }
TEST(ClangToolTest, NoOutputCommands) { … }
TEST(ClangToolTest, BaseVirtualFileSystemUsage) { … }
TEST(ClangToolTest, StripDependencyFileAdjuster) { … }
TEST(ClangToolTest, StripDependencyFileAdjusterShowIncludes) { … }
TEST(ClangToolTest, StripDependencyFileAdjusterMsvc) { … }
TEST(ClangToolTest, StripPluginsAdjuster) { … }
TEST(addTargetAndModeForProgramName, AddsTargetAndMode) { … }
TEST(addTargetAndModeForProgramName, PathIgnored) { … }
TEST(addTargetAndModeForProgramName, IgnoresExistingTarget) { … }
TEST(addTargetAndModeForProgramName, IgnoresExistingMode) { … }
#ifndef _WIN32
TEST(ClangToolTest, BuildASTs) { … }
TEST(ClangToolTest, InjectDiagnosticConsumer) { … }
TEST(ClangToolTest, InjectDiagnosticConsumerInBuildASTs) { … }
#endif
TEST(runToolOnCode, TestResetDiagnostics) { … }
}
}