This change moves tests for checkers and infrastructure into separate
directories, making it easier to find infrastructure tests. Tests for
checkers are already easy to find because they are named after the
checker. Tests for infrastructure were difficult to find because they
were outnumbered by tests for checkers. Now they are in a separate
directory.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Description says:
making it easier to find infrastructure tests
Tests for infrastructure were difficult to find because they were outnumbered by tests for checkers.
So presumably there far fewer infra tests as compared to checker tests,
and the issue is specifically with infra tests.
Why not improve that *specifically*?
It would look weird if we have a ton of tests for checkers in a directory, and then a subdirectory for infra tests.
Why are we trying to optimize the number of renamed files? I already did the renaming, so we are not saving any work. I think we should optimize for long-term readability of the codebase.
I agree that the test/clang-tidy directory has become hard to navigate. Splitting tests for checks and for infrastructure seems reasonable to me. I personally don't care about specific directory names and file moves/renames are also not a concern, since git is rather good at handling those. I personally strongly prefer long-term improvements over desire to minimize churn.
My only concern is that the add_new_check.py script is updated to put new tests to the right place - totally fine for a follow up though.
One more thing is that having all checker tests in one directory is still not particularly nice, but the alternatives I thought of are not clearly superior:
0. test/clang-tidy/modernize-blah-blah.cpp - current state
- test/clang-tidy/checkers/modernize-blah-blah.cpp - this patch
- test/clang-tidy/checkers/modernize/blah-blah.cpp - test names don't have the check name substring, which makes them slightly harder to find with eyes
- test/clang-tidy/checkers/modernize/modernize-blah-blah.cpp - a bit tautological, even longer full file names
I'm fine with any of 1-3, since there's no clear winner among the three options.