clang-tools 20.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/Annotations/Annotations.h"
#include "gmock/gmock.h"
#include "gtest/gtest.h"
#include <memory>
#include <string>

Go to the source code of this file.

Classes

class  clang::clangd::TweakTest
 

Namespaces

namespace  clang
 ===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//
 
namespace  clang::clangd
 FIXME: Skip testing on windows temporarily due to the different escaping code mode.
 

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.