DXR is a code search and navigation tool aimed at making sense of large projects. It supports full-text and regex searches as well as structural queries.

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

import os
import sys
from reftest import ReftestManifest

def printTestDirs(topsrcdir, topmanifests):
    """Parse |topmanifests| and print a list of directories containing the tests
    within (and the manifests including those tests), relative to |topsrcdir|.
    """
    topsrcdir = os.path.abspath(topsrcdir)
    dirs = set()
    for path in topmanifests:
        m = ReftestManifest()
        m.load(path)
        dirs |= m.dirs

    for d in sorted(dirs):
        d = d[len(topsrcdir):].replace('\\', '/').lstrip('/')
        print(d)

if __name__ == '__main__':
    if len(sys.argv) < 3:
      print >>sys.stderr, "Usage: %s topsrcdir reftest.list [reftest.list]*" % sys.argv[0]
      sys.exit(1)
    printTestDirs(sys.argv[1], sys.argv[2:])