//===-- QualityTests.cpp ----------------------------------------*- 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 // //===----------------------------------------------------------------------===// // // Evaluating scoring functions isn't a great fit for assert-based tests. // For interesting cases, both exact scores and "X beats Y" are too brittle to // make good hard assertions. // // Here we test the signal extraction and sanity-check that signals point in // the right direction. This should be supplemented by quality metrics which // we can compute from a corpus of queries and preferred rankings. // //===----------------------------------------------------------------------===// #include "FileDistance.h" #include "Quality.h" #include "TestFS.h" #include "TestTU.h" #include "index/FileIndex.h" #include "clang/AST/Decl.h" #include "clang/AST/DeclCXX.h" #include "clang/Sema/CodeCompleteConsumer.h" #include "llvm/Support/Casting.h" #include "gmock/gmock.h" #include "gtest/gtest.h" #include <vector> namespace clang { namespace clangd { // Force the unittest URI scheme to be linked, static int LLVM_ATTRIBUTE_UNUSED UnittestSchemeAnchorDest = …; namespace { TEST(QualityTests, SymbolQualitySignalExtraction) { … } TEST(QualityTests, SymbolRelevanceSignalExtraction) { … } // Do the signals move the scores in the direction we expect? TEST(QualityTests, SymbolQualitySignalsSanity) { … } TEST(QualityTests, SymbolRelevanceSignalsSanity) { … } TEST(QualityTests, ScopeProximity) { … } TEST(QualityTests, SortText) { … } TEST(QualityTests, NoBoostForClassConstructor) { … } TEST(QualityTests, IsInstanceMember) { … } TEST(QualityTests, ConstructorDestructor) { … } TEST(QualityTests, Operator) { … } TEST(QualityTests, ItemWithFixItsRankedDown) { … } } // namespace } // namespace clangd } // namespace clang