[clang] [clang][analyzer] Fix alignment of entries in -analyzer-help (PR #190570)
via cfe-commits
cfe-commits at lists.llvm.org
Tue Apr 7 19:01:07 PDT 2026
================
@@ -0,0 +1,197 @@
+//===- AnalyzerFormattingTest.cpp - SA Formatting test --------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+//
+// This file contains tests for printFormattedEntry function, which is used for
+// printing available analyzers and their descriptions.
+//
+//===----------------------------------------------------------------------===//
+
+#include "clang/StaticAnalyzer/Core/AnalyzerOptions.h"
+#include "llvm/ADT/SmallString.h"
+#include "llvm/Support/raw_ostream.h"
+#include "gtest/gtest.h"
+
+using namespace clang::ento;
+
+static void runPrintFormattedEntry(
+ std::pair<llvm::StringRef, llvm::StringRef> EntryDescPair,
+ size_t InitialPad, size_t EntryWidth, size_t MinLineWidth,
+ llvm::SmallString<256> &OutBuffer) {
+ llvm::raw_svector_ostream Out(OutBuffer);
+ clang::AnalyzerOptions::printFormattedEntry(Out, EntryDescPair, InitialPad,
+ EntryWidth, MinLineWidth);
+}
+
+// No wrapping after checker's name.
+// No initial pad.
+TEST(PrintFormattedEntryTest, SimplePrint) {
+ llvm::SmallString<256> Buffer;
+ runPrintFormattedEntry(/*EntryDescPair=*/{"Checkers", "A description"},
----------------
filaka771 wrote:
Fixed. Thanks.
https://github.com/llvm/llvm-project/pull/190570
More information about the cfe-commits
mailing list