`lit` feature request: better file excludes + ability to exclude directories
Hi all!
Currently, lit's config.excludes works a bit strangely. Imagine I have a file tree:
tests/
├─ test0.v
├─ test1.v
├─ test1_includes/
│ ├─ include.v
├─ lit.cfg
(.v here because I'm using lit for Verilog-based tests)
test1.v here uses test1_includes/include.v. However, I don't want lit to attempt to run include.v as a test -- I want it to be ignored.
Currently, to get lit to ignore include.v, I need to add 'include.v' to config.excludes in lit.cfg. But this is strange! It's not test1_includes/include.v, which would make more sense. Instead, it has to just be the filename itself, not the path leading up to the file.
The problem with this is that now include.v will be ignored everywhere in my test suite, which is not the intention.
There are a few ways I think this could be fixed:
- The easiest way would be to just allow for directory excludes -- then I could exclude
test1_includesas a whole. - The next way would be to check for relative paths when looking at excludes. Then,
config.excludeswould includetest1_includes/include.vinstead ofinclude.v, andinclude.vwouldn't be excluded from the suite wherever else it appears.
In the short term I can get around this by just not having name collisions, but it seems like weird behavior in lit.
Thank you all!
You can already limit the scope of excludes by using test1_includes/lit.local.cfg which has just config.excludes = ["include.v"]
it would be good to have a command line argument support as well like llvm-lit . --exclude <subdir>
edit: My bad, there is an option called --filter-out for this