Given a file name, I would like to determine all *_test
rules which depend on that file.
Is there any way to query this information from Bazel, either through bazel query
or through some other means?
bazel query 'rdeps(tests(//...), //build_tests:gflags.cc)'
. tests(//...)
gives you all the *_test
rules, and rdeps
gives you reverse dependencies of its second argument within the first argument.