This is an archive of the discontinued LLVM Phabricator instance.

[clang-tidy] Organize test files into subdirectories by module (NFC)
ClosedPublic

Authored by LegalizeAdulthood on Jun 17 2022, 10:28 AM.

Details

Summary

Eliminate clutter by reorganizing the Lit test files for clang-tidy:

  • Move checkers/<module>-* to checkers/<module>/*.
  • Move module specific inputs from Inputs to <module>/Inputs. Remove any module prefix from the file or subdirectory name as they are no longer needed.
  • Introduce a Lit substitution %clang_tidy_headers for the system headers in checkers/Inputs/Headers and use this throughout. This avoids referencing system headers through a relative path to the parent directory and makes it clear that these fake system headers are shared among all modules.
  • Update add_new_check.py to follow the above conventions when creating the boiler plate test files for a new check.
  • Update Contributing.rst to describe per-module Inputs directory and fix link to test source code.

Diff Detail

Event Timeline

LegalizeAdulthood requested review of this revision.Jun 17 2022, 10:28 AM
aaron.ballman accepted this revision.Jun 21 2022, 5:18 AM

This sounds like a sensible direction to me. I spot-checked the changes and they all seem reasonable. Giving my LG, but please wait a bit before landing in case someone else has the chance to spot check as well.

This revision is now accepted and ready to land.Jun 21 2022, 5:18 AM

This sounds like a sensible direction to me. I spot-checked the changes and they all seem reasonable. Giving my LG, but please wait a bit before landing in case someone else has the chance to spot check as well.

Testing was:

  • check-clang-extra passed
  • add_new_check.py added the boiler plate test code in the correct place
This revision was landed with ongoing or failed builds.Jun 22 2022, 11:13 AM
This revision was automatically updated to reflect the committed changes.

Just noticed something nice about this, cmake targets are generated for each module
Should speed up development as you now only need to run the lit tests for the module that you are working on check-clang-extra-clang-tidy-checkers-misc etc