bazel-skylib icon indicating copy to clipboard operation
bazel-skylib copied to clipboard

support accepting files in analysis_test.targets

Open c-parsons opened this issue 6 years ago • 0 comments

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.

c-parsons avatar Feb 26 '19 18:02 c-parsons