llvm/clang/unittests/Tooling/SourceCodeTest.cpp

//===- unittest/Tooling/SourceCodeTest.cpp --------------------------------===//
//
// 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
//
//===----------------------------------------------------------------------===//

#include "clang/Tooling/Transformer/SourceCode.h"
#include "TestVisitor.h"
#include "clang/ASTMatchers/ASTMatchFinder.h"
#include "clang/Basic/Diagnostic.h"
#include "clang/Basic/SourceLocation.h"
#include "clang/Lex/Lexer.h"
#include "llvm/Testing/Annotations/Annotations.h"
#include "llvm/Testing/Support/Error.h"
#include "llvm/Testing/Support/SupportHelpers.h"
#include <gmock/gmock.h>
#include <gtest/gtest.h>

usingnamespaceclang;
usingnamespaceclang::ast_matchers;

Failed;
Succeeded;
ValueIs;
Optional;
getAssociatedRange;
getExtendedRange;
getExtendedText;
getFileRangeForEdit;
getText;
maybeExtendRange;
validateEditRange;

namespace {

struct IntLitVisitor : TestVisitor<IntLitVisitor> {};

struct CallsVisitor : TestVisitor<CallsVisitor> {};

struct TypeLocVisitor : TestVisitor<TypeLocVisitor> {};

// Equality matcher for `clang::CharSourceRange`, which lacks `operator==`.
MATCHER_P(EqualsRange, R, "") {}

MATCHER_P2(EqualsAnnotatedRange, Context, R, "") {}

static ::testing::Matcher<CharSourceRange> AsRange(const SourceManager &SM,
                                                   llvm::Annotations::Range R) {}

// Base class for visitors that expect a single match corresponding to a
// specific annotated range.
template <typename T> class AnnotatedCodeVisitor : public TestVisitor<T> {};

TEST(SourceCodeTest, getText) {}

TEST(SourceCodeTest, getTextWithMacro) {}

TEST(SourceCodeTest, getExtendedText) {}

TEST(SourceCodeTest, maybeExtendRange_TokenRange) {}

TEST(SourceCodeTest, maybeExtendRange_CharRange) {}

TEST(SourceCodeTest, getAssociatedRange) {}

TEST(SourceCodeTest, getAssociatedRangeClasses) {}

TEST(SourceCodeTest, getAssociatedRangeClassTemplateSpecializations) {}

TEST(SourceCodeTest, getAssociatedRangeFunctions) {}

TEST(SourceCodeTest, getAssociatedRangeMemberTemplates) {}

TEST(SourceCodeTest, getAssociatedRangeWithComments) {}

TEST(SourceCodeTest, getAssociatedRangeInvalidForPartialExpansions) {}

class GetFileRangeForEditTest : public testing::TestWithParam<bool> {};
INSTANTIATE_TEST_SUITE_P();

TEST_P(GetFileRangeForEditTest, EditRangeWithMacroExpansionsShouldSucceed) {}

TEST(SourceCodeTest, EditWholeMacroExpansionShouldSucceed) {}

TEST(SourceCodeTest, EditInvolvingExpansionIgnoringExpansionShouldFail) {}

TEST(SourceCodeTest, InnerNestedTemplate) {}

TEST_P(GetFileRangeForEditTest, EditPartialMacroExpansionShouldFail) {}

TEST_P(GetFileRangeForEditTest, EditWholeMacroArgShouldSucceed) {}

TEST_P(GetFileRangeForEditTest, EditPartialMacroArgShouldSucceed) {}

TEST(SourceCodeTest, EditRangeWithMacroExpansionsIsValid) {}

TEST(SourceCodeTest, SpellingRangeOfMacroArgIsValid) {}

TEST(SourceCodeTest, InvalidEditRangeIsInvalid) {}

TEST(SourceCodeTest, InvertedEditRangeIsInvalid) {}

TEST(SourceCodeTest, MacroArgIsInvalid) {}

TEST(SourceCodeTest, EditWholeMacroExpansionIsInvalid) {}

TEST(SourceCodeTest, EditPartialMacroExpansionIsInvalid) {}

TEST(SourceCodeTest, GetCallReturnType_Dependent) {}

} // end anonymous namespace