[clang] [clang][NFC] Reduce one of JSON dump tests (PR #195026)
Vlad Serebrennikov via cfe-commits
cfe-commits at lists.llvm.org
Thu Apr 30 05:09:18 PDT 2026
Endilll wrote:
> So this PR replaces one automatically generated large test, with a small manually maintained one. That doesn't seem like a maintainability improvement to me.
By this logic, we should throw away all our manually-written tests, and replace them with the output of test-generating scripts, because running a script is much easier than thinking what exactly needs to be tested.
It's easier to maintain, because it's easier to see what is important. For instance, it doesn't capture absolutely useless details like byte offsets or predefined `__int128`.
> I think this reduces our ability to maintain the JSON dumping infrastructure.
Our ability to maintain anything is reduced by huge tests in the same way big reproducers get in the way of understanding what's going on in any given issue.
> Also, why only this test? There are multiple other large automatically generated AST JSON dump tests.
Because I'm working on another patch that modifies _textual_ AST dump (#194600), and this was the only test I had to touch that captured byte offsets.
> However, this file contains some source code patterns which are unique relative to these other tests.
I definitely captured one of those patterns. I can add more, but I'm at a loss what exactly is useful in that 9k lines dump. I do not believe we need all of that, as we're only matching ≈100 lines out of ≈550 lines of textual AST dump.
https://github.com/llvm/llvm-project/pull/195026
More information about the cfe-commits
mailing list