Kum
Kum

Reputation: 63

How to use bazel query to get all test rule types in BUILD file?

A bazel query like bazel query 'kind(".*_test", //path/to/package:*)' will give the names of all test rules in the BUILD file.
But how would one get the actual test rule types in the BUILD file? i.e., py_test, cc_test, ... find out which of these types of rules existed/

Upvotes: 1

Views: 5687

Answers (1)

ahumesky
ahumesky

Reputation: 5026

Try using the --output label_kind flag, e.g.:

https://docs.bazel.build/versions/master/query-how-to.html#what-rules-are-defined-in-the-foo-package

Upvotes: 2

Related Questions