[PATCH] D80528: [clang-format][WIP] Run more stability FormatTests

Jake Merdich via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon May 25 11:47:05 PDT 2020


JakeMerdichAMD created this revision.
JakeMerdichAMD added reviewers: MyDeveloperDay, sammccall, mitchell-stellar, krasimir.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
JakeMerdichAMD added a project: clang-format.
Herald added a subscriber: ormris.

I've been seeing a lot of complaints of unstable output in the bug
tracker, and noticed that a good chunk of our tests weren't checking
this. The verifyFormat functions do this, but a lot of tests don't use
these, and they miss out on the stability checks.

This change replaces all instances of EXPECT_EQ(..., format(...)) with a
verifyFormat equivalent (I'll share the regex if you like; it's
horrifying). It also narrows the criteria to rerun a test with
objective-c in verifyFormat, since some of the migrated tests were
(correctly) failing when run with ObjC vs Cpp.

WIP because:

1. Several tests are failing because their expected output is unstable, and the underlying issues there need to be fixed.
2. It's harder to differenciate the expected vs input text than using EXPECT_EQ. Ideas?
3. This only does it for FormatTests.cpp. Needs to be done on the rest.

I wanted to get some feedback and general opinions on this as I debug
the underlying issues, as well as to encourage any new tests to be
written with verifyFormat instead of EXPECT_EQ. Thoughts?


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D80528

Files:
  clang/unittests/Format/FormatTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D80528.266058.patch
Type: text/x-patch
Size: 276191 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200525/da71b4a3/attachment-0001.bin>


More information about the cfe-commits mailing list