[PATCH] D83834: Add test utility 'extract'

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Jul 25 01:50:43 PDT 2020


grimar added a comment.

In D83834#2172509 <https://reviews.llvm.org/D83834#2172509>, @MaskRay wrote:

> In D83834#2172461 <https://reviews.llvm.org/D83834#2172461>, @lattner wrote:
>
> > Unrelatedly, I don't agree with your rationale for having a separate tool.  You're right that moving files to an Inputs directory moves them further away, but that isn't what I was suggesting.  Also, there is great precedent across the testsuite for this, and the proposed tool isn't a general solution to the problem (e.g. binary files etc).
>
>
> I acknowledge that this falls into subjective points of view and people may have different opinions. For me, non-trivial separate files (not creatable with one-line echo) have caused enough pain to me. It is not unusual for me open two or three auxiliary files in Inputs/ to understand the purpose of a test. If I don't count wrong, at least @grimar, @jhenderson and @probinson hold a similar viewpoint.
>
> (For binary files, they are sometimes useful, e.g. when testing compatibility of LLVM IR. a llvm/test/Bitcode/ pre-built file ensures that compatibility is retained. However, their use cases are very narrow. In 99% cases textual formats will be a superior replacement. I hope we don't let 1% inapplicable use case to be the reason that a general purpose testing utility should not be introduced. )


I have a strong +1 to have a way to keep inputs and test in a single file. It significantly improves readability from my experience. E.g. we have `--docnum=x`
option for yaml2obj and it is cwry common for llvm-readelf tests to have a few little YAML inputs in the same file. We introduced macros support for yaml2obj  (-DMACRO=<val>)
and default values for them recently and this also helps to reuse YAML descriptions from the same file what generally helps to isolate test cases, reuse them for similar tests and keep the whole file compact.
If we had separate inputs it would be very hard to mantain those tests I believe.

Initially D84054 <https://reviews.llvm.org/D84054> suggested the `--doc-id=<id>` option for `llvm-mc` which could help to solve a problem for asm files to avoid splitting. I think it was good solution by itself,
but also, having a separate tool is probably a more general solution for achieving the same.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D83834/new/

https://reviews.llvm.org/D83834





More information about the llvm-commits mailing list