9 Commits

Author SHA1 Message Date
Owen Pan
f2f17e563d
[clang-format][NFC] Remove \brief from comments (#145853)
This was done before in https://reviews.llvm.org/D46320
2025-06-26 19:14:34 -07:00
Owen Pan
ddbe6c412b
[clang-format[NFC] Clean up FormatTestBase and Proto/TextProto tests (#108334) 2024-09-17 21:15:44 -07:00
Owen Pan
1c58208d89 [clang-format][NFC] Remove redundnat llvm::, clang::, etc. 2024-05-20 20:32:18 -07:00
Owen
7ecbf6c306
[clang-format][NFC] Skip remaining tests of the same case upon failure (#65540)
A typical test case goes through the format, stability, ObjC, and messUp
tests. If any of theses tests fails, we should skip the remaining tests
for the same test case.
2023-09-08 01:06:54 -07:00
Owen Pan
6982f1fc2e [clang-format][NFC] Test formatting the input before messing it up
Differential Revision: https://reviews.llvm.org/D158947
2023-08-29 00:59:33 -07:00
Owen Pan
c852145170 [clang-format][NFC] Skip stability test if input is pre-formatted
This shortens the run-time of FormatTests by about 10% on average (and
by up to 50% if formatting would not change the input).

Differential Revision: https://reviews.llvm.org/D158925
2023-08-26 14:48:04 -07:00
Owen Pan
20b4df1ed6 [clang-format][NFC] Clean up unit tests
This patch adds a verifyNoChange macro to verify code that won't
change after being formatted. (The code will not be messed up before
being formatted.) It then replaces EXPECT_EQ with verifyFormat
wherever applicable so that the code will be messed up before being
formatted. When the replacement fails the unit test, verifyFormat is
replaced with verifyNoChange.

Differential Revision: https://reviews.llvm.org/D153109
2023-06-16 16:03:19 -07:00
sstwcw
6cef325481 [clang-format] Don't squash Verilog escaped identifiers
An escaped identifier always needs a space following it so the parser
can tell it apart from the next token.

The unit tests are changed to use `FormatTestBase.h` because we need the
2-argument version of `verifyFormat`.  We also added the `messUp`
virtual function because Verilog needs a different version of it.

Reviewed By: HazardyKnusperkeks

Differential Revision: https://reviews.llvm.org/D146401
2023-03-26 22:45:44 +00:00
Manuel Klimek
f8d10d5ac9 [clang-format][NFC] Refactor formatting unit tests.
Pull out common base class for formatting unit tests, removing duplicate
code that accumulated over the years.

Pull out macro expansion test into its own test file.
2023-03-01 12:36:07 +00:00