bazel-skylib
bazel-skylib copied to clipboard
support accepting files in analysis_test.targets
One may want to specify:
analysis_test(
name = "my_test",
targets = ["foo.o"],
But currently targets does not support files.
At first glance, this would seem easy to implement, using attr.label_list.allow_files, however, this approach poses a different problem: one can then specify a file that does not actually exist, and the analysis_test thus passes.
Thus, the above example test might fail if the rule generating foo.o fails, but the following would pass:
analysis_test(
name = "my_test",
targets = ["foo.o_oopsfatfinger"],
We'd need some way to ensure an input file actually exists to implement this feature.