[clang-tools-extra] f1bf41e - Fix buildbot failure for 702529d899c87e9268bb33d836dbc91b6bce0b16.
Haojian Wu via cfe-commits
cfe-commits at lists.llvm.org
Mon Oct 12 03:06:30 PDT 2020
Author: Haojian Wu
Date: 2020-10-12T12:04:44+02:00
New Revision: f1bf41e433e196ecffcc4fb7cd04c58d48445425
URL: https://github.com/llvm/llvm-project/commit/f1bf41e433e196ecffcc4fb7cd04c58d48445425
DIFF: https://github.com/llvm/llvm-project/commit/f1bf41e433e196ecffcc4fb7cd04c58d48445425.diff
LOG: Fix buildbot failure for 702529d899c87e9268bb33d836dbc91b6bce0b16.
Added:
Modified:
clang-tools-extra/clangd/unittests/ParsedASTTests.cpp
Removed:
################################################################################
diff --git a/clang-tools-extra/clangd/unittests/ParsedASTTests.cpp b/clang-tools-extra/clangd/unittests/ParsedASTTests.cpp
index db23438766d2..e2de95909fbf 100644
--- a/clang-tools-extra/clangd/unittests/ParsedASTTests.cpp
+++ b/clang-tools-extra/clangd/unittests/ParsedASTTests.cpp
@@ -60,6 +60,10 @@ MATCHER_P(DeclNamed, Name, "") {
MATCHER_P(DeclKind, Kind, "") {
if (NamedDecl *ND = dyn_cast<NamedDecl>(arg))
return ND->getDeclKindName() == Kind;
+ if (auto *Stream = result_listener->stream()) {
+ llvm::raw_os_ostream OS(*Stream);
+ arg->dump(OS);
+ }
return false;
}
@@ -110,10 +114,10 @@ TEST(ParsedASTTest, TopLevelDecls) {
template <typename> bool X = true;
)cpp";
auto AST = TU.build();
- EXPECT_THAT(
- AST.getLocalTopLevelDecls(),
- ElementsAreArray({AllOf(DeclNamed("main"), DeclKind("Function")),
- AllOf(DeclNamed("X"), DeclKind("VarTemplate"))}));
+ EXPECT_THAT(AST.getLocalTopLevelDecls(),
+ testing::UnorderedElementsAreArray(
+ {AllOf(DeclNamed("main"), DeclKind("Function")),
+ AllOf(DeclNamed("X"), DeclKind("VarTemplate"))}));
}
TEST(ParsedASTTest, DoesNotGetIncludedTopDecls) {
More information about the cfe-commits
mailing list