xref: /aosp_15_r20/build/bazel/json_module_graph/findModulesWithTestSuitesValue.jq (revision 7594170e27e0732bc44b93d1440d87a54b6ffe7c)
1# CMD: Returns the modules that have test_suites property with $arg as one of its value. Use $arg2 as the top level field key to be collected, e.g. Name, Blueprint.
2
3def hasTestSuitesWithValue($a):
4  .[] | select(.Name == "Test_suites") | .Values | .[] | . == $a
5;
6
7[.[] |
8select(.Module.Android.SetProperties |
9    if . == null then [] else . end |
10    hasTestSuitesWithValue($arg)) |
11.[$arg2] ] | unique | sort | .[]
12