This is an archive of the discontinued LLVM Phabricator instance.

[clang-format][NFC] Moved configuration parsing tests in own file
ClosedPublic

Authored by HazardyKnusperkeks on Nov 11 2022, 3:09 AM.

Details

Summary

I want to reduce the size of ForatTest.cpp with its still wopping 25k lines it is a burden on the compiler and editor (mine is clangd powered).

This are tests which are really serving a different purpose than formatting.

I've copied the code and made the following changes:

  • Dropped the ; at the end of some macros, all macro "invocations" already have their own ;.
  • Dropped the _F, we don't need a fxiture here.

Diff Detail

Event Timeline

Herald added a project: Restricted Project. · View Herald TranscriptNov 11 2022, 3:09 AM
Herald added a subscriber: kadircet. · View Herald Transcript
HazardyKnusperkeks requested review of this revision.Nov 11 2022, 3:09 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 11 2022, 3:09 AM
rymiel added inline comments.Nov 11 2022, 5:20 AM
clang/unittests/Format/ConfigParseTest.cpp
2

typo (Confi) :)

HazardyKnusperkeks marked an inline comment as done.Nov 11 2022, 9:10 AM
HazardyKnusperkeks added inline comments.
clang/unittests/Format/ConfigParseTest.cpp
2

Will be correct on push.

owenpan added inline comments.Nov 12 2022, 11:12 PM
clang/unittests/Format/ConfigParseTest.cpp
15

You can delete it.

1007

Otherwise, the test will be skipped.

1014

Change FormatStyle to ParseTest here and on line 1220 below.

HazardyKnusperkeks marked 3 inline comments as done.Nov 14 2022, 12:58 PM
HazardyKnusperkeks added inline comments.
clang/unittests/Format/ConfigParseTest.cpp
1007

That is not true.
It will be executed, and that was the name in the beginning.

I only changed the old FormatTest to ParseTest and didn't change these 3, because I thought someone made this on purpose.

[ RUN      ] ParseTest.ConfigurationRoundTripTest
[       OK ] ParseTest.ConfigurationRoundTripTest (4 ms)
[----------] 7 tests from ParseTest (201 ms total)

[----------] 3 tests from FormatStyle
[ RUN      ] FormatStyle.GetStyleWithEmptyFileName
[       OK ] FormatStyle.GetStyleWithEmptyFileName (3 ms)
1014

Discussion above.

HazardyKnusperkeks marked an inline comment as done.
owenpan added inline comments.Nov 14 2022, 4:25 PM
clang/unittests/Format/ConfigParseTest.cpp
1007

You are right. However, IMO we should still rename FormatTest. In fact, we should rename both ParseTest and FormatTest to ConfigParseTest to match the filename like other test files.

HazardyKnusperkeks marked 2 inline comments as done.
owenpan accepted this revision.Nov 15 2022, 12:59 PM

Thanks!

This revision is now accepted and ready to land.Nov 15 2022, 12:59 PM
MyDeveloperDay accepted this revision.Nov 16 2022, 3:37 PM