clang-tools  15.0.0git
Classes | Namespaces | Macros | Functions
TweakTesting.h File Reference
#include "ParsedAST.h"
#include "index/Index.h"
#include "llvm/ADT/StringMap.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Testing/Support/Annotations.h"
#include "gmock/gmock.h"
#include "gtest/gtest.h"
#include <memory>
#include <string>
Include dependency graph for TweakTesting.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  clang::clangd::TweakTest
 

Namespaces

 clang
 ===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//
 
 clang::clangd
 

Macros

#define TWEAK_TEST(TweakID)
 
#define EXPECT_AVAILABLE_(MarkedCode, Available)
 
#define EXPECT_AVAILABLE(MarkedCode)   EXPECT_AVAILABLE_(MarkedCode, true)
 
#define EXPECT_UNAVAILABLE(MarkedCode)   EXPECT_AVAILABLE_(MarkedCode, false)
 

Functions

 clang::clangd::MATCHER_P2 (FileWithContents, FileName, Contents, "")
 

Macro Definition Documentation

◆ EXPECT_AVAILABLE

#define EXPECT_AVAILABLE (   MarkedCode)    EXPECT_AVAILABLE_(MarkedCode, true)

Definition at line 123 of file TweakTesting.h.

◆ EXPECT_AVAILABLE_

#define EXPECT_AVAILABLE_ (   MarkedCode,
  Available 
)
Value:
do { \
llvm::Annotations A{llvm::StringRef(MarkedCode)}; \
auto AST = build(A.code()); \
assert(!A.points().empty() || !A.ranges().empty()); \
for (const auto &P : A.points()) \
EXPECT_EQ(Available, isAvailable(AST, {P, P})) << decorate(A.code(), P); \
for (const auto &R : A.ranges()) \
EXPECT_EQ(Available, isAvailable(AST, R)) << decorate(A.code(), R); \
} while (0)

Definition at line 113 of file TweakTesting.h.

◆ EXPECT_UNAVAILABLE

#define EXPECT_UNAVAILABLE (   MarkedCode)    EXPECT_AVAILABLE_(MarkedCode, false)

Definition at line 124 of file TweakTesting.h.

◆ TWEAK_TEST

#define TWEAK_TEST (   TweakID)
Value:
class TweakID##Test : public ::clang::clangd::TweakTest { \
protected: \
TweakID##Test() : TweakTest(#TweakID) {} \
}

Definition at line 107 of file TweakTesting.h.

AST
llvm::Optional< ParsedAST > AST
Definition: SymbolCollectorTests.cpp:135
ns1::ns2::A
@ A
Definition: CategoricalFeature.h:3
clang::clangd::TweakTest
Definition: TweakTesting.h:41