title: How to query list of data files used by a bazel test
body: <p>I have a <code>cc_test</code> defined as follows:</p>
  
  <pre><code>filegroup(
      name = "test_data",
      srcs = [
          "abc/abc.txt",
          "def.txt",
      ],
  )
  
  cc_test(
      name = "my_test",
      size = "small",
      srcs = [
          "test_a.cpp",
      ],
      data = [
          ":test_data",
      ],
  )
  </code></pre>
  
  <p>I would like to query the <code>data</code> files (or <code>runfiles</code>) used for this test (in this case <code>abc/abc.txt</code> and <code>def.txt</code>) using <code>bazel query</code>.</p>
  
  <p>I need a list of  data files used by some of my tests to be used in a script.</p>
  
  <p>This is how far I have gotten:</p>
  
  <pre><code>$bazel query 'kind("source file", deps(//xxx/...))'
  @bazel_tools//tools/test:test-setup.sh
  @bazel_tools//tools/test:collect_coverage.sh
  @bazel_tools//tools/def_parser:no_op.bat
  @bazel_tools//tools/def_parser:def_parser.exe
  @bazel_tools//tools/cpp:link_dynamic_library.sh
  @bazel_tools//tools/cpp:grep-includes.sh
  @bazel_tools//tools/cpp:build_interface_so
  @bazel_tools//tools/coverage:dummy_coverage_report_generator
  @bazel_tools//third_party/def_parser:def_parser_main.cc
  @bazel_tools//third_party/def_parser:def_parser.h
  @bazel_tools//third_party/def_parser:def_parser.cc
  //xxx:test_a.cpp
  //xxx:def.txt
  //xxx:abc/abc.txt
  </code></pre>
  
  <p>I only want a subset of this list, that is only the test files (<code>//xxx:def.txt</code> and <code>//xxx:abc/abc.txt</code>)</p>
  
  <p>Is is possible to do so?</p>